in 6th point, it is mentioned to create script that automatically saves maps, what does it mean? In theory there Is no mentioning about creating script, we directly used map_saver script to save map using rosrun map_server map_saver -f my_map
I am not sure if there is any specific way to save the maps. But you could execute a shell script from python program using os or the subprocess modules.
Just call the command rosrun map_server map_saver -f <full/path/to/map/file/location>.
So if you use os, you can do os.system(above_command).
If you want to use subprocess, you can do subprocess.Popen(above_command.split(), shell=True).
Thanks for the suggestion I used os.system in my script and called the rosrun command, it worked fine.
But I have a doubt about whats the point of creating the script however we can directly use rosrun map_server map_saver -f <full/path/to/map/file/location>
What’s the point of having a program for a robot that is not able to save the map automatically and needs a person to type in the command in a terminal (by disturbing the robot while it is running)?