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

What exactly does read_messages for a bag returns?

asked 2021-08-26 00:54:00 -0500

Kansai gravatar image

In the documentation for rosbag it referes to the function bag.read_messages which returns three values:

topic: the topic of the message

msg: the message

t: time of message. The time is represented as a rospy Time object (t.secs, t.nsecs)

I have a rosbag with messages and these messages do have timestamps so these timestamps are inside the msg.header.stamp field.

My question is, what exactly is t here (the "time of message") because I have experimented it and it is definitely not the timestamp of the message.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-08-26 01:56:29 -0500

gvdhoorn gravatar image

updated 2021-08-26 02:02:24 -0500

The time the message was recorded.

The timestamp you're referring to (msg.header.stamp) would be the publication time.

This is also hinted at in the Rewrite bag with header timestamps recipe:

To replace message timestamps in a bag with header timestamps:

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2021-08-26 00:54:00 -0500

Seen: 770 times

Last updated: Aug 26 '21