Robotics StackExchange | Archived questions

What happens with `/clock` topic if you use Multimaster FKIE to connect two Gazebo simulations?

If I understand correctly, if you set use_sim_tim as true, the Gazebo simulation will use the time that is being published onto /clock topic. Now what happens if you are running two simulation and connect them through Multimaster FKIE package. From the documentation I can see that /clock topic in not being ignored. Will both the simulations get messages from both /clock topics? How does it happen that both the simulation seem to run on their own clock anyway?

Asked by kump on 2019-06-04 10:17:42 UTC

Comments

Answers

If I understand correctly, if you set use_sim_tim as true, the Gazebo simulation will use the time that is being published onto /clock topic.

actually, with use_sim_time set to true, Gazebo becomes the publisher of Clock messages (see #q288672, Timing / Synchronisation between Gazebo and ROS and Gazebo Published Parameters). It uses its internal simulation time to set the fields.

In essence, all nodes using ros::Time will now use Gazebo's internal clock as the clock (and this is also why, if you want to make use of this feature, you shouldn't use walltime in ROS nodes).

Now what happens if you are running two simulation and connect them through Multimaster FKIE package. From the documentation I can see that /clock topic in not being ignored. Will both the simulations get messages from both /clock topics? How does it happen that both the simulation seem to run on their own clock anyway?

It will depend on how you set things up exactly, but one variation could be that nodes will receive Clock messages from both Gazebo instances. As they will most likely not be synchronised, the messages will conflict.

I'm not sure what will happen with nodes, but I suspect it won't be what you'd want (nodes jumping backwards and forwards through time fi).

Asked by gvdhoorn on 2019-06-04 11:15:55 UTC

Comments