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

Can I get data from ros to a file?

asked 2014-08-15 11:42:03 -0500

dshimano gravatar image

updated 2014-08-15 11:42:30 -0500

Hi I'm running Ubuntu 12.04 and ros hydro,

I'm curently playing around with an ar drone with the tum_ardrone package. I wanted to know if theres a way to output data to a text file? I know I can use rostopic echo to get the data published to a terminal, but is there a way to get it somewere else?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-08-15 13:15:05 -0500

jc2016 gravatar image

I dont want to steal @bvbdort thunder, but I think you should probably save to a .bag file first and then change to a .txt or .csv file. Going directly to a text file, particularly if you are working with any imaging output from the bot can get weird quickly.

I believe the "ROS" way to do this would be to run a command like

    $rosbag record <topic>

And then move it over to a .txt/.csv file. A useful script to do this can be found here: ( http://answers.ros.org/question/9102/... ) which converts to a .csv. This will save the data long-term and allow a cleaner transition in the short term.

edit flag offensive delete link more
3

answered 2014-08-15 12:03:59 -0500

bvbdort gravatar image

updated 2014-08-15 12:07:26 -0500

To save data from ros topic to text file. It saves a .txt file in current directory,

rostopic echo /scan >>mydata.txt

Have looking into rosbag to save data and play it later.

edit flag offensive delete link more

Comments

That's nice! I never thought about this idea!

emacsd gravatar image emacsd  ( 2014-08-18 19:44:24 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-08-15 11:42:03 -0500

Seen: 6,313 times

Last updated: Aug 15 '14