moveit2: Launch Error

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'

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 12
  • Comments: 22 (2 by maintainers)

Commits related to this issue

Most upvoted comments

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

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'