ROS 2 Publish Real Time Factor (RTF)

Learning Objectives

This tutorial will demonstrate publishing the Real Time Factor (RTF) of Isaac Sim as a ROS2 Float 32 message.

Getting Started

Important

Make sure to source your ROS 2 installation from the terminal before running Isaac Sim. If sourcing ROS 2 is a part of your bashrc then Isaac Sim can be run directly.

  • Enable the omni.isaac.ros2_bridge Extension in the Extension Manager window by navigating to Window > Extensions.

Publish RTF

The RTF indicates how fast or slow simulation is running with respect to the real-time. It is calculated per frame as RTF = simulated_elapsed_time / real_elapsed_time. If RTF > 1, simulation time is running faster than wall clock time. If RTF < 1, the simulation is running slower than real-time.

  1. Go to Isaac Utils > Common Omnigraphs > ROS2 Generic Publisher. The parameter pop-up window will appear.

  2. Select Publish RTF as Float32 and click OK.

    ROS2 RTF Parameter
  3. A new Action Graph will be created with the Isaac Real Time Factor node connected to a generic ROS2 Publisher node which is setup to publish std_msgs/msg/Float32 ROS messages.

  4. Select the Action Graph prim found at /Graph/ROS_GenericPub. Right click on it and choose Open Graph. The autogenerated graph should be match the following:

    ROS2 RTF Graph
  5. Click Play to start simulation.

  6. In a ROS2-sourced terminal run the following command to view the RTF value published from Isaac Sim.

    ros2 topic echo /topic
    

    For an unloaded system, RTF should be close to 1.0.

Summary

This tutorial covered using an OmniGraph shortcut to automatically generate a ROS2 RTF publisher graph.