Occupancy grid map to elevation map
For a future path planning through uneven terrain, I am trying to convert a 2D occupancy map into an elevation map and then save it as a grid map. Which one to use as a starting point. Is it possible to use "grid_map_costmap_2d" to do this? And if so, can someone give an example?
My 2D occupancy grid maps saved as a .pgm and .yaml file and use noetic
Or is this the wrong approach? Thanks in advance
Hi Valentin,
I'm trying to incorporate grid_maps to nav2_map_server of Nav2, so I had to do something similar to this. Basically, the function fromOccupancyGrid() of GridMapROSConverter takes the 2D occupancy msg and creates a layer with its data in the specified grid_map. If you want to save the grid_map to load it later, you can convert it to a OccupancyGrid and use the same function the map_server uses to create a .pgm map from a OccupancyGrid.
Take a look to my modification of nav2_map_server, mainly the map_io.cpp. I hope it helps!