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

Saving map with the path into map.pgm

asked 2020-08-16 09:55:23 -0500

dtzx gravatar image

I want to save the mapping path of the robot as it maps, by first visualizing the path on Rviz and then saving the poses into an array. I am planning to have the robot use this mapping path again and want to validate it.

Therefore I am wondering if it is possible to save the mapping path visualized in Rviz, together with the map itself into map.pgm. This is purely for validation purposes so that I can compare the path seen in Rviz with the path in the map.pgm file uploaded.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-08-18 08:47:41 -0500

fergs gravatar image

If you're visualizing the path in RVIZ, you should be able write a node that subscribes to that same visualization topic and saves the data (of, if you are just watching the robot move along in RVIZ, you could save the pose of the robot as determined through TF). I don't know of any off the shelf approach for slam_gmapping -- slam_karto actually publishes the graph that it is optimizing as a visualization_msgs/MarkerArray which could be saved at the end of mapping.

edit flag offensive delete link more

Comments

I ended up writing another node to save the poses travelled by the robot and then published the poses back to the path topic to visualize it. Since the 2 path lines intersect in Rviz, I guess I can consider that my travel path has been validated. Thank you for the suggestions :)

dtzx gravatar image dtzx  ( 2020-08-20 04:15:41 -0500 )edit

Awesome - glad I could help. If you would, please select the checkbox next to my answer, which will mark this question as answered (helps us keeping track of questions on ROS Answers).

fergs gravatar image fergs  ( 2020-08-22 09:33:59 -0500 )edit

Question Tools

Stats

Asked: 2020-08-16 09:55:23 -0500

Seen: 1,019 times

Last updated: Aug 18 '20