Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ros2] gazebo_ros_path plugin paths are annoying #1500

Open
DLu opened this issue Aug 8, 2023 · 0 comments
Open

[ros2] gazebo_ros_path plugin paths are annoying #1500

DLu opened this issue Aug 8, 2023 · 0 comments

Comments

@DLu
Copy link
Contributor

DLu commented Aug 8, 2023

Rant

In order to get meshes from URDF, the URDF package must export a very specific value.

    <gazebo_ros gazebo_model_path="${prefix}/.."/>

What the export does is specify a proper value of the GAZEBO_MODEL_PATH environment variable. If you say that your model path includes /home/user/models and you try to load an SDF (or other resource) with the syntax model://robot_name/file.ext, then it will enable you to load a file with the path /home/user/models/robot_name/file.ext. Logical so far...

The value of ${prefix} in your package.xml is the path to the ROS package's share folder. For instance, if you're compiling from source, that might be

/home/user/ros2_ws/install/package_name/share/package_name/

So if you specify the mesh with the syntax package://package_name/meshes/file.ext it will presumably be installed at

${prefix}/meshes/file.ext

or

/home/user/ros2_ws/install/package_name/share/package_name/meshes/file.ext

However, if we say that the Gazebo model path is ${prefix} it will attempt to load package://package_name/meshes/file.ext as

${prefix}/package_name/meshes/file.ext

or

/home/user/ros2_ws/install/package_name/share/package_name/package_name/meshes/file.ext

Note that package_name appears in there THREE times as opposed to the usual two.

Hence, we need to set the Gazebo model path to ${prefix}/.. which is surprisingly valid syntax and results in file being loaded as

${prefix}/../package_name/meshes/file.ext

or

/home/user/ros2_ws/install/package_name/share/package_name/meshes/file.ext
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant