Skip to content

Dagana config file error #11

@AlessioLovato

Description

@AlessioLovato

By default the dagana is included in the src/modular/config_file.yaml and during startup if the package iit-dagana-ros-pkg has not been built, an error is thrown and the URDF of the robot is not shown.

ERROR LOG:

[ERROR] [launch]: Caught exception in launch (see debug for traceback): executed command failed. Command: python3 /home/user/xbot2_ws/install/share/concert_examples/concert_example.py -o urdf -a gazebo_urdf:=false floating_base:=true realsense:=false velodyne:=false ultrasound:=false imu:=false use_gpu_ray:=false -r modularbot
Captured stderr output: Traceback (most recent call last):
  File "/home/user/xbot2_ws/src/modular/src/modular/utils.py", line 55, in get_expanded_path
    expanded_path = re.sub(r"\$\(([^\)]+)\)", path_substitution, expanded_path)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/re/__init__.py", line 186, in sub
    return _compile(pattern, flags).sub(repl, string, count)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/xbot2_ws/src/modular/src/modular/utils.py", line 51, in path_substitution
    cmd_output = subprocess.check_output(cmd.split(), stderr=subprocess.DEVNULL).decode('utf-8').rstrip()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['ros2', 'pkg', 'prefix', '--share', 'dagana_urdf']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/xbot2_ws/install/share/concert_examples/concert_example.py", line 6, in <module>
    urdf_writer = UrdfWriter(speedup=True, floating_base=True)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/xbot2_ws/src/modular/src/modular/URDF_writer.py", line 1059, in __init__
    self.modular_resources_manager = ModularResourcesManager(self.resource_finder)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/xbot2_ws/src/modular/src/modular/utils.py", line 199, in __init__
    self.init_available_modules()
  File "/home/user/xbot2_ws/src/modular/src/modular/utils.py", line 291, in init_available_modules
    resource_names_list = ['yaml/' + el for el in self.expand_listdir('yaml', res_path)]
                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/xbot2_ws/src/modular/src/modular/utils.py", line 210, in expand_listdir
    listdir = self.resource_finder.get_listdir(starting_path, res_path)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/xbot2_ws/src/modular/src/modular/utils.py", line 135, in get_listdir
    resource_path = self.find_resource_path(resource_name, relative_path)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/xbot2_ws/src/modular/src/modular/utils.py", line 68, in find_resource_path
    resource_path = self.find_external_resource_path(resource_name, relative_path)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/xbot2_ws/src/modular/src/modular/utils.py", line 77, in find_external_resource_path
    resource_path = '/'.join((self.get_expanded_path(relative_path), resource_name))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/xbot2_ws/src/modular/src/modular/utils.py", line 58, in get_expanded_path
    raise RuntimeError(msg)
RuntimeError: Executing $(ros2 pkg prefix --share dagana_urdf) resulted in an error. Path substitution cannot be completed. Are the required environment variables set?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions