Obtain frame time from the start to the end of my simulation in Isaac Sim

I’m using some Python code to export the USD of a specific object on the stage, but I don’t know how to export a sequential USD, because I cannot get the frame time using python code after I click the button to start physical simulation. I tried to use these two AIPs:

start_time = stage.GetStartTimeCode()
end_time = stage.GetEndTimeCode()

but they seem to be wrong.

So I would like to ask about methods or APIs (if there exists) to get the frame time from the start to the end of my simulation. Thanks a lot.

Hi @SitianShen. I think Usd.Stage.GetStartTimeCode() may be appropriate for your start time, but for your end time, you are probably looking for a point in time when your simulation reaches a state of rest. It’ll need to be calculated. The solution will almost certainly involve some Omniverse-specific API so I would recommend asking on the Isaac Sim forum or in the #physics channel on the Omniverse Discord.

In those channels, you’ll find developers that are much more knowledgeable of that area of Omniverse than I am, but to not send you away without some help, one thought that came to mind is perhaps using OmniPVD to record/bake the simulation and then you could potentially find the last timesample or the point in time to end based on the values in the timesample data.

Thanks a lot for your prompt response and guidance! I’ll have a look at the usage of OmniPVD and go to Isaac Sim forum for more detailed information.