Gazebo | Ignition | Community
Ask Your Question
2

Proper way to set the size.z of <heightmap><size></size><heightmap>

asked 2020-07-27 16:23:42 -0500

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?

edit retag flag offensive close merge delete

Comments

how much reliable is the GDAL metadata parsing code within Gazebo9. Can I just rely on that? If you explicitly set <size>, gazebo will use that, but if not it will infer the size from the DEM file. I haven't done benchmarking on its accuracy or tested for bugs, but I will be happy to investigate any bug reports about it. https://github.com/osrf/gazebo/blob/g...

scpeters gravatar imagescpeters ( 2020-08-07 18:30:42 -0500 )edit

@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?

Samahu gravatar imageSamahu ( 2020-08-12 15:48:01 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-08-06 15:17:35 -0500

lakshmi gravatar image

You should be using the formula max_elevation-min_elevation which mean the z_scale value would 5.0-1.0=4.0.

edit flag offensive delete link more

Comments

yes, I believe this is the right way to compute the scale, which should have units of length

scpeters gravatar imagescpeters ( 2020-08-07 18:25:04 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2020-07-27 16:23:42 -0500

Seen: 369 times

Last updated: Aug 06 '20