ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Error: launch.substitutions.substitution_failure.SubstitutionFailure: executed command failed. Command: xacro /path_to_robot_description/robot.urdf.xacro use_ros2_control:=true sim_mode:=false

asked 2023-04-18 12:57:36 -0500

Terence_IRUMVA gravatar image

updated 2023-06-08 15:39:56 -0500

jayess gravatar image

Hello! I am using ROS2 foxy with ubuntu 20.04, and I am getting this error when I try to launch a .launch.py launch file. The launch file includes launching gazebo and spawning the mobile robot described in the robot.urdf.xacro file in the launched gazebo world (let me if you need the launch file code). Below is the full terminal output of the error:

[DEBUG] [launch.launch_context]: emitting event synchronously: 'launch.events.IncludeLaunchDescription' [INFO] [launch]: All log files can be found below /home/user/.ros/log/2023-04-18-12-48-42-463391-user-Alienware-m15-R4-33093 [INFO] [launch]: Default logging verbosity is set to DEBUG [DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7fe154c754f0>' [DEBUG] [launch]: processing event: '<launch.events.include_launch_description.IncludeLaunchDescription object at 0x7fe154c754f0>' ✓ '<launch.event_handlers.on_include_launch_description.OnIncludeLaunchDescription object at 0x7fe154c75130>' [DEBUG] [launch.launch_context]: emitting event: 'launch.events.Shutdown' Task exception was never retrieved future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:226> exception=SubstitutionFailure('executed command failed. Command: xacro /home/user/ugv_ws/install/articubot_one/share/articubot_one/description/robot.urdf.xacro use_ros2_control:=true sim_mode:=true') created at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:314> source_traceback: Object created at (most recent call last):   File "/opt/ros/foxy/bin/ros2", line 11, in <module>
    load_entry_point('ros2cli==0.9.13', 'console_scripts', 'ros2')()   File "/opt/ros/foxy/lib/python3.8/site-packages/ros2cli/cli.py", line 67, in main
    rc = extension.main(parser=parser, args=args)   File "/opt/ros/foxy/lib/python3.8/site-packages/ros2launch/command/launch.py", line 151, in main
    return launch_a_launch_file(   File "/opt/ros/foxy/lib/python3.8/site-packages/ros2launch/api/api.py", line 167, in launch_a_launch_file
    ret = launch_service.run()   File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 360, in run
    return loop.run_until_complete(run_async_task) File "/usr/lib/python3.8/asyncio/base_events.py", line 603, in run_until_complete
    self.run_forever()   File "/usr/lib/python3.8/asyncio/base_events.py", line 570, in run_forever
    self._run_once()   File "/usr/lib/python3.8/asyncio/base_events.py", line 1859, in _run_once
    handle._run()   File "/usr/lib/python3.8/asyncio/events.py", line 81, in _run
    self._context.run(self._callback, *self._args)   File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 314, in run_async
    process_one_event_task = this_loop.create_task(self._process_one_event()) Traceback (most recent call last):   File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)   File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 248, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))   File "/opt/ros/foxy/lib/python3.8/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/foxy/lib/python3.8/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/foxy/lib/python3.8/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 3 more times]   File "/opt/ros/foxy/lib/python3.8/site-packages/launch ...
(more)
edit retag flag offensive close merge delete

Comments

I am also facing same issue. I tried restarting the system and rebuilding the package that contains the launch file, but both these didn't work for me. please let me know if anyone came across any solution.

Hri gravatar image Hri  ( 2023-06-05 07:11:07 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2023-06-09 02:04:42 -0500

My guess is that /path_to_robot_description/robot.urdf.xacro is probably not the path to the robot model.

This file (robot.urdf.xacro) should lie in some package and you can retrieve it using get_package_share_directory:

from ament_index_python.packages import get_package_share_directory
import os

// a bit later
model = os.path.join(get_package_share_directory('my_pkg'), 'sub_folder', 'robot.urdf.xacro')

Again, 'my_pkg' and 'sub_folder' should be replaced with your package and folder where the model is.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-04-18 12:56:50 -0500

Seen: 1,177 times

Last updated: Jun 09 '23