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

ROSBag C++ API -- reading message Header

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

jrvanwhy gravatar image

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

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 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

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

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

Question Tools

1 follower


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

Seen: 1,078 times

Last updated: Dec 23 '12