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

Add VoxelGridShape #1076

Merged
merged 31 commits into from
Jul 10, 2018
Merged

Add VoxelGridShape #1076

merged 31 commits into from
Jul 10, 2018

Conversation

jslee02
Copy link
Member

@jslee02 jslee02 commented Jul 3, 2018

This PR adds VoxelGridShape class and its collision detection feature using fcl. VoxelGridShape uses octomap for the underlying voxel grid representation.

This is a minimal implementation for rapid test for voxel grid collision detection. There are many rooms for improvements, which will be handled subsequent PRs in the future.


Before creating a pull request

  • Document new methods and classes
  • Format new code files using clang-format

Before merging a pull request

  • Fix test failure on macOS (disabled for Octomap (>= 1.9.0))
  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md
  • Add unit test(s) for this change

@jslee02 jslee02 added this to the DART 6.6.0 milestone Jul 3, 2018
@jslee02 jslee02 requested a review from mxgrey July 3, 2018 04:19
@jslee02 jslee02 changed the base branch from master to release-6.6 July 3, 2018 04:19
@jslee02 jslee02 changed the title Add voxel grid shape and collision detection Add VoxelGridShape Jul 3, 2018
Copy link
Member

@mxgrey mxgrey left a comment

Choose a reason for hiding this comment

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

Voxel occupancy maps are super valuable, and I'm totally on board with supporting that type of shape in DART. But I do have a high-level concern about this PR:

This is adding a dependency to the core DART library for a new feature that many users won't care about. In an ideal world, we'd be able to make this an optional component library so that only users who care about voxel grids will get this dependency. However, our current relationship structure between shapes and collision detection wrappers seems to make this impossible.

It would be nice if we could restructure that relationship somehow. For example, have a dart-shapes library that contains the default dependency-free shapes, and then dart-shapes-voxel could be a component that adds the VoxelGridShape class and has an octomap dependency.

We'd have to make drastic changes to the implementations of the collision detection wrappers, so that shapes can inform the collision detector about how to convert its data from the DART representation to the underlying collision detector's representation. That would have the additional benefit of allowing us to support user-defined shape types without the user needing to make any changes to the DART codebase.

I don't think it would be feasible to tackle that kind of redesign in this PR, but we could consider it for 7.0.

If this VoxelGridShape feature is important for some work that you're doing, then I wouldn't want to block it over dependency concerns. I'm okay with merging this, but I'd recommend that we consider flipping around our shape design in the near future.

const dart::collision::fcl::Transform3& transform1,
const dart::collision::fcl::Transform3& transform2,
int evalContactPosition(const fcl::Contact& fclContact,
const::fcl::BVHModel<fcl::OBBRSS>& mesh1,
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing the lack of a space between const and :: here was a copy/replace accident?

@jslee02
Copy link
Member Author

jslee02 commented Jul 7, 2018

@mxgrey I agree with you. As you mentioned, making the voxel shape as an optional component requires many changes, which I also think it would be better to be in DART 7.

To reduce the impact in dependencies and API changes, I added OctoMap dependency optional so that VoxelGridShape and its collision detection functionality are built only when OctoMap is detected.

Let me create issue(s) for your suggestions.

@codecov
Copy link

codecov bot commented Jul 8, 2018

Codecov Report

Merging #1076 into release-6.6 will decrease coverage by <.01%.
The diff coverage is 82.92%.

@@               Coverage Diff               @@
##           release-6.6    #1076      +/-   ##
===============================================
- Coverage        56.52%   56.52%   -0.01%     
===============================================
  Files              316      316              
  Lines            24396    24398       +2     
===============================================
+ Hits             13790    13791       +1     
- Misses           10606    10607       +1
Impacted Files Coverage Δ
...art/dynamics/detail/TranslationalJoint2DAspect.hpp 60% <ø> (ø) ⬆️
dart/collision/fcl/FCLCollisionDetector.hpp 100% <ø> (ø) ⬆️
dart/collision/dart/DARTCollisionDetector.hpp 100% <ø> (ø) ⬆️
dart/common/detail/LockableReference-impl.hpp 36.36% <0%> (+1.06%) ⬆️
dart/collision/fcl/FCLCollisionDetector.cpp 83.15% <83.95%> (-0.27%) ⬇️

mxgrey
mxgrey previously approved these changes Jul 8, 2018
@jslee02
Copy link
Member Author

jslee02 commented Jul 8, 2018

The macOS failure is due to that Octomap 1.9.0 returns different results from Octomap (>= 1.8.1). I'll investigate on that but not in this PR. In the meantime, the support of Octomap (>= 1.9.0) will be disabled.

@jslee02 jslee02 merged commit 9c3e138 into release-6.6 Jul 10, 2018
@jslee02 jslee02 deleted the enhance/voxel_shape branch July 10, 2018 04:21
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