ROS Navigation Real Robot Project Map

In Mapping section

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

or do I need to create a launch file which run the map_saver to save the map?

Hi @AshishVarma ,

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).

I hope this helps.

Regards,
Girish

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>

Hi @AshishVarma ,

Let me ask a question to answer your question…

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)?

Regards,
Girish

:sweat_smile: totally convinced.
Thanks @girishkumar.kannan

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.