Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Timing / Synchronisation between Gazebo and ROS

Hi everyone,

I got a question regarding the timing in Gazebo and ROS.

I have a robot which uses Gazebo plugins and some ROS packages. In my plugins I use ros::Time::now() for everything I send outside of Gazebo (normally ros messages) and the ROS packages also (seem to) use ROS time. Only for Gazebo components, like my pid's, I use gazebo simulation time. ROS packages I use are for example move_base and gmapping.

My experiences with Gazebo are, that I have to restart the environment from time to time, when I delete my running robot and want to respawn it. Otherwise Gazebo would crash and I have to restart it anyways.

Now this is what happens and I am aiming at with my question: Sometimes during the simulation process, normally after restarting Gazebo, one of the ROS nodes won't work anymore because of bad/old messages coming from Gazebo. This I don't fully understand because they should use ROS time instead of Gazebo simulation time and it works fine at the first time I spawn my robot. Using the rqt gui I can see the /clock topic getting information from Gazebo, going to one of the ros nodes. I have to use rosparam to set simtime to false. After that it normally works again.

What are your experiences and advice with timing between Gazebo and ROS and how to handle it?

Can I disable simulation time in Gazebo sdf files?

It would be nice to have an equal timing between all those components. An equal simulation time may be nice to have in further developments.

Thanks in advance

Christoph