ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Where is the map stored at different times?

asked 2018-08-13 17:01:05 -0600

pitosalas gravatar image

Things I think I understand but please check me:

The map_server is responds to client requests with information about the map. It can respond as a service or it also publishes the same information as a topic. When launched a file on disk can be supplied which will be the initial state of the map that is served up

  • How often does it publish as a topic, it would seem that maps can be big and that would be expensive!
  • Where is that map stored inside of the map server? In memory, in which case is it lost if/when the map server dies?
  • How is the map server told to update the map if ever?
  • Does map server ever update the file on disk?
  • What if another node updates the file on disk?

[Truth that I have read many of the docs as well as book sections and still am a little fuzzy.]

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-08-16 05:16:07 -0600

Delb gravatar image

updated 2018-08-16 10:01:50 -0600

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.

edit flag offensive delete link more

Comments

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?

pitosalas gravatar image pitosalas  ( 2018-08-16 10:45:59 -0600 )edit

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

Delb gravatar image Delb  ( 2018-08-16 10:56:47 -0600 )edit

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?

pitosalas gravatar image pitosalas  ( 2018-08-16 11:00:01 -0600 )edit

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 )

Delb gravatar image Delb  ( 2018-08-16 11:00:22 -0600 )edit

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 )

Delb gravatar image Delb  ( 2018-08-16 11:01:45 -0600 )edit

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

Delb gravatar image Delb  ( 2018-08-16 11:22:27 -0600 )edit

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.

pitosalas gravatar image pitosalas  ( 2018-08-16 20:54:35 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-08-13 17:01:05 -0600

Seen: 845 times

Last updated: Aug 16 '18