GjermundOstensvig / VisualizingRobotConsepts

This repo. was made to visualize robot consepts like Kinomatics and ROS.
MIT License
0 stars 0 forks source link

The default launch arguments does not seem to work properly. #11

Closed GjermundOstensvig closed 10 months ago

GjermundOstensvig commented 10 months ago

When I don't specify argument values while launching, I get a xacro error.

xacro: error: expected exactly one input file as argument

This error must come from the model path not being passed properly. The path to the rviz config does not seem to be passed correctly either as it does not open the config file when I run the launch command.

The full error is:

[ERROR] [launch]: Caught exception in launch (see debug for traceback): executed command failed. Command: xacro /home/jenandg/VisualizingRobotConsepts/ros2_ws/install/robot_consepts_viz_pkg/share/robot_consepts_viz_pkg/<launch.substitutions.path_join_substitution.PathJoinSubstitution object at 0x7fc2e828fa60>
Captured stderr output: Usage: xacro [options] <input>

xacro: error: expected exactly one input file as argument
GjermundOstensvig commented 10 months ago

Plan of action:

  1. pass absolute path directly into LaunchDescription instead goint through PathJoinSubstitution. If this works, then there's something wrong with the way PathJoinSubstitution creates a path.
  2. Try to print the path that is stored in default_model_path and default_rviz_config_path in the urdf_tutorial and robot_consepts_viz_pkg. Does it work in one and not the other?
  3. Compare launch file to this example: https://docs.ros.org/en/iron/Tutorials/Intermediate/URDF/Using-Xacro-to-Clean-Up-a-URDF-File.html#using-xacro
GjermundOstensvig commented 10 months ago

Passing the paths directly workd as expected:

    ld.add_action(IncludeLaunchDescription(
        launch_description_source=PathJoinSubstitution([FindPackageShare('urdf_launch'), 'launch', 'display.launch.py']),
        launch_arguments={
            'urdf_package': 'robot_consepts_viz_pkg',
            'urdf_package_path': r'urdf/h_bot.urdf',
            'rviz_config': r'/home/jenandg/VisualizingRobotConsepts/ros2_ws/install/robot_consepts_viz_pkg/share/robot_consepts_viz_pkg/rviz/my_rviz_config.rviz'
        }.items()
    ))
GjermundOstensvig commented 10 months ago

Removing the string conversion in the launch file seems to have fixed the issue: 85ca4e8ab111330124eb9580e23e5fe91180c1d7