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

rostopic echo offset command

asked 2018-03-21 18:44:29 -0500

uuik gravatar image

"rostopic echo --offset /topic_name" command displays time in messages as offset from current time (eg to calculate lag/latency). Is the resulting time offset in kernel ticks, or milliseconds, or nanoseconds?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-03-22 02:18:51 -0500

Hi,

Time in ROS have a standard representation : http://wiki.ros.org/roscpp/Overview/Time

You can test is with some simple command :

roscore&
rostopic pub /topic_name geometry_msgs/PoseStamped "header: auto
pose:
  position:
    x: 0.0
    y: 0.0
    z: 0.0
  orientation:
    x: 0.0
    y: 0.0
    z: 0.0
    w: 0.0"  -r 1 &
rostopic echo --offset /topic_name/header

The result of those commands will be :

seq: 6
stamp:
  secs: -71
  nsecs: 997840166
frame_id: ''
---
seq: 7
stamp:
  secs: -72
  nsecs: 998944997
frame_id: ''
---
seq: 8
stamp:
  secs: -73
  nsecs: 998456955
frame_id: ''
---

There is indeed 1 second of offset between messages (1 second because of the -r 1 in rostopic pub), displayed as a negative value because the message stamp is behind the current timestamp. If you fill the stamp with 'now' value every 1 second, the duration will be -1 secs everytime.

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2018-03-21 18:44:29 -0500

Seen: 833 times

Last updated: Mar 22 '18