ANYbotics / elevation_mapping

Robot-centric elevation mapping for rough terrain navigation
BSD 3-Clause "New" or "Revised" License
1.36k stars 446 forks source link

The data in '/elevation_mapping/elevation_map_raw' topic. #146

Closed Psyduck123 closed 3 years ago

Psyduck123 commented 3 years ago

Hi, I have a question about the data in '/elevation_mapping/elevation_map_raw' topic. I subscribed to this topic and plot it as a grey image by transforming it into a NumPy array. I found that the image I plot is different from what I saw in Rviz (the obstacle position is different, sometimes the obstacle is been cut off).

I am wondering the data in '/elevation_mapping/elevation_map_raw' topic is expressed in which frame (base_link or map)?
Why the array I plot from the topic is different from the grid_map in Rviz in realtime.

Looking forward to your reply! Thanks.

maximilianwulf commented 3 years ago

Can add print screens?

Out of my head try this function before you convert it to an image.

Psyduck123 commented 3 years ago

Thanks for your prompt response! @maximilianwulf I use python matplotlib to save the image and check (cannot print screens). I wonder if there any function in python to get the elevation map information by array under the world frame?

maximilianwulf commented 3 years ago

You can check the map_frame_id in your configuration. There you can also switch it to any frame you want.

I hope that helps.

Psyduck123 commented 3 years ago

I directly subscribe to the '/elevation_mapping/elevation_map_raw' topic. There is no map_frame_id in this topic. So I save the data in this topic as an array and plot it as an image. What I got from the Rviz of this topic and what I plot as shwon below. elevation plot_elevation

Why the array I got is different from the arrangement in Rviz(from the same topic) ?

maximilianwulf commented 3 years ago

Hey thanks for the images, that confirms my suspicion.

Please use convertToDefaultStartIndex() before you convert it to an image.

maximilianwulf commented 3 years ago

Feel free to re-open.