Gazebo world reset and Duration sleep

asked 2014-11-10 03:43:07 -0500

gecastro gravatar image

Hi All,

I have a gazebo plugin with a ROS thread that has to run at approximately 100Hz of SIMULATION TIME, therefore, in the new thread I'm trying to use Duration.sleep or Rate.sleep with use_sim_time=true

All works without problems until I execute a "world reset" in gazebo, which leaves the thread hanging and it blocks the simulation.

Alternatively, I tried make the thread sleep with a normal c++ sleep(). This alternative works perfectly when I reset the world, but with this option I can do only 100hz at real time and not simulation time. So I guess that ros::Duration and ros::Rate have a problem when the simulation time is reset.

Is there any other alternative to make the thread run at some specific rate of simulation time?

Thanks, Germán

edit retag flag offensive close merge delete