Ask Your Question
0

save vector<geometry_msgs::Point> to a file

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

jpo gravatar image

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

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 imagedornhege ( 2014-03-21 00:43:46 -0600 )edit

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

BP gravatar imageBP ( 2014-03-21 03:06:44 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

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

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

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

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

Seen: 635 times

Last updated: Mar 21 '14