Ask Your Question
0

rostopic echo offset command

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

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 -0600

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 124 times

Last updated: Mar 22 '18