Skip to content
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

Occupancy grid map to elevation map #385

Open
valli96 opened this issue Jan 28, 2023 · 1 comment
Open

Occupancy grid map to elevation map #385

valli96 opened this issue Jan 28, 2023 · 1 comment

Comments

@valli96
Copy link

valli96 commented Jan 28, 2023

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

@ivrolan
Copy link

ivrolan commented Feb 19, 2023

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants