dart icon indicating copy to clipboard operation
dart copied to clipboard

Fix HeightmapShape visual/collision mismatch (ODE)

Open jslee02 opened this issue 3 weeks ago • 1 comments

Fixes #1658

HeightmapShape visual rendering and collision geometry were misaligned (most visible with ODE heightfields). This series aligns the visual mesh and collision origin, and tightens heightmap bounds handling.

  • Center heightmap render vertices around the origin and align the ODE heightfield transform so visual/collision match.
  • Compute HeightmapShape bounding box using sample spacing ((N-1) * scale) and add a regression test.
  • Fix ODE heightfield AABB bounds for scale.z < 1 by passing unscaled min/max heights; add an ODE regression test.
  • Update the gz-physics integration patch to compute heightmap spacing using (vertSize-1) so Gazebo Physics tests match DART's heightmap semantics.

Before creating a pull request

  • [x] Run pixi run test-all to lint, build, and test your changes
  • [x] Add unit tests for new functionality
  • [ ] Document new methods and classes
  • [ ] Add Python bindings (dartpy) if applicable

jslee02 avatar Dec 13 '25 05:12 jslee02