Ask Your Question
1

Semantics of `%time` timestamp in `rostopic echo -p` from bagfile?

asked 2019-03-25 05:05:38 -0500

moooeeeep gravatar image

updated 2019-03-25 05:06:15 -0500

When I print the topic data using rostopic echo -p -b filename.bag /topic_name, there are two timestamps in the output. One comes from the header of the message (third column: field.header.stamp), one comes from somewhere else (first column: %time). Both have slightly different values, e.g.

  • %time: 1552649896239792539 (2019-03-15 11:38:16.239793),
  • field.header.stamp: 1552649894321638000 (2019-03-15 11:38:14.321638)

I didn't find documentation about the first timestamp %time. Is it assigned by rosbag to reflect the time of recording?

In this case, this would indicate that the message was recorded almost two seconds after the timestamp in the header indicates. Would it be reasonable to make inferences about the latency on the topic like this?

edit retag flag offensive close merge delete

Comments

You have mostly answered the question already. The first time value is when rosbag received the message. About making inferences about latency based on the time differences. There are other factors you need to account for. For example if you are using more than one computer and are not synchronizing the clocks then you can get quite a big time difference from that. So I would say if you want to profile latency, then do that with tools designed to do that and once you know what the values are with the other factors taken into account you could make some assumptions based on the difference in the timestamps. If I would see a time difference of 2 seconds my first assumption would be that the clock on the publishing computer is 2s behind the recording computer, not that latency is 2s.

Reamees gravatar image Reamees  ( 2019-03-25 07:14:06 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-03-25 05:35:43 -0500

moooeeeep gravatar image

Is it assigned by rosbag to reflect the time of recording?

Comments given here and here indicate that this is indeed the case.

Would it be reasonable to make inferences about the latency on the topic like this?

This seems reasonable, at least from the point of view of the rosbag instance that has recorded the messages.

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: 2019-03-25 05:05:38 -0500

Seen: 1,286 times

Last updated: Mar 25 '19