Ask Your Question
1

Data Recording to simple text file

asked 2011-12-28 01:33:55 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

I am a newbie here, just started working on ROS a week ago. Is there any way to record /save some data into a simple text file directly from the server or client? I want to record the request received by the server, alternatively can anybody give example of this implemented by rosbag ? The basic c++ methods of fstream and ofstream do not work in ROS.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2011-12-28 02:09:37 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

1) See this question for how to convert ROS messages to text file from the command line.

2) Here is a good introduction to the rosbag API.

3) fstream and ofstream do work in ROS. All ROS nodes are still C++ executables. I've used fstream and ofstream many times for simple logging in my ROS nodes.

4) ROS also logs all ROS print statements (ROS_INFO) to log files. Mine are located in ~/.ros/log. Files called {node}-{number}-stdout.log contain this information.

edit flag offensive delete link more

Comments

1
Depending on the task at hand, maybe the simplest solution is: rostopic echo /mytopic > textfile
dornhege gravatar imagedornhege ( 2011-12-28 03:03:35 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2011-12-28 01:33:55 -0500

Seen: 5,386 times

Last updated: Dec 28 '11