Get simulation time

Hey all,

I guess this is a dumb question, but how can I get the current simulation time ?

I tried the omni.timeline.ITimeline.get_current_time() it was always returning 0.
I tried the omni.physx.bindings._physx.IPhysxAuthoring.get_elapsed_time, this returned the dt.

I am sure there is something much simpler to get the current time but I could not find it. Anyone knows how ?

Best,

Antoine

1 Like
  • In order for timeline to move forward, play() must be called or pressed in the UI

  • The timeline will by default loop from zero to the end time code set in the layer tab

  • If you want a higher level interface to managing the simulation and time we have a few standalone samples you can run in 2021.2.0 via ./python.sh
    ./python.sh standalone_examples/api/omni.isaac.core/simulation_callbacks.py
    There is a new SimulationContext class that provides more control over rendering/update and physics stepping Simulation Context API

  • There is a second example ./python.sh standalone_examples/api/omni.isaac.core/time_stepping.py that shows the different ways you can step simulation and rendering.

1 Like

Thanks ! I’ll check them out. I had pressed play in the UI, and I was using the python scripting window to try and get the time. Maybe I was missing an extension.

Thanks for letting me know about that class, it looks practical !

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.