ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Store ROS messages in file ?

asked 2016-10-26 01:19:21 -0600

Aasiya Shaikh gravatar image

updated 2017-02-07 01:39:36 -0600


I am working on Some project, I have to store ROS messages in some File using C++ API's. I knew ROS BAG files which is excellent for storing ROS messages But i want to knew Is their any other supported files in ROS to store ROS message using C++ API's. If yes then which one is it ? Can anyone Suggest.

Can I read ROS .bag file in Reverse order ? If yes then how it can be done. Please can anyone tell me.

image:IMAGE !

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-10-26 17:07:00 -0600

tfoote gravatar image

You can use the rosbag C++ api to work with data stored in bag files. Including reverse iterating etch. There's API docs here

edit flag offensive delete link more


Thanks a lots

Aasiya Shaikh gravatar image Aasiya Shaikh  ( 2016-10-27 05:41:20 -0600 )edit

answered 2016-10-26 02:30:45 -0600

Yang gravatar image

Hi,you can store topic messages in files through rostopic echo /topic >>file.txt

edit flag offensive delete link more


Okay Thanks. Then please can to tell me how I can read these topic messages through API's as I have to reused this messages , in my program .

Aasiya Shaikh gravatar image Aasiya Shaikh  ( 2016-10-26 05:05:46 -0600 )edit

1.As tfoote said,use rosbag . 2.Print the message in file through standard c++.

Yang gravatar image Yang  ( 2016-10-26 20:32:21 -0600 )edit

Okay Thank you

Aasiya Shaikh gravatar image Aasiya Shaikh  ( 2016-10-27 05:41:34 -0600 )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



Asked: 2016-10-26 01:19:21 -0600

Seen: 1,142 times

Last updated: Feb 07 '17