First time here? Check out the FAQ!


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

Use simulated time with some nodes while running other nodes with wall time

asked Jul 13 '16

Hinas gravatar image

updated Jul 14 '16

Hi

I am trying to run some nodes with simulated time while running other nodes with wall time (same rosmaster). I used the following launch configuration.

<launch>
<param name="pi/use_sim_time" value="true" />
<node name="talker" pkg="demo1" type="talker" />
<node name="listerner" pkg="demo1"  type="listener" ns="pi"  /> 
</launch>

My expectation was listerner should use simulated time and talker should use wall time. But neither of them do so. It seems all ros nodes are using the global parameter "use_sim_time" to change the timing mode. Are there any other way to do this?

Edit:

I run master node in my computer and various other nodes in different raspberry Pis and other computers. I need to synchronize the time of all nodes to my computers time to measure the processing and transmission delays of nodes. NTP is not a good option here.

  1. My Pis does not have access to Internet or any other common network.
  2. I think it is really expensive to setup and maintain my own NTP server in my computer
  3. I do not like to touch the system time of other computers.
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
3

answered Jul 13 '16

ahendrix gravatar image

updated Jul 14 '16

Many ROS nodes use the clock (simulated or wall time) to timestamp messages, synchronize different data streams, and coordinate actions. Therefore, having nodes that use simulated time talk to nodes using the wall clock is not a good idea and therefore it is not supported.

If you explain why you want to do this, perhaps the community can suggest a better solution to your actual problem (see: http://xyproblem.info/ )

EDIT

Setting up an NTP server is not hard and it does not require any additional hardware. The ROS NetworkSetup recommends using Chrony as the NTP server and client software.

I strongly recommend that you run the NTP server on the same machine as your ROS master, since it will be reachable from all of the other computers.

Preview: (hide)

Question Tools

Stats

Asked: Jul 13 '16

Seen: 301 times

Last updated: Jul 14 '16