A simple ROS node for publishing the Gazebo Real Time Factor (RTF) to a ROS topic.
gz_rtf_publisher is a simple ROS node that subscribes to the /stats
Gazebo (Ignition) topic and publishes the Real Time Factor (RTF) to a user-specified ROS topic.
Note that using this package is required only when using modern Gazebo (Ignition). In Gazebo Classic, the Real Time Factor is available inside the /gazebo/performance_metrics
ROS topic.
Making this data available outside the Gazebo GUI makes using the headless mode more effective. Instead of keeping the GUI open just to keep track of the RTF, exposing it using a topic enables the developer to monitor this data using tools such as ros2 topic echo
or the Foxglove Table panel
This repo is a standard ROS2 package (ament_cmake).
-
A ROS2 workspace (colcon)
- See this tutorial to learn how to create your own workspace.
-
libgz-transport
-
sudo apt install libgz-transport11-dev
- This version (11) corresponds to the default version of modern Gazebo that ships with ROS2 Iron. Minor adjustments may be required depending on your Gazebo version.
-
As mentioned above, this repo is a standard ROS2 package. Thus, you simply have to clone it inside your workspace's src directory.
cd <path_to_your_ros2_ws>/src
git clone https://github.com/leggedrobotics-usp/gz_rtf_publisher.git
Then, use colcon to build.
cd <path_to_your_ros2_ws>
colcon build --symlink-install
Each instance of gz_rtf_publisher binds to the /stats
Gazebo topic and exposes the Real Time Factor using a Float64 ROS topic. Default topic name is /gazebo/real_time_factor
and user can specify through command-line as follows:
ros2 run gz_rtf_publisher gz_rtf_publisher --ros-args -p topic_name:=<your_topic_name>
After starting the node, it is possible to use ros2 topic list
to view the Real Time Factor.
Want another feature? Open an Enhancement issue describing it.
- Fork the repo
- Check out a new branch based and name it to what you intend to do:
-
git checkout -b BRANCH_NAME
-
- Commit your changes
- Please provide a git message that explains what you've done;
- Commit to the forked repository.
git commit -m "A short and relevant message"
- Push to the branch
-
git push origin BRANCH_NAME
-
- Make a pull request!
Victor T. N. 🤖
Made with ❤️ by @Vtn21