I think that you are correct in your assumption.
rosbag also records the time of incoming messages so that it can be played back in proper order. It also has to record the time of incoming messages for message types that do not include the header field.
You have to remember that the msg.header.stamp
field can be populated with whatever you want. In the case of a camera, it may be when the frame is recorded, or in the case of a laser, when the particular scan was recorded.
There may be additional steps (say an image pipeline), between the original time that the camera frame is captured, and when rosbag gets the message to be recorded. In this case, the data in the image represents the physical world at a certain time (msg.header.stamp
), but has been received at a different time (time
).
Originally posted by mjcarroll with karma: 6414 on 2012-03-12
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by Enrique on 2012-03-12:
It sounds coherent, I agree. BTW, I'm trying to detect msg dropping. The seq number is OK (no one missed). But I've detect msgs with delays greater (x4) than the sampling period set. Only a few though. So, header.stamp is the one to check; time is not useful for this, isn't it?
Comment by mjcarroll on 2012-03-12:
I think that in most cases, if the message has a header.stamp field, then that's the one to check. The time field should probably only be used in the case where a message doesn't have that, or diagnosing latency problems.