ros / ros_comm

ROS communications-related packages, including core client libraries (roscpp, rospy, roslisp) and graph introspection tools (rostopic, rosnode, rosservice, rosparam).
http://wiki.ros.org/ros_comm
753 stars 911 forks source link

Explanation of rostopic echo topic --offset #2313

Closed Hommus closed 1 year ago

Hommus commented 1 year ago

Can someone explain the results I'm seeing from using the following commands. I assumed there would be an offset of up to 1 second due to the publish rate of 1Hz, but I'm getting a nearly 2 seconds of offset...

roscore # Terminal 1
rostopic pub -s -r 1 /xav_time std_msgs/Time 'now' # Terminal 2
rostopic echo /xav_time --offset # Terminal 3

Results:

  secs: -1
  nsecs: 999031066
---
data: 
  secs: -1
  nsecs: 998975038
---
data: 
  secs: -1
  nsecs: 999228001
---
data: 
  secs: -1
  nsecs: 999282837