-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow running Sensors and Physics update in Lockstep mode #2669
Comments
This should be supported by default in gz-sim (without needing to specify any args on launch). If you set a camera sensor to run at 30 Hz, it should run at the specified rate in sim time. If the camera can not render fast enough, it would block the main / physics thread and hence lowering the sim RTF.
Are you running into issues where you see that physics and sensors are not lockstepping? |
Technically, it is possible for the next physics step to occur before the rendering/sensor system blocks, but this only introduces one extra time step in physics. If this is a concern for you, I'd like to know, but otherwise, as @iche033 said, Sensors and Physics do run in lockstep by default in the new Gazebo. |
Hi @iche033 and @azeey,
We may have observed physics and sensors updating at different time frames. To be more specific on the testing setup, my project partner @Magnusgaertner and I were running a Distrobox of Ubuntu 24.04 with ROS2 Jazzy. When running some of the single-camera examples from this repo, the
Out of curiosity, how is this mechanism for synchronizing and spinning a new physics iteration implemented? Thank you in advance 🙏 |
is the 8 Hz output from |
I wrote a simple python program to verify camera timestamps some time ago, see osrf/mbzirc#147 (comment) in case it helps |
Desired behavior
Classic Gazebo provided a Lockstep mode that synchronized the update of physics and sensors -> https://classic.gazebosim.org/tutorials?tut=lockstep_physics_sensors
This mode allowed the simulation to better resemble a real-system, where sensors are sampled uniformly following a global clock, fitting the same timeline as the physics.
However, this feature does not seem to be present in New/Ignition Gazebo. Could it be implemented? Happy to help if so!
Alternatives considered
Not relying on the Lockstep mode, but this would make our simulation less representative of a real system.
Implementation suggestion
Implementing an equivalent of the Classic Gazebo Lockstep mode.
Additional context
None
The text was updated successfully, but these errors were encountered: