How to set the frequency for "On Playback Tick"

I am using Isaac Sim 2022.2.1 in a headless mode by instantiating SimulationApp in a Python script. My simulation loop looks like this:

simulation_app = SimulationApp(config, experience)
...
simulation_context = SimulationContext(stage_units_in_meters=1.0)
simulation_context.initialize_physics()
rendering_dt = 1.0 / 4.0
simulation_context.set_simulation_dt(
    physics_dt=1.0 / 60.0, rendering_dt=rendering_dt)
simulation_context.stop()
simulation_context.play()
...

# Run for 60 seconds
for i in range(int(60.0 / rendering_dt)):
    logger.info(f"Simulation step {i}")
    ...
    simulation_context.step(render=True)

simulation_context.stop()
simulation_app.close()

Part of the USD stage is an ActionGraph with a “On Playback Tick” node that is attached to a “ROS2 Publish Clock” node. My understanding is that on each simulation_context.step() the “On Playback Tick” node fires. Is this correct?

Looking at the produced ROS messages, it seems the time the “On Playback Tick” node is not in sync with the rendering_dt which is set to 1/4. It looks like “On Playback Tick” time increases in steps of 1/24s.

How can I set the time delta for “On Playback Tick”?

Any suggestions welcome
Bruno

2 Likes