I can get all the messages in my `rosbag` file through this loop:
BOOST_FOREACH(rosbag::MessageInstance const m, view) {
//...
}
My `rosbag` file is a record of images from the Kinect. And I'm trying to get the images from it.
Knowing the size of rosbag, how could I use `rosbag::MessageInstance` and `view` to get a specific message (or image) without going through all the messages.
EDIT:
I did a "mecanical" solution but I don't really like it:
I ask the user to choose a number which will correspond to his message (image) knowing the size of the rosbag file.
then I run `BOOST_FOREACH` loop till I get to the message and extract it.
↧