Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launch Error #2734

Closed
aagiser opened this issue Mar 10, 2024 · 22 comments
Closed

Launch Error #2734

aagiser opened this issue Mar 10, 2024 · 22 comments
Assignees
Labels
bug Something isn't working

Comments

@aagiser
Copy link

aagiser commented Mar 10, 2024

Description

I have a problem with launcher. This problem is in source build installation, not binary. When I use binary, it works correctly. But when I install MoveIt 2 from source, it doesn't work. Note, tutorials launch files works without problems.

My environment

  • ROS Distro: Humble
  • OS Version: Ubuntu 22.04
  • Source build branch humble
  • Cyclone DDS

Steps to reproduce

I created a moveit package using setup_assistant. Its name is moveit2_package. After building and sourcing the workspace, I launched the launch file.
$ ros2 launch moveit2_package demo.launch.py

Expected behaviour

Opening RViz2 with the robot
It is correct when I install MoveIt 2 from binary!

Actual behaviour

An error occured.

Backtrace or Console output

[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'

@aagiser aagiser added the bug Something isn't working label Mar 10, 2024
@aagiser
Copy link
Author

aagiser commented Mar 10, 2024

The output of
ros2 launch moveit2_package demo.launch.py --debug
is:

[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'
[INFO] [launch]: All log files can be found below /home/aagiser/.ros/log/2024-03-10-09-36-20-886303-DP5540-5655
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7bc621cb04c0>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7bc621cb04c0>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x7bc6231653c0>'
[DEBUG] [launch.launch_description_source]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 69, in try_get_launch_description_without_context
    return self._get_launch_description(expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/aagiser/FUM6R-WS/install/moveit2_package/share/moveit2_package/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/aagiser/ws_moveit2/install/moveit_configs_utils/lib/python3.10/site-packages/moveit_configs_utils/launches.py", line 203, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[DEBUG] [launch.launch_description_source]: Failed to load the launch file without a context: 'capabilities'
Executing <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:228> exception=KeyError('capabilities') created at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:318> took 0.566 seconds
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 336, in run_async
    raise completed_tasks_exceptions[0]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 1 more time]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/include_launch_description.py", line 148, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/aagiser/FUM6R-WS/install/moveit2_package/share/moveit2_package/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/aagiser/ws_moveit2/install/moveit_configs_utils/lib/python3.10/site-packages/moveit_configs_utils/launches.py", line 203, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7bc6231653f0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7bc6231653f0>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7bc62165acb0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7bc6231653f0>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7bc623165d80>'

@BillyMazotti
Copy link

BillyMazotti commented Mar 12, 2024

Getting the same error on iron too, my environment:

  • ROS Distro: Iron
  • OS Version: Ubuntu 22.04
  • Source build branch iron

Project is a custom urdf. Haven't tried moveit2 with binary, will now!

@Jakubivan
Copy link

Jakubivan commented Mar 12, 2024

The output of ros2 launch moveit2_package demo.launch.py --debug is:
...

I got the same error on the same setup.

Probably because of
#2696 ?

@mink007
Copy link

mink007 commented Mar 13, 2024

any luck with this issue?

I am having the same issue when launching "ros2 launch demo.launch.py rviz_tutorial:=true "

@mink007
Copy link

mink007 commented Mar 14, 2024

when i install moveit2 from build from source, then i don't get this error "[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'".
But it is causing the robot model to not load in rviz.

i was looking for previous version number than "ros-iron-moveit/jammy,now 2.8.0-1jammy.20240213.190919 amd64 [installed]"
but was unable to figure out which the previous version number is. Was thinking of installing an older version to get around the issue.


apt list -a ros-iron-moveit
Listing... Done
ros-iron-moveit/jammy,now 2.8.0-1jammy.20240213.190919 amd64 [installed]


@roshea6
Copy link

roshea6 commented Apr 15, 2024

I recently experienced the same error when building a custom panda setup with the moveit_setup_assistant. I eventually traced my error to having built the colcon moveit_ws as instructed in their tutorial here: https://moveit.picknik.ai/humble/doc/tutorials/getting_started/getting_started.html. After removing the old log, install, and build folders from that old workspace in addition to my new workspace, I was able to launch my custom configuration based on the panda arm. My new workspace just included the panda_description package and my newly generated package that was generated by the setup_assistant and based on panda description package.

@cananella
Copy link

cananella commented Apr 15, 2024

I also had a similar problem


~$ ros2 launch mycobot_moveit demo.launch.py --debug
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'
[INFO] [launch]: All log files can be found below /home/kairos/.ros/log/2024-04-15-14-29-22-598832-kairos-ubuntu22-109096
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7f45a82b0400>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7f45a82b0400>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x7f45a973af80>'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[DEBUG] [launch.launch_description_source]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 69, in try_get_launch_description_without_context
    return self._get_launch_description(expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/kairos/ros2WS/install/mycobot_moveit/share/mycobot_moveit/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/kairos/ros2WS/install/moveit_configs_utils/lib/python3.10/site-packages/moveit_configs_utils/launches.py", line 204, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[DEBUG] [launch.launch_description_source]: Failed to load the launch file without a context: 'capabilities'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Executing <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:228> exception=KeyError('capabilities') created at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:318> took 0.363 seconds
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 336, in run_async
    raise completed_tasks_exceptions[0]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 1 more time]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/include_launch_description.py", line 148, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/kairos/ros2WS/install/mycobot_moveit/share/mycobot_moveit/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/kairos/ros2WS/install/moveit_configs_utils/lib/python3.10/site-packages/moveit_configs_utils/launches.py", line 204, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7f45a9738a90>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7f45a9738a90>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7f45a7b1e9b0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7f45a9738a90>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7f45a55314b0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7f45a9738a90>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7f45a97385b0>'

I don't know if it's the right solution, but I solved it by editing the moveit_configs_utils code.

at ~/ros_ws/src/moveit2/moveit_configs_utils/moveit_configs_utils/launches.py line203
스크린샷 2024-04-15 14-28-16

default_value=moveit_config.move_group_capabilities["capabilities"],
-> default_value=moveit_config.move_group_capabilities,

스크린샷 2024-04-15 14-39-02

@Vincenzo-Saffioti
Copy link

Vincenzo-Saffioti commented May 14, 2024

I also have the same problem and could not solve it with the solutions provided so far, any other ideas?

[INFO] [launch]: Default logging verbosity is set to INFO
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'

@yuan0623
Copy link

eit2/moveit_c

Too bad, this does not fix the same issue on my end.

@Schteve-Earl
Copy link

Also getting this issue. Here's my console output, with and without the debug flags:

[INFO] [launch]: Default logging verbosity is set to INFO
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x717c5e501810>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x717c5e501810>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x717c5e8ea2c0>'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[DEBUG] [launch.launch_description_source]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 69, in try_get_launch_description_without_context
    return self._get_launch_description(expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/ros/ros2_ws/install/ur10e_moveit_config/share/ur10e_moveit_config/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/ros/ros2_ws/build/moveit_configs_utils/moveit_configs_utils/launches.py", line 203, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[DEBUG] [launch.launch_description_source]: Failed to load the launch file without a context: 'capabilities'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Executing <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:228> exception=KeyError('capabilities') created at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:318> took 0.615 seconds
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 336, in run_async
    raise completed_tasks_exceptions[0]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 1 more time]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/include_launch_description.py", line 148, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/ros/ros2_ws/install/ur10e_moveit_config/share/ur10e_moveit_config/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/ros/ros2_ws/build/moveit_configs_utils/moveit_configs_utils/launches.py", line 203, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x717c5e12a380>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>' ✓ '

I'm on ros2 humble and using I'm using a ur10e moveit config that I just created, with no additions to the urdf. I did not set virtual joints or an end effector.

@yuan0623
Copy link

Also getting this issue. Here's my console output, with and without the debug flags:

[INFO] [launch]: Default logging verbosity is set to INFO
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x717c5e501810>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x717c5e501810>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x717c5e8ea2c0>'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[DEBUG] [launch.launch_description_source]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 69, in try_get_launch_description_without_context
    return self._get_launch_description(expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/ros/ros2_ws/install/ur10e_moveit_config/share/ur10e_moveit_config/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/ros/ros2_ws/build/moveit_configs_utils/moveit_configs_utils/launches.py", line 203, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[DEBUG] [launch.launch_description_source]: Failed to load the launch file without a context: 'capabilities'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Executing <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:228> exception=KeyError('capabilities') created at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:318> took 0.615 seconds
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 336, in run_async
    raise completed_tasks_exceptions[0]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 1 more time]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/include_launch_description.py", line 148, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/ros/ros2_ws/install/ur10e_moveit_config/share/ur10e_moveit_config/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/ros/ros2_ws/build/moveit_configs_utils/moveit_configs_utils/launches.py", line 203, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x717c5e12a380>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>' ✓ '

I'm on ros2 humble and using I'm using a ur10e moveit config that I just created, with no additions to the urdf. I did not set virtual joints or an end effector.

I have fixed this issue by changing the line 199-206 into ld.add_action(DeclareLaunchArgument("capabilities", default_value="")) in the file ws_moveit/src/moveit2/moveit_configs_utils/moveit_configs_utils/launches.py

@Schteve-Earl
Copy link

Schteve-Earl commented May 30, 2024

Also getting this issue. Here's my console output, with and without the debug flags:

[INFO] [launch]: Default logging verbosity is set to INFO
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x717c5e501810>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x717c5e501810>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x717c5e8ea2c0>'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[DEBUG] [launch.launch_description_source]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 69, in try_get_launch_description_without_context
    return self._get_launch_description(expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/ros/ros2_ws/install/ur10e_moveit_config/share/ur10e_moveit_config/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/ros/ros2_ws/build/moveit_configs_utils/moveit_configs_utils/launches.py", line 203, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[DEBUG] [launch.launch_description_source]: Failed to load the launch file without a context: 'capabilities'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Executing <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:228> exception=KeyError('capabilities') created at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:318> took 0.615 seconds
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 336, in run_async
    raise completed_tasks_exceptions[0]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 1 more time]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/include_launch_description.py", line 148, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/ros/ros2_ws/install/ur10e_moveit_config/share/ur10e_moveit_config/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/ros/ros2_ws/build/moveit_configs_utils/moveit_configs_utils/launches.py", line 203, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x717c5e12a380>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>' ✓ '

I'm on ros2 humble and using I'm using a ur10e moveit config that I just created, with no additions to the urdf. I did not set virtual joints or an end effector.

I have fixed this issue by changing the line 199-206 into ld.add_action(DeclareLaunchArgument("capabilities", default_value="")) in the file ws_moveit/src/moveit2/moveit_configs_utils/moveit_configs_utils/launches.py

Same here.

def generate_move_group_launch(moveit_config):
    ld = LaunchDescription()

    ld.add_action(DeclareBooleanLaunchArg("debug", default_value=False))
    ld.add_action(
        DeclareBooleanLaunchArg("allow_trajectory_execution", default_value=True)
    )
    ld.add_action(
        DeclareBooleanLaunchArg("publish_monitored_planning_scene", default_value=True)
    )
    # load non-default MoveGroup capabilities (space separated)
    # commented here
    # ld.add_action(
    #     DeclareLaunchArgument(
    #         "capabilities",
    #         default_value=moveit_config.move_group_capabilities["capabilities"],
    #     )
    # )
    # inhibit these default MoveGroup capabilities (space separated)
    ld.add_action(DeclareLaunchArgument("disable_capabilities", default_value=""))

    # do not copy dynamics information from /joint_states to internal robot monitoring
    # default to false, because almost nothing in move_group relies on this information
    ld.add_action(DeclareBooleanLaunchArg("monitor_dynamics", default_value=False))

    should_publish = LaunchConfiguration("publish_monitored_planning_scene")

    move_group_configuration = {
        "publish_robot_description_semantic": True,
        "allow_trajectory_execution": LaunchConfiguration("allow_trajectory_execution"),
        # Note: Wrapping the following values is necessary so that the parameter value can be the empty string
        # Commented here
        # "capabilities": ParameterValue(
        #     LaunchConfiguration("capabilities"), value_type=str
        # ),
        "disable_capabilities": ParameterValue(
            LaunchConfiguration("disable_capabilities"), value_type=str
        ),
        # Publish the planning scene of the physical robot so that rviz plugin can know actual robot
        "publish_planning_scene": should_publish,
        "publish_geometry_updates": should_publish,
        "publish_state_updates": should_publish,
        "publish_transforms_updates": should_publish,
        "monitor_dynamics": False,
    }

    move_group_params = [
        moveit_config.to_dict(),
        move_group_configuration,
    ]

    add_debuggable_node(
        ld,
        package="moveit_ros_move_group",
        executable="move_group",
        commands_file=str(moveit_config.package_path / "launch" / "gdb_settings.gdb"),
        output="screen",
        parameters=move_group_params,
        extra_debug_args=["--debug"],
        # Set the display variable, in case OpenGL code is used internally
        additional_env={"DISPLAY": os.environ["DISPLAY"]},
    )
    return ld

I removed the launch argument as well as the capabilities parameter, and it works fine now. Do you know what the parameter is supposed to control?

@yuan0623
Copy link

Also getting this issue. Here's my console output, with and without the debug flags:

[INFO] [launch]: Default logging verbosity is set to INFO
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x717c5e501810>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x717c5e501810>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x717c5e8ea2c0>'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[DEBUG] [launch.launch_description_source]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 69, in try_get_launch_description_without_context
    return self._get_launch_description(expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/ros/ros2_ws/install/ur10e_moveit_config/share/ur10e_moveit_config/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/ros/ros2_ws/build/moveit_configs_utils/moveit_configs_utils/launches.py", line 203, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[DEBUG] [launch.launch_description_source]: Failed to load the launch file without a context: 'capabilities'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Executing <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:228> exception=KeyError('capabilities') created at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:318> took 0.615 seconds
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 336, in run_async
    raise completed_tasks_exceptions[0]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 1 more time]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/include_launch_description.py", line 148, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/ros/ros2_ws/install/ur10e_moveit_config/share/ur10e_moveit_config/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/ros/ros2_ws/build/moveit_configs_utils/moveit_configs_utils/launches.py", line 203, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x717c5e12a380>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x717c5e500820>' ✓ '

I'm on ros2 humble and using I'm using a ur10e moveit config that I just created, with no additions to the urdf. I did not set virtual joints or an end effector.

I have fixed this issue by changing the line 199-206 into ld.add_action(DeclareLaunchArgument("capabilities", default_value="")) in the file ws_moveit/src/moveit2/moveit_configs_utils/moveit_configs_utils/launches.py

Same here.

def generate_move_group_launch(moveit_config):
    ld = LaunchDescription()

    ld.add_action(DeclareBooleanLaunchArg("debug", default_value=False))
    ld.add_action(
        DeclareBooleanLaunchArg("allow_trajectory_execution", default_value=True)
    )
    ld.add_action(
        DeclareBooleanLaunchArg("publish_monitored_planning_scene", default_value=True)
    )
    # load non-default MoveGroup capabilities (space separated)
    # commented here
    # ld.add_action(
    #     DeclareLaunchArgument(
    #         "capabilities",
    #         default_value=moveit_config.move_group_capabilities["capabilities"],
    #     )
    # )
    # inhibit these default MoveGroup capabilities (space separated)
    ld.add_action(DeclareLaunchArgument("disable_capabilities", default_value=""))

    # do not copy dynamics information from /joint_states to internal robot monitoring
    # default to false, because almost nothing in move_group relies on this information
    ld.add_action(DeclareBooleanLaunchArg("monitor_dynamics", default_value=False))

    should_publish = LaunchConfiguration("publish_monitored_planning_scene")

    move_group_configuration = {
        "publish_robot_description_semantic": True,
        "allow_trajectory_execution": LaunchConfiguration("allow_trajectory_execution"),
        # Note: Wrapping the following values is necessary so that the parameter value can be the empty string
        # Commented here
        # "capabilities": ParameterValue(
        #     LaunchConfiguration("capabilities"), value_type=str
        # ),
        "disable_capabilities": ParameterValue(
            LaunchConfiguration("disable_capabilities"), value_type=str
        ),
        # Publish the planning scene of the physical robot so that rviz plugin can know actual robot
        "publish_planning_scene": should_publish,
        "publish_geometry_updates": should_publish,
        "publish_state_updates": should_publish,
        "publish_transforms_updates": should_publish,
        "monitor_dynamics": False,
    }

    move_group_params = [
        moveit_config.to_dict(),
        move_group_configuration,
    ]

    add_debuggable_node(
        ld,
        package="moveit_ros_move_group",
        executable="move_group",
        commands_file=str(moveit_config.package_path / "launch" / "gdb_settings.gdb"),
        output="screen",
        parameters=move_group_params,
        extra_debug_args=["--debug"],
        # Set the display variable, in case OpenGL code is used internally
        additional_env={"DISPLAY": os.environ["DISPLAY"]},
    )
    return ld

I removed the launch argument as well as the capabilities parameter, and it works fine now. Do you know what the parameter is supposed to control?

no idea.... sorry. :)

Copy link

This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.

@github-actions github-actions bot added the stale Inactive issues and PRs are marked as stale and may be closed automatically. label Jul 15, 2024
@ukicomputers
Copy link

+1 same issue here, just on Docker Rolling tutorial source image.

@github-actions github-actions bot removed the stale Inactive issues and PRs are marked as stale and may be closed automatically. label Jul 26, 2024
@WilliamAStreamline
Copy link

Same issue and the above changes to launches.py only seem to add more issues. Using Ubuntu 24.04 and Jazzy

@b-adkins
Copy link

b-adkins commented Aug 8, 2024

I made a PR to revert the change: #2912

In the meantime, 7ce2fa9 is the last working commit on the Humble branch.

@claralunasa
Copy link

I have the exact same issues and the changes to the launch file haven't solved it for me

@OneOneLiu
Copy link

I also had a similar problem


~$ ros2 launch mycobot_moveit demo.launch.py --debug
[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription'
[INFO] [launch]: All log files can be found below /home/kairos/.ros/log/2024-04-15-14-29-22-598832-kairos-ubuntu22-109096
[INFO] [launch]: Default logging verbosity is set to DEBUG
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7f45a82b0400>'
[DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7f45a82b0400>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x7f45a973af80>'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
[DEBUG] [launch.launch_description_source]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 69, in try_get_launch_description_without_context
    return self._get_launch_description(expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/kairos/ros2WS/install/mycobot_moveit/share/mycobot_moveit/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/kairos/ros2WS/install/moveit_configs_utils/lib/python3.10/site-packages/moveit_configs_utils/launches.py", line 204, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[DEBUG] [launch.launch_description_source]: Failed to load the launch file without a context: 'capabilities'
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Using load_yaml() directly is deprecated. Use xacro.load_yaml() instead.
Executing <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:228> exception=KeyError('capabilities') created at /opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py:318> took 0.363 seconds
[DEBUG] [launch]: An exception was raised in an async action/event
[DEBUG] [launch]: Traceback (most recent call last):
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 336, in run_async
    raise completed_tasks_exceptions[0]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 230, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_service.py", line 250, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 45, in visit_all_entities_and_collect_futures
    futures_to_return += visit_all_entities_and_collect_futures(sub_entity, context)
  [Previous line repeated 1 more time]
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/include_launch_description.py", line 148, in execute
    launch_description = self.__launch_description_source.get_launch_description(context)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_source.py", line 84, in get_launch_description
    self._get_launch_description(self.__expanded_location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_description_source.py", line 51, in _get_launch_description
    return get_launch_description_from_python_launch_file(location)
  File "/opt/ros/humble/lib/python3.10/site-packages/launch/launch_description_sources/python_launch_file_utilities.py", line 68, in get_launch_description_from_python_launch_file
    return getattr(launch_file_module, 'generate_launch_description')()
  File "/home/kairos/ros2WS/install/mycobot_moveit/share/mycobot_moveit/launch/move_group.launch.py", line 7, in generate_launch_description
    return generate_move_group_launch(moveit_config)
  File "/home/kairos/ros2WS/install/moveit_configs_utils/lib/python3.10/site-packages/moveit_configs_utils/launches.py", line 204, in generate_move_group_launch
    default_value=moveit_config.move_group_capabilities["capabilities"],
KeyError: 'capabilities'

[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'
[DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7f45a9738a90>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7f45a9738a90>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7f45a7b1e9b0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7f45a9738a90>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7f45a55314b0>'
[DEBUG] [launch]: processing event: '<launch.events.shutdown.Shutdown object at 0x7f45a9738a90>' ✓ '<launch.event_handlers.on_shutdown.OnShutdown object at 0x7f45a97385b0>'

I don't know if it's the right solution, but I solved it by editing the moveit_configs_utils code.

at ~/ros_ws/src/moveit2/moveit_configs_utils/moveit_configs_utils/launches.py line203 스크린샷 2024-04-15 14-28-16

default_value=moveit_config.move_group_capabilities["capabilities"], -> default_value=moveit_config.move_group_capabilities,

스크린샷 2024-04-15 14-39-02

Thanks, this solution works for me.

To provide more context, I am working on Ubuntu 22.04, ROS humble in a docker container. I installed moveit2 from binary and used setup assistant to create config files for a customized robot arm and gripper, the ros2 launch my_robot_moveit_config demo.launch worked well, but when I built moveit2 from source (to use Python binding), the same launch file produced the error

[ERROR] [launch]: Caught exception in launch (see debug for traceback): 'capabilities'

mikeferguson added a commit to mikeferguson/moveit2 that referenced this issue Oct 2, 2024
* this fixes an issue seen when no capabilities are defined (moveit#2734)
* also adds ability to specify disabled capabilities
mikeferguson added a commit to mikeferguson/moveit2 that referenced this issue Oct 2, 2024
* this fixes an issue seen when no capabilities are defined (moveit#2734)
* also adds ability to specify disabled capabilities
@mikeferguson
Copy link
Contributor

I've opened #3018 to fix this - looks like we need to backport to both humble and iron as well

@mikeferguson
Copy link
Contributor

Fix is merged into 'humble' (which this referenced) and 'main' branch. Still working on the 'iron' branch fix

@github-project-automation github-project-automation bot moved this to ✅ Done in MoveIt Oct 16, 2024
@ktgilliam
Copy link

Same issue and the above changes to launches.py only seem to add more issues. Using Ubuntu 24.04 and Jazzy

+1 same setup, same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests