ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Extract time from .bag file

asked 2014-12-22 08:15:32 -0600

erpa gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-12-24 11:09:37 -0600

tfoote gravatar image

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().

edit flag offensive delete link more


Does the time refer to when rosbag received the message?

Murilo F. M. gravatar image Murilo F. M.  ( 2014-12-25 06:31:26 -0600 )edit

Yes that does refer to the receive time.

tfoote gravatar image tfoote  ( 2014-12-26 00:06:46 -0600 )edit

Thanks! I did not know that! I should probably delete my answer as it is inaccurate/misleading.

Murilo F. M. gravatar image Murilo F. M.  ( 2014-12-26 15:42:49 -0600 )edit

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!

erpa gravatar image erpa  ( 2014-12-31 09:42:24 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2014-12-22 08:15:32 -0600

Seen: 3,329 times

Last updated: Dec 24 '14