I consider you have already checked the wiki about map_server.
The map_server simply allows you to read a map or create a new one.
To answer your questions :
- It publishes only one time the map you ask him to. You can check by yourself using
rosrun map_server map_server your_map.yaml
, you will see that the map_server
reads the informations of the map and publishes on the topics /map
and /map_metadata
only one time.
- The map isn't stored by the
map_server
, it reads a map file. You can store a map when creating one (with gmapping
for example) you can save it to yaml
and a pgm
files using map_saver
. In this case, instead of publishing on the /map
topic it subscribes to it. But if you don't use map_saver
, nothing will be stored.
- The map isn't updated. You create one when using
map_saver
but it will only listen to the topic /map
once to generate the map files and then the node ends itself.
- Cf previous answer : Yes, if you run
rosrun map_serer map_saver
multiple times.
- Unless you directly change the
pgm
file the map isn't updated.
Hope i've answered to all your questions.
Originally posted by Delb with karma: 3907 on 2018-08-16
This answer was ACCEPTED on the original site
Post score: 1
Original comments
Comment by pitosalas on 2018-08-16:
Thanks for a great answer!! One follow up: SLAM means Simultaneous Localization & Mapping. I assume that means that while we are navigating (using a map) the map can be further improved and extended. If the map on disk is never modified (except when you do map server save) how does this work?
Comment by Delb on 2018-08-16:
Well SLAM is the generic term, you have different types : Hector which relies only on the lidar infirmations, gmapping which relies on odometry and lidar, cartographer is another one by Google etc..
Comment by pitosalas on 2018-08-16:
Thanks @deb. So take gmapping. Can I make it begin with the old map stored on disk and have it build on that, or does it literally always start with nothing and then build a map which I can save? (p.s. if you have a link (other than reading the c++ code, which I could do) where I could learn more?
Comment by Delb on 2018-08-16:
When you are navigating you have two options : you already know the map that you specify in roslaunch and it's fixed (and then you can use AMCL to localise the robot) or you don't know the map so you use one of the slam algorithms (and here AMCL is useless cause the slam already localise )
Comment by Delb on 2018-08-16:
If you already have a map you don't use slam, if you don't have one you can create a map with SLAM (using a gazebo simulation or the real sensors )
Comment by Delb on 2018-08-16:
You can go read the wiki about the Ros navigation stack about how you can navigate with the robot it should be a good start
Comment by pitosalas on 2018-08-16:
Thanks @delb. I did read all about the navigation stack but I am sure I don't understand it yet, which is why the questions. I will continue to dig into it.