Rosanswers logo

Hi, I am trying to process some bag files and, while I am able to get the timestamp for each message, I am not able to get the actual time the message was received. Is it possible to get it? I am using the python api and I could not find any documentations, any help is really appreciated! Thanks for your help!

Originally posted by erpa on ROS Answers with karma: 111 on 2014-12-22

Post score: 0


1 Answer 1


Rosanswers logo

You can get that information using the rosbag API. Take a look at the rosbag Cookbook wiki page. The time is in the tuple returned from read_messages().

Originally posted by tfoote with karma: 58457 on 2014-12-24

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by Murilo F. M. on 2014-12-25:
Does the time refer to when rosbag received the message?

Comment by tfoote on 2014-12-26:
Yes that does refer to the receive time.

Comment by Murilo F. M. on 2014-12-26:
Thanks! I did not know that! I should probably delete my answer as it is inaccurate/misleading.

Comment by erpa on 2014-12-31:
For some reason I was confused but yes the time is the third item in the tuple returned by read_messages(). Thanks for the help!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.