Open osrf-migration opened 8 years ago
Original comment by Peter Mitrano (Bitbucket: peter_mitrano).
Also, this is a "proposal", so feel free to say it's not the correct approach
Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).
Can you point to the code where it's using wall clock time? If you have a world pointer, you can use world->GetSimTime()
to get a common::Time
object.
Original comment by Peter Mitrano (Bitbucket: peter_mitrano).
I believe I was referring to this section of code, which seems to wait 100 ms in clock time for 50 iterations.
Original report (archived issue) by Peter Mitrano (Bitbucket: peter_mitrano).
There's a "feature" in the Model class where it waits 5 seconds for sensors to be initialized, but it's using wall clock time. That means models will inconsistently fail to load if simulation slows down (IE, the same model works on your desktop but fails on your laptop. Vey frustrating!). I propose to use gazebo clock time instead to account for slower simulations, since I believe sensors being initialized is a function of that.
I plan to make the patch for this, but I need someone to point me in the right direction. In this case, how should I access gazebo simulation time within gazebo? Subscribing to time seems like the wrong way. Is there something within gazebo (common::Time?) to do this easily?