Synchronous data collection


I have a setup for grasping task. There is an arm robot with a custom controller. I use “SyntheticDataHelper” to collect RGB and Depth images at each step of the Pick and Place task. The problem is that at those parts of the trajectory that I collect data each step of the controller becomes longer than usual steps:


while I need much smaller steps. Also, when I do not collect data the steps are perfectly fine. So, I guess something is working asynchronously. So, I checked my code but I have not used the async functions anywhere.

Do you have any idea what can lead to this problem and how can I solve it?

Thanks in advance,

Can you provide a snippet on when you are triggering the data collection? Can you add that in your controller loop to get exact control on when the data is gathered?

I tried different approaches to solve this problem. What I found is that based on the amount of calculation that should be performed, substeps in the simulator are performed automatically. By printing:

print("Time step index", my_world.current_time_step_index)

I found that in normal navigation of the controller by each my_world.step(), simulation time step increase by one. But, when I am performing something heavy, each my_world.step(), results in jump of 10 or 11 time steps in the simulation. Thus, 10 substeps of simulation is performing, and this substeps are the main issue for me.

My solution was to play with “physics_dt” and “rendering_dt” in the “set_simulation_dt” function. I found that using extremely small rendering_dt results in very few substeps in the simulation:

my_world.set_simulation_dt(physics_dt=1.0 / 40.0, rendering_dt=1.0 / 10000.0)

With this choice, substeps rarely happens and simulation is performed with small pauses between each step (which is perfectly fine for me). The only problem is that I want to remove all substeps in the simulation and even with this choice of rendering_dt, they still happens sometimes. And the other thing is that this choice of rendering_dt seems a bit weird to me. I wanted to ask if there is a better way to eliminate automatic substeps in the simulation?