Proper way to set the size.z of <heightmap><size></size><heightmap>
To put things into context I have a DEM stored in a geotiff with proper gdal metadata set, I am using Gazebo9.
Let's say the DEM has max_elevation of 5.0 and and a min_elevation value of 1.0.
How do I correctly set the value of z_scale value (shown below) if I want to maintain the same height values stored in the dem?
<heightmap><size>desired_width desired_height z_scale</size></heightmap>
By examining https://github.com/osrf/gazebo/blob/g... and https://github.com/osrf/gazebo/blob/g... gazebo seems to use the following formula (max_elevation-min_elevation)/max_elevation
, this means that z_scale would be (5.0-1.0)/5.0=0.8
.
I read somewhere that I should be using the formula max_elevation-min_elevation
which mean the z_scale value would 5.0-1.0=4.0
. Is this correct?
Also how much reliable is the GDAL metadata parsing code within Gazebo9. Can I just rely on that?
@scpeters At one point, I tried omitting the <size> for a tiff height-map that had associated geo-reference information, gazebo loads the map with proper elevation (I measured that) but the desired_width & desired_height was not in line with the geo-reference information. The map had a size of 5mx5m but gazebo gave me 20mx20m. How do I report a bug?