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

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

Comments

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
1

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

Question Tools

1 follower

Stats

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

Seen: 1,104 times

Last updated: Dec 23 '12