Getting the frame number without writing custom camera pose function

I can see that in rep.trigger.on_frame, num_frames is passed so it is aware of current frame number but I cannot find any documentation that shows how to access the current frame number say inside the with ep.trigger.on_frame clause.

I saw this answer where your dev team has provided a utility for creating your custom camera pose method so that you can capture your frame numbers. However, I want to learn how to access it if I am using the functionality given by omniverse Replicator/Isaac APIs rather than my own custom functions?

The with rep.trigger.on_frame function is only called once when generating the graph, afterwards the graph is being executed.

The graph execution is triggered either one by one with the rep.orchestrator.step() function (this way you can manually count the frame numbers). Or through rep.orchestrator.run() where you could count the frames using a custom writer and incrementing the frame number in the write() function. Here is a short example snippet using the step function and a custom writer.

As mentioned in your questions, one can also change the OG graph to do this internally in the graph execution.

1 Like

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