Is there way or subject to see robot's past trajectory?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Is there way or subject to see robot's past trajectory?

zelda
This post was updated on .
When doing mapping with $roslaunch rtabmap_ros demo_turtlebot_mapping.launch file,
It records database file. If I see it with rtabmap-databaseViewer, and do view-graph, I could see
map image with the total trajectory robot moved during the mapping(blue line). I really need that blue line.



But, I need trajectory when I do the localization mode.

1)Is there way to show that trajectory in Rviz?(I looked at Path topics but I could only see global/local paths, not past paths)
2)Is there way to record .db during the localization?

Or Is there any other way to do that??
(I could also record bag, but couldn't find appropriate topic that could record trajectory)
Thank you.

Reply | Threaded
Open this post in threaded view
|

Re: Is there way or subject to see robot's past trajectory?

matlabbe
Administrator
Hi,

Good question, there is no explicit way to save the trajectory on localization mode. In localization mode, the database is read-only, to make sure that the database doesn't change.

One way would be to create a node pooling TF each second, get frame /map -> /base_link (or /base_footprint depending on your setup) and save to pose to a file. Instead of pooling, you can subscribe to /rtabmap/info topic to know when frame /map -> /odom is ready, then save /map -> /base_link.

You can also record a rosbag of /tf only (you will have all /map -> /base_link frames).

cheers
Reply | Threaded
Open this post in threaded view
|

Re: Is there way or subject to see robot's past trajectory?

zelda
Ok thank you! Actually I didn't succeed, but I think I have to try more..