Gazebo | Ignition | Community
Ask Your Question

heightmap "Coordinates out of range" error

asked 2015-11-05 12:32:27 -0600

charlesfox gravatar image


I'm looking at the heightmap tools in gazebo but getting this error. The heightmap works OK when I use the shipped example png:

<collision name="collision"> <geometry> <heightmap> <uri>file://media/materials/textures/heightmap_bowl.png</uri> <size>1 1 1</size> <pos>0 0 0</pos> </heightmap> </geometry> </collision>

But when I swich to my own png I get a load of errors like Error [] Image: Coordinates out of range [995 1024]

Something gets loaded into gazebo, I can see a spiky terrain (it should be smooth) that suggests there may be some problem interpreting bytes as pixels. There is an area that's all zero height which does display correctly.

My own png has 1025x1025 pixels, and I've tried saving it in 8-bit (heights 0-255) and 16-bit, with no change to the error. It is supposed to represent an area of 2050m x 2050m, with heights from 0 to 250m.

Is there something I need to change in the size setting perhaps, I have tried <size>2050 2050 250</size> but still getting the error.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-11-06 09:57:06 -0600

charlesfox gravatar image

Answering own question for future reference -- problem was that pngs were still being saved as 16bit not 8bit. Looks like Gazebo interprets 16bit image values as pairs of 8bit values, which gives rise to the choppy/buggy appearance.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2015-11-05 12:32:27 -0600

Seen: 6,068 times

Last updated: Nov 06 '15