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

Heightmaps πŸ”οΈ #218

Merged
merged 24 commits into from
Jul 8, 2021
Merged

Heightmaps πŸ”οΈ #218

merged 24 commits into from
Jul 8, 2021

Conversation

chapulina
Copy link
Contributor

@chapulina chapulina commented Mar 3, 2021

πŸŽ‰ New feature

Closes #156

Summary

Add an attach heightmap feature and its implementation for DART.

The current implementation has a nice feature: there are hidden holes where objects can go through πŸ•³οΈ πŸ™‚ It may be related to gazebosim/gazebo-classic#2838

heightmap_dart)opt

Test it

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial: on ign-gazebo
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

πŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”ΈπŸ”Έ

scpeters and others added 8 commits February 25, 2021 18:11
Make dependency for dartsim plugin.

Signed-off-by: Steve Peters <[email protected]>
still needs more changes in CustomHeightmapShape

Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
@chapulina chapulina added enhancement New feature or request DART DART engine labels Mar 3, 2021
@chapulina chapulina requested a review from scpeters March 3, 2021 02:58
@chapulina chapulina self-assigned this Mar 3, 2021
@github-actions github-actions bot added the 🏒 edifice Ignition Edifice label Mar 3, 2021
Signed-off-by: Louise Poubel <[email protected]>
@chapulina chapulina added the beta Targeting beta release of upcoming collection label Mar 17, 2021
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
@chapulina
Copy link
Contributor Author

The current implementation has a nice feature: there are hidden holes where objects can go through hole slightly_smiling_face

This is a problem in the ode collision checker, which is the default one. Using the bullet checker, the heightmap behaves as expected:

heightmap_bullet

I tested the above with these branches:


This PR is ready for review. CC @scpeters

@chapulina chapulina marked this pull request as ready for review March 17, 2021 20:24
@chapulina chapulina requested a review from mxgrey as a code owner March 17, 2021 20:24
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
@codecov
Copy link

codecov bot commented Mar 17, 2021

Codecov Report

Merging #218 (63cbe64) into ign-physics4 (a20dbba) will increase coverage by 0.14%.
The diff coverage is 80.70%.

Impacted file tree graph

@@               Coverage Diff                @@
##           ign-physics4     #218      +/-   ##
================================================
+ Coverage         75.26%   75.40%   +0.14%     
================================================
  Files               122      125       +3     
  Lines              5376     5433      +57     
================================================
+ Hits               4046     4097      +51     
- Misses             1330     1336       +6     
Impacted Files Coverage Ξ”
dartsim/src/SDFFeatures.cc 66.39% <0.00%> (-0.83%) ⬇️
dartsim/src/CustomHeightmapShape.cc 82.60% <82.60%> (ΓΈ)
dartsim/src/ShapeFeatures.cc 40.36% <94.73%> (+7.70%) ⬆️
...clude/ignition/physics/heightmap/HeightmapShape.hh 100.00% <100.00%> (ΓΈ)
...gnition/physics/heightmap/detail/HeightmapShape.hh 100.00% <100.00%> (ΓΈ)

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update a20dbba...63cbe64. Read the comment docs.

@chapulina
Copy link
Contributor Author

Removed from beta, this can come in a minor release.

@chapulina chapulina changed the base branch from main to ign-physics4 April 1, 2021 20:37
Signed-off-by: Louise Poubel <[email protected]>
@chapulina
Copy link
Contributor Author

See gazebo-release/ign-physics4-release#9 for Debian packaging

@chapulina
Copy link
Contributor Author

This is ready for review, @scpeters

Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

I'm going to make a change to ign-common to allow passing HeightmapData as a const reference to AttachHeightmapShape

/// \param[in] _subSampling Increase sampling to improve resolution.
public: ShapePtrType AttachHeightmapShape(
const std::string &_name,
ignition::common::HeightmapData &_heightmapData,
Copy link
Member

Choose a reason for hiding this comment

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

I saw that you had to make this argument non-const in 923ae18 since HeightmapData::FillHeights is not a const function. I believe that could be a const function, so I'll go ahead and add a const version alongside the current one so we can make this argument const again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to make a change to ign-common to allow passing HeightmapData as a const reference to AttachHeightmapShape

HeightmapData is a pure virtual class, so I think it will be hard to add new API to it without breaking ABI. I have a band-aid workaround in 457c052, which shouldn't be too costly since the HeightmapData classes themselves are pretty thin. Let me know what you think.

There's a lot that bothers me about the HeightmapData class, I think it could be refactored in the future.

dartsim/src/CustomHeightmapShape.cc Outdated Show resolved Hide resolved
dartsim/src/CustomHeightmapShape.hh Outdated Show resolved Hide resolved
dartsim/src/EntityManagement_TEST.cc Outdated Show resolved Hide resolved
@chapulina chapulina requested a review from ahcorde July 1, 2021 02:38
ahcorde
ahcorde previously requested changes Jul 1, 2021
Copy link
Contributor

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

  /usr/bin/find: '/github/workspace/tpe/include': No such file or directory
  /usr/bin/find: '/github/workspace/bullet/include': No such file or directory
  /github/workspace/dartsim/src/CustomHeightmapShape.cc:55:  Lines should be <= 80 characters long  [whitespace/line_length] [2]

Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

I finally finished looking over the changes you've made, and I just found one tiny thing that I will fix directly

dartsim/src/EntityManagement_TEST.cc Outdated Show resolved Hide resolved
Signed-off-by: Steve Peters <[email protected]>
@scpeters
Copy link
Member

scpeters commented Jul 8, 2021

/usr/bin/find: '/github/workspace/tpe/include': No such file or directory
/usr/bin/find: '/github/workspace/bullet/include': No such file or directory
/github/workspace/dartsim/src/CustomHeightmapShape.cc:55: Lines should be <= 80 characters long [whitespace/line_length] [2]

I fixed the line length in 4a1edc3

@scpeters
Copy link
Member

scpeters commented Jul 8, 2021

added some test expectations for CastToHeightmapShape in 63cbe64 to improve coverage

@scpeters scpeters dismissed ahcorde’s stale review July 8, 2021 23:06

codecheck already fixed

@chapulina chapulina merged commit e21c8c9 into ign-physics4 Jul 8, 2021
@chapulina chapulina deleted the chapulina/4/heightmap branch July 8, 2021 23:46
vatanaksoytezer pushed a commit to vatanaksoytezer/ign-physics that referenced this pull request Jul 31, 2021
Signed-off-by: Steve Peters <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>

Co-authored-by: Steve Peters <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DART DART engine 🏒 edifice Ignition Edifice enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Heightmap support for DART
3 participants