Hi @brokenglass
When you save the map to disk from the map server by:
rosrun map_server map_saver -f <map_name>
two files will be generated.
Reference: http://wiki.ros.org/slam_gmapping/Tutorials/MappingFromLoggedData
A .pgm file that is a visual picture of the map and .yaml file that will contain information you are looking for. However you need to know how to interpret this information:
Reference: http://wiki.ros.org/map_server
The image describes the occupancy
state of each cell of the world in the
color of the corresponding pixel. In
the standard configuration, whiter
pixels are free, blacker pixels are
occupied, and pixels in between are
unknown. Color images are accepted,
but the color values are averaged to a
gray value.
You can take a look how map_saver.cpp does it. Some people use OpenCV to read image and interpret the occupancy map.
If you want to do something more advanced, take a look at this package: Grid Map by Anybotics
https://github.com/ANYbotics/grid_map
And the information on local planner and global planner parameters are stored as .yaml files.
Originally posted by osilva with karma: 1650 on 2021-11-19
This answer was ACCEPTED on the original site
Post score: 0
Original comments
Comment by brokenglass on 2021-11-22:
Thank you but I want to introduce obstacles in my local planner. the map related work is done.
I am using NMPC local planner.
Comment by osilva on 2021-11-22:
NMPC is a plug-in to the base_local_planner. The principles are the same as stated in my answer. You don’t introduce obstacles to the local planner. The local planner reads the costmap including obstacles to determine potential trajectories.