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

save vector<geometry_msgs::Point> to a file

asked 2014-03-20 23:17:55 -0500

jpo gravatar image

updated 2014-03-20 23:34:37 -0500

Hi, I need to save vector of geometry_msgs::Point to a file because I need to reuse it in a future. I have already done some research (e.g. tried this http://stackoverflow.com/questions/24... ) but nothing worked...any ideas? Is that even possible?

Thanks in advance, JP

edit retag flag offensive close merge delete

Comments

Do you need to write that from code? ROS tools like rosbag or rostopic echo enable you to dump messages to files easily. There is also the rosbag api.

dornhege gravatar image dornhege  ( 2014-03-21 00:43:46 -0500 )edit

If u want i can give u a cpp file that saves subsribed topic to CSV file

BP gravatar image BP  ( 2014-03-21 03:06:44 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-03-21 00:54:47 -0500

demmeln gravatar image

I agree with @dornhege. I would first try to use rosbag (maybe create a custom message with a list of points, or store all points as messages on a single topic). Alternatively, you can directly write rosbags from your program using the rosbag API [1,2]. If that doesn't suit you either, you can directly serialize the individual messages using the message serialization facilities [3]. Lastly, you are always free to just write your own specialized serialization. After all, a Point message is just 3 floats.

[1] http://wiki.ros.org/rosbag/Code%20API

[2] http://wiki.ros.org/rosbag/Cookbook

[3] http://wiki.ros.org/roscpp/Overview/M...

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2014-03-20 23:17:55 -0500

Seen: 1,178 times

Last updated: Mar 21 '14