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

Revision history [back]

click to hide/show revision 1
initial version

Hi,

You can echo straight into a file using:

rostopic echo /topic > filename.txt

But this isn't ideal as it will be the same format as the echo displays it to the commandline.

A better way is to record topics using rosbag and then you can write the topic data you want straight to a file using:

rostopic echo -b file.bag -p /topic > filename.txt

This has the benefit of formatting the data suitable for a csv file, which you can then manipulate with excel / matlab.