ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

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

asked 2019-06-04 10:17:42 -0500

kump gravatar image

updated 2019-06-04 10:19:39 -0500

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-06-04 11:15:55 -0500

gvdhoorn gravatar image

updated 2019-06-04 11:19:08 -0500

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).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-06-04 10:17:42 -0500

Seen: 264 times

Last updated: Jun 04 '19