Gazebo | Ignition | Community
Ask Your Question

Translating heighmap creates offset between collision and visual

asked 2017-03-06 14:14:01 -0600

bybee.taylor gravatar image

When using the <pos> tag inside the <heightmap> to get my heightmap aligned with my coordinate system of choice, it appears to be translating correctly when I open the client, but when I place an object on the heightmap, it is as if the collision frame did not translate.

This portion of the world file looks as follows. There appears to have been a similar issue that was resolved a few years ago (,, but I still seem to be exhibiting the problem.

Any ideas? I am on Gazebo 7.5, installed from binaries.

 <model name="heightmap">
      <link name="height">
        <collision name="collision">
              <size> 540 540 60 </size>
              <pos> -55 -72 0 </pos>
        <visual name="visual_abcedf">
                <size> 540 </size>
              <size> 540 540 60 </size>
              <pos> -55 -72 0 </pos>
edit retag flag offensive close merge delete


I am wondering if what you're experiencing is related to this issue:

iche033 gravatar imageiche033 ( 2017-03-06 15:48:09 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-01-11 10:08:56 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Assuming that you use default physics engine (ODE), one possible way to solve this problem is, write a model plugin for your heightmap terrain, extract its collision pointer (type casted to ODECollision type) and use ODE function dGeomSetPosition( ODECollisionPtr->ODECollisionId(), x, y, z). The offset you see is because, translation happens in rendering component (in x, y, z) but not in physics component (happens only in z) ( check gazebo-7/gazebo-9 source code ).

This worked for me!!!

check the below link for proper syntax: ODE API Docs

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-03-06 14:14:01 -0600

Seen: 11,186 times

Last updated: Jan 11 '21