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

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 ) but nothing worked...any ideas? Is that even possible?

Thanks in advance, JP

edit retag flag offensive close merge delete


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

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.




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


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

Seen: 1,030 times

Last updated: Mar 21 '14