robot_description: export gazebo paths to package#37
Merged
CotsaftisGarnierMatthieu merged 4 commits intomasterfrom Mar 28, 2025
Merged
Conversation
The ROS workspace setup file does not source the ROS system setup file. This adds the sourcing for the ROS system setup file. Note: This seems to be unnecessary as the environment is the same if sourcing the workspace setup files only, and if sourcing both setup files (i.e. system and workspace). [1]: https://docs.ros.org/en/humble/Tutorials/Beginner-CLI-Tools/Configuring-ROS2-Environment.html#source-the-setup-files
The ROS workspace setup file does not source the ROS Gazebo system setup file. This adds the sourcing for the ROS Gazebo system setup file. It drops the workaround that sets the gazebo-11 system's directory. The sourcing for the ROS Gazebo system setup file was the missing bits. Note: This exports the following additional Gazebo variable to the environment: - GAZEBO_MASTER_URI=http://localhost:11345 - GAZEBO_PLUGIN_PATH=/usr/share/gazebo/../../lib/x86_64-linux-gnu/gazebo-11/plugins: - GAZEBO_MODEL_DATABASE_URI=http://models.gazebosim.org - GAZEBO_RESOURCE_PATH=/usr/share/gazebo/../../share/gazebo-11: - GAZEBO_MODEL_PATH=/usr/share/gazebo/../../share/gazebo-11/models: - OGRE_RESOURCE_PATH=/usr/lib/x86_64-linux-gnu/OGRE-1.9.0 Also, the LD_LIBRARY_PATH lists the extra Gazebo plugin directory /opt/ros/humble/lib:/usr/lib/x86_64-linux-gnu/gazebo-11/plugins: -LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/gazebo-11/plugins:/opt/ros/humble/opt/rviz_ogre_vendor/lib:/opt/ros/humble/lib/x86_64-linux-gnu:/opt/ros/humble/lib +LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/gazebo-11/plugins:/opt/ros/humble/opt/rviz_ogre_vendor/lib:/opt/ros/humble/lib/x86_64-linux-gnu:/opt/ros/humble/lib:/usr/share/gazebo/../../lib/x86_64-linux-gnu/gazebo-11/plugins: [1]: https://classic.gazebosim.org/tutorials?tut=ros2_installing#Introduction
This appends the robot_control's models directory to the environ GAZEBO_MODEL_PATH, using the action AppendEnvironmentVariable. Note: It sets the gazebo-11 system's directories too, to workaround some missing bits. Note: This is unnecessary as the robot_controls's resource directory is appended to the environment GAZEBO_RESOURCE_PATH already. That resource directory contains the models directory and extra resources that are necessary to ROS Gazebo.
This exports the gazebo_model_path and gazebo_media_path (i.e. resource) to automatically make the workspace resources and models to ROS Gazebo. See [1][2][3]. Note: It that removes the needs to manually append these directories via the environment variables GAZEBO_RESOURCE_PATH and GAZEBO_MODEL_PATH. The python module gazebo_ros_paths.py[4] extracts the paths from the list of package.xml; the two python launch scripts gzserver.launch.py and gzclient.launch.py uses that module to concatenate these path to the environment variables[5][6]. The third launch script gazebo.launch.py launches the Gazebo server and client script. [1]: https://docs.ros.org/en/humble/Tutorials/Intermediate/URDF/Using-a-URDF-in-Gazebo.html#side-note-configuring-meshes [2]: https://classic.gazebosim.org/tutorials?tut=ros_roslaunch [3]: https://wiki.ros.org/simulator_gazebo/GazeboConfiguration [4]: https://github.com/ros-simulation/gazebo_ros_pkgs/blob/3.7.0/gazebo_ros/scripts/gazebo_ros_paths.py#L53-L65 [5]: https://github.com/ros-simulation/gazebo_ros_pkgs/blob/3.7.0/gazebo_ros/launch/gzserver.launch.py#L65-L78 [6]: https://github.com/ros-simulation/gazebo_ros_pkgs/blob/3.7.0/gazebo_ros/launch/gzclient.launch.py#L40-L53 [7]: https://github.com/ros-simulation/gazebo_ros_pkgs/blob/3.7.0/gazebo_ros/launch/gazebo.launch.py#L35-L43
cf3ad0c to
b7cba55
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This exports the gazebo_model_path and gazebo_media_path (i.e. resource)
to automatically make the workspace resources and models to ROS Gazebo.
See 13.
Note: It that removes the needs to manually append these directories via
the environment variables GAZEBO_RESOURCE_PATH and GAZEBO_MODEL_PATH.
The python module gazebo_ros_paths.py4 extracts the paths from the
list of package.xml; the two python launch scripts gzserver.launch.py
and gzclient.launch.py uses that module to concatenate these path to the
environment variables5. The third launch script gazebo.launch.py
launches the Gazebo server and client script.