-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Load static map #45
base: catkin
Are you sure you want to change the base?
Load static map #45
Conversation
added a mutex to protect the slamProcessor ptr in case of deleting it while accessing its contents.
… and 'reload x y a' will set initial pose after reload the map.
I've tested this PR and it does do what @Jin-W-FS says. 👍 Working on a PR to make the variable names more clear and do a bit of clean-up. |
I'm also very interested in this feature. When could this pull request be merged ? |
This is really a nice function, hope this can be merged into the main branch. |
My observation with this PR after testing: My problem is that the map gets overwritten as soon as hector slam starts. The robot DOES NOT localize(the robot pose does not change accurately) based on previous map but simply overwrites on top of it with new landmarks. |
I'm trying to figure out how to make localization possible even with a very poor initial pose. |
Hi @skohlbr , |
@bj-neilson: The load functionality in this PR does work for maps in standard ROS map format (see http://wiki.ros.org/map_server#Map_format). GeoTiff maps aren't meant as a format for saving/loading maps, but mainly for visualization. |
Any update for this? |
Does anyone have any updates? |
Hi @sprajagopal Did you manage to get the Robot to localize? |
No. I realized there's a lot of math I needed to understand before debugging the code effectively. |
Thanks for nice implementation. However, I got one trouble. The map is built before I set the initial pose for the robot, so that the new map is overwritten with the static map. How can I solve this problem? |
Hi, i had mymap.yaml from map_server then try load statics map by but nothing map on Rviz and no error on terminal.help me Thank everyone! |
@Jin-W-FS i tried your modified code, but the map is overwritten. need some help please |
Hi whats the status of this branch? Are there any news? It would be a really useful feature. |
I got localization and continuous mapping done with this pull request (Noetic).
If you need to get a map, install map-server
After this run your hector-mapping code to build your map, once your mapping is finished run
to get your map.
(4) If you want to do continuous mapping, the default values are 0.4 and 0.9 for the free and occupied values respectively. However, I wanted faster updates to my map and used the values 0.1 and 0.99999. If you want to do localization and do not want to update the map set the values to 0.5 and 0.5. See the documentation and code for Hector-SLAM to get a better idea for the motivation for these values. Hope this helps. |
In these commits I merely completed the method HectorMappingRos::setStaticMapData and use it to load map(s) from the service /static_map at startup and after receiving a "reload" command.
I have the needs to run a device in a same environment again and again with a same world coordinate system. Make hector_mapping load a static map (perhaps with an inaccurate initial pose) will give it a proper beginning.
I use the ros node map_server#map_saver to save hector_mapping data into map files, and map_server#map_server to offer the /static_map service. If so, map_server's /map and /map_metadata topics should be remapped to some other names to avoid conflict. to be exactly, you need something like this in the launch file:
---- updated on 2017/12/15 ----
It is hard to make hector_mapping use the given initial pose to start estimate right after loading a static map. So in the latest commit 0866395, I modified the command format to make two things done in one command.