0
$\begingroup$

Rosanswers logo

Hi,

When I usually log kinect and other large data, I use "rosbag::Bag" insted of "rosbag record" command. Because a bag made by "rosbag record" has some timestamp delay and gap. On the other hand, a bag made by "rosbag::Bag" is well-timestamped (even where it log kinect data).

rosbag::Bag bag;
string filename = ros::package::getPath("xxx_bags");
filename.append("/bag/kinect.bag");
bag.open(filename, rosbag::bagmode::Write);
 :
bag.write("/topic",stamp,msg);
 :

However, it's a little pain to write all nodes. Does someone have any other good tips?


Originally posted by Seigo on ROS Answers with karma: 33 on 2012-05-24

Post score: 3

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

rosbag record immediately records the data just as it comes off the network, including the time delay which may have happened. Thus it is the most efficient way to immediately record the data.

To synchronize the bag file later on with the time stamps stored in the messages, you can just post-process it with sync_bagfile.py in the fr_tools package. This makes the tf display from a bagfile in RViz also a bit less jerky.


Originally posted by AHornung with karma: 5904 on 2012-05-24

This answer was ACCEPTED on the original site

Post score: 4


Original comments

Comment by Seigo on 2012-05-24:
Thanks! That's what I am looking for.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.