Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I believe the simplest and most robust way would be to write a little standalone tool that parses your cvs file, creates appropriate ros message objects, and uses the rosbag API to directly write a bagfile. You can use either C++ or python.

This way you are not dependent on a running ROS core and you don't have to worry about publishing rate, dropped messages etc, while getting the fastest conversion rate possible.

API: http://wiki.ros.org/rosbag/Code%20API

There are some small examples manipulating existing bad files. In your case you have the cvs files as input, and only for output use rosbag: http://wiki.ros.org/rosbag/Cookbook

P.S.: Even if you use the publishing node variant, if you set the header.stamp value properly according to your cvs file, you should end up with correct timestamps in the bag file. Note that while in the bag file the stamp of when each message was recorded is not part of the message itself. If the recorded message has a header, this is in general a different timestamp (namely the one you set when publishing the message). So when you read the message back from the bag file later, you likely want to use the timestamp in the header, not the one of when the message was recorded.