ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

[Errno 2] No such file or directory: 'xacro' [closed]

asked 2022-05-16 23:44:51 -0500

Vmerle gravatar image

Hi everyone, I'm new to ROS and try to do the NAV2 tutorial for a university project. Everything worked until i tried to launch in the "SEtting up the URDF"-part.

I use Ubuntu 20.04 and ROS2 galactic. I also installed the used packages: sudo apt install ros-<ros2-distro>-joint-state-publisher-gui sudo apt install ros-<ros2-distro>-xacro

After building with colcon and calling the setup.bash in my project, I get the following error:

[INFO] [launch]: All log files can be found below /home/valentin/.ros/log/2022-05-17-06-33-09-822486-valentin-7458
[INFO] [launch]: Default logging verbosity is set to INFO
Task exception was never retrieved
future: <Task finished name='Task-2' coro=<LaunchService._process_one_event() done, defined at /home/valentin/ros2_galactic/ros2-linux/lib/python3.8/site-packages/launch/launch_service.py:226> exception=SubstitutionFailure("file not found: [Errno 2] No such file or directory: 'xacro'")>
Traceback (most recent call last):
  File "/home/valentin/ros2_galactic/ros2-linux/lib/python3.8/site-packages/launch/substitutions/command.py", line 108, in perform
    result = subprocess.run(
  File "/usr/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,


File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'xacro'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/valentin/ros2_galactic/ros2-linux/lib/python3.8/site-packages/launch/launch_service.py", line 228, in _process_one_event
    await self.__process_event(next_event)
  File "/home/valentin/ros2_galactic/ros2-linux/lib/python3.8/site-packages/launch/launch_service.py", line 248, in 

__process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/home/valentin/ros2_galactic/ros2-linux/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 "/home/valentin/ros2_galactic/ros2-linux/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 "/home/valentin/ros2_galactic/ros2-linux/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 1 more time]
  File "/home/valentin/ros2_galactic/ros2-linux/lib/python3.8/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 "/home/valentin/ros2_galactic/ros2-linux/lib/python3.8/site-packages/launch/action.py", line 108, in visit
    return self.execute(context)
      File "/home/valentin/ros2_galactic/ros2-linux/lib/python3.8/site-packages/launch_ros/actions/node.py", line 465, in execute
        self._perform_substitutions(context)
      File "/home/valentin/ros2_galactic/ros2-linux/lib/python3.8/site-packages/launch_ros/actions/node.py", line 420, in _perform_substitutions
        evaluated_parameters = evaluate_parameters(context, self.__parameters)
      File "/home/valentin/ros2_galactic/ros2-linux/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py", line 151, in evaluate_parameters
    output_params.append(evaluate_parameter_dict(context, param))
  File "/home/valentin/ros2_galactic/ros2-linux/lib/python3.8/site-packages/launch_ros/utilities/evaluate_parameters.py", line 72, in evaluate_parameter_dict
    evaluated_value = perform_substitutions(context, list(value))
  File "/home/val

entin/ros2_galactic/ros2-linux/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
    return ''.join([context.perform_substitution(sub) for sub in subs ...
(more)
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Vmerle
close date 2022-05-17 08:56:25.375941

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-05-17 08:56:00 -0500

Vmerle gravatar image

ROS2 wasn't initialized correctly. If you have the same Error, check your ros setup and don't forget to source the setup files.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-05-16 23:44:51 -0500

Seen: 408 times

Last updated: May 16