Caltech-AMBER / obelisk

A stable generic robot control interface.
https://caltech-amber.github.io/obelisk/
MIT License
5 stars 0 forks source link

Mujoco simulation timing #116

Open Zolkin1 opened 3 weeks ago

Zolkin1 commented 3 weeks ago

Previously, the Mujoco C++ simulation loop was simulating until a render is required, then rendering, then sleeping to match real time. In practice this causes issues where the simulation would happen much quicker than reality and therefore no data from intermediate simulation steps would be captured by sensors. Now, the simulation busy waits for the time step duration after each simulation so the sensor timer callbacks can activate and grab the correct data.

Now The rendering is also placed in its own thread to keep the simulation time as close to wall time as possible.

This needs to be updated on the Python side now too.