Skip to content

A simple ROS2 node for publishing the Gazebo Real Time Factor (RTF) to a ROS topic

License

Notifications You must be signed in to change notification settings

leggedrobotics-usp/gz_rtf_publisher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gz_rtf_publisher

GitHub issues GitHub pull requests GitHub forks GitHub stars GitHub license


A simple ROS node for publishing the Gazebo Real Time Factor (RTF) to a ROS topic.

📝 Table of Contents

🧐 About

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

🏁 Getting Started

This repo is a standard ROS2 package (ament_cmake).

🛠 Prerequisites

  • A ROS2 workspace (colcon)

  • 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.

💻 Installing

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

🎈 Usage

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.

🔋 Feature requests

Want another feature? Open an Enhancement issue describing it.

🤝 Contributing

  • 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!

✍️ Author


Victor T. N. 🤖

Made with ❤️ by @Vtn21

About

A simple ROS2 node for publishing the Gazebo Real Time Factor (RTF) to a ROS topic

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published