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

ROSBag C++ API -- reading message Header

asked 2012-12-23 07:02:24 -0500

jrvanwhy gravatar image

updated 2014-01-28 17:14:39 -0500

ngrennan gravatar image

I am writing a C++ (*) program that reads in a bagfile, and needs to be able to access a message's header timestamp (not the one rosbag records itself), if it has one.

How can I do this using ROSBag's API?

  • I'm rewriting an existing Python script that's really slow.
edit retag flag offensive close merge delete


Thank you, Lorenz -- I was afraid that that was the answer. (I couldn't find the button to comment on an answer, so I'm doing it here).

jrvanwhy gravatar image jrvanwhy  ( 2012-12-24 06:17:38 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2012-12-23 21:43:00 -0500

Lorenz gravatar image

You can do that only if you know the type of the messages at compilation time. In that case, you can use the instantiate method of the class MessageInstance.

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

1 follower


Asked: 2012-12-23 07:02:24 -0500

Seen: 991 times

Last updated: Dec 23 '12