Save a map via a ROS node
Hi all,
I'm a ROS noob. I have a use case where I need to save the map (generated via gmapping on rviz), when I receive an event.
The use case is when I've detected 4 objects (turtlebot3), I need to save the image and this should be automated. So cannot use "rosrun map_server map_saver -f ~/map".
Is there anyway I can do this via a ROS node? Basically the same way how the map_server does it?
Thanks, Sachith
You can try a system call within your node to run the map server-save via rosrun. https://www.geeksforgeeks.org/system-call-in-c/
There are some warnings on the linked page about issues/constraints. YMMV.