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

Revision history [back]

One solution would by to wrap this call into a python node for instance system.exec and the subprocess module (on python.org). This node can then be started by a roslaunch file.

However, I would highly recommend that you use rosbag instead, this is a much more reliable tool that rostopic. For instance you can do:

<launch>
  <node pkg="rosbag" type="rosbag" name="rosbag_record"
    args="record -o /tmp/slam-map /wide/left/image_raw /wide/left/camera_info /wide/right/image_raw /wide/right/camera_info /rosout"/>
</launch>

Here you will have in /tmp a rosbag file beginning with slam-map followed by the current date and time.

It is then quite straightforward to convert a file to a csv file which can then be read by matlab or whatever 3rd party tool you use. See the rosbag API to know how to do so. I also have written a converter rosbag to csv, it is not in a public repository but if you are interested I can post it here.

One solution would by be to wrap this call into a python node for instance system.exec and the subprocess module (on python.org). This node can then be started by a roslaunch file.

However, I would highly recommend that you use rosbag instead, this is a much more reliable tool that rostopic. For instance you can do:

<launch>
  <node pkg="rosbag" type="rosbag" name="rosbag_record"
    args="record -o /tmp/slam-map /wide/left/image_raw /wide/left/camera_info /wide/right/image_raw /wide/right/camera_info /rosout"/>
</launch>

Here you will have in /tmp a rosbag file beginning with slam-map followed by the current date and time.

It is then quite straightforward to convert a file to a csv file which can then be read by matlab or whatever 3rd party tool you use. See the rosbag API to know how to do so. I also have written a converter rosbag to csv, it is not in a public repository but if you are interested I can post it here.