ANYbotics / elevation_mapping

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

How to get the value of terrain elevation? #204

Closed Yaru-Gu closed 2 years ago

Yaru-Gu commented 2 years ago

Hi,

I'm wondering how I can get the value of terrain elevation (z) on a position specified by (x,y) in the robot base frame.

Any help would be appreciated.

shivauchiha commented 2 years ago

multiarray(i,j,k) = data[data_offset + dim_stride[1]i + dim_stride[2]j + k] i = x j = y k = channel [layer number]

I think this is how it should be done ?

Yaru-Gu commented 2 years ago

I solve the problem by using function map_.fusedMap_.at("elevation", index) in ElevationMapping.cpp