Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DARTHeightmapShape: correctly load asymmetric terrains #2818

Merged
merged 2 commits into from
Aug 19, 2020

Conversation

scpeters
Copy link
Member

@scpeters scpeters commented Aug 8, 2020

Support for heightmaps in DART was added in bitbucket pull request 2956 and bitbucket pull request 3066 with tests using the heightmap_valley.png image, which happens to be symmetric in both x and y directions. I recently noticed a bug in DARTHeightmapShape when using asymmetric terrains, so I added a test using worlds/heightmap.world, which uses the asymmetric heightmap_bowl.png with a box at each of the 4 corners. The boxes all start at the same height, and based on the shape of the heightmap, 3 of the boxes should already be in contact with the heightmap, but one of them (box2) should fall. I've added a test that illlustrates the failure with dart:

[Dbg] [DARTPhysics.cc:734] Using BULLET collision detector
Dbg DART Bullet heightfield AABB: min = {-64.249, -64.249, -5}, max = {64.249, 64.249, 5} (will be translated by z=5)
AL lib: (EE) ALCpulsePlayback_streamStateCallback: Received stream failure!
[Dbg] [ServerFixture.cc:203] ServerFixture load in 0.8 seconds, timeout after 600 seconds
/data_fast/scpeters/ws/gazebo8/src/gazebo/test/integration/heightmap.cc:952: Failure
Expected: (box1->WorldPose().Pos().Z()) >= (9.9), actual: 5.0951 vs 9.9
/data_fast/scpeters/ws/gazebo8/src/gazebo/test/integration/heightmap.cc:956: Failure
Expected: (box2->WorldPose().Pos().Z()) < (5.5), actual: 9.98575 vs 5.5
[Dbg] [ServerFixture.cc:129] ServerFixture::Unload

The fix is to set an uninitialized variable DARTHeightmapShape::flipY to false.

Use gazebo --verbose worlds/heightmap.world -e dart to see the failure in gzclient.

@scpeters scpeters requested a review from azeey August 8, 2020 01:14
@scpeters
Copy link
Member Author

@osrf-jenkins run tests please

1 similar comment
@scpeters
Copy link
Member Author

@osrf-jenkins run tests please

@scpeters
Copy link
Member Author

Copy link

@claireyywang claireyywang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

The heightmap_valley.png used in the heightmap tests for ODE
and DART is symmetric, which obscures the fact that DART
is not treating asymmetric heightmaps properly.
This adds a test using worlds/heightmap.world and
heightmap_bowl.png to illustrate the bug.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
This variable was uninitialized and was causing problems
with asymmetric heightmaps.

Signed-off-by: Steve Peters <scpeters@openrobotics.org>
@scpeters
Copy link
Member Author

thanks for the review!

@scpeters scpeters merged commit cf4a7f0 into gazebosim:gazebo10 Aug 19, 2020
@scpeters scpeters deleted the dart_heightmap_flipY branch August 19, 2020 17:54
@scpeters scpeters mentioned this pull request Jan 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants