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

Unified Collision Environment Bullet #1572

Merged
merged 7 commits into from
Nov 11, 2019

Conversation

j-petit
Copy link
Contributor

@j-petit j-petit commented Jul 18, 2019

Description

This PR unifies the Bullet collision environment and gets the feature branch to build again.

I reduced / improved the Bullet glue code in many places through creating a common parent class for both discrete and cast collision checkers and removed a lot of unnecessary code in bullet_utils.h.

@j-petit j-petit changed the title Unified Collision Environment [WIP] Unified Collision Environment Bullet [WIP] Jul 25, 2019
@mlautman mlautman closed this Aug 2, 2019
@mlautman mlautman reopened this Aug 2, 2019
@mlautman mlautman changed the base branch from feature-bullet-collision to feature-bullet-trajopt August 2, 2019 23:30
@j-petit j-petit force-pushed the collision_env branch 3 times, most recently from 0975404 to f8d507f Compare August 7, 2019 11:20
@v4hn v4hn added the wip label Aug 12, 2019
@rhaschke
Copy link
Contributor

@j-petit, looks like you messed up the commit history by rebasing? There are many commits of the master branch listed in this PR.

@BryceStevenWilley
Copy link
Contributor

@rhaschke That's intentional. This PR needs the changes from #1584, which just made it into master. I advised Jens to rebase this branch, and then I'd rebase the feature branch on master.

@j-petit
Copy link
Contributor Author

j-petit commented Aug 23, 2019

@rhaschke That's intentional. This PR needs the changes from #1584, which just made it into master. I advised Jens to rebase this branch, and then I'd rebase the feature branch on master.

Not done with rebasing yet @BryceStevenWilley, I have one failing test case which I still need to work on...

@rhaschke
Copy link
Contributor

That's intentional. This PR needs the changes from #1584, which just made it into master.

I see. But I think this PR not only requires #1584 but also the changes made in the branch feature-bullet-trajopt, which is the target branch of this PR. However, this feature branch is somewhat behind master. I think, we should either rebase the feature branch onto master or merge master into the feature branch. Only then, we can rebase Jens' new commits corresponding to this PR onto the result.

@BryceStevenWilley
Copy link
Contributor

I think, we should either rebase the feature branch onto master or merge master into the feature branch. Only then, we can rebase Jens' new commits corresponding to this PR onto the result.

The plan is to rebase the feature branch onto master. I asked Jens to go ahead an resolve many of the rebase conflicts by rebasing himself, and then I'll force-push the conflict-free version of the feature branch once I get the go-ahead.

@BryceStevenWilley BryceStevenWilley added awaits 2nd review one maintainer approved this request and removed wip labels Aug 26, 2019
@j-petit
Copy link
Contributor Author

j-petit commented Aug 26, 2019

Can anyone give me a hint to understand the Travis failure (clang-tidy):

fatal: ambiguous argument 'feature-bullet-trajopt..HEAD': unknown revision or path not in the working tree.

Use '--' to separate paths from revisions, like this:

'git <command> [<revision>...] -- [<file>...]'

No modified .cpp files

@rhaschke
Copy link
Contributor

I need to analyze this failure. Looks like the feature branch is not checked out by Travis...
It's definitely not your fault.

@rhaschke
Copy link
Contributor

rhaschke commented Aug 26, 2019

I pushed a fix for the clang-tidy check. However, the root cause of your Travis failure is not the clang-tidy check, but the clang build:

In file included from /root/ros_ws/src/moveit/moveit_core/collision_detection_bullet/src/bullet_integration/bullet_discrete_bvh_manager.cpp:34:
In file included from /root/ros_ws/src/moveit/moveit_core/collision_detection_bullet/include/moveit/collision_detection_bullet/bullet_integration/bullet_discrete_bvh_manager.h:37:
In file included from /root/ros_ws/src/moveit/moveit_core/collision_detection_bullet/include/moveit/collision_detection_bullet/bullet_integration/bullet_utils.h:39:
In file included from /root/ros_ws/install/include/geometric_shapes/mesh_operations.h:40:
In file included from /root/ros_ws/install/include/geometric_shapes/shapes.h:47:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/memory:81:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/shared_ptr.h:52:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.4.0/../../../../include/c++/7.4.0/bits/shared_ptr_base.h:588:8: warning: delete called on non-final 'collision_detection_bullet::BulletDiscreteBVHManager' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
              delete __p;

clang complains that BulletDiscreteBVHManager doesn't have a virtual destructor.

@j-petit j-petit force-pushed the collision_env branch 3 times, most recently from 7cdb9e4 to b78b8b5 Compare August 26, 2019 19:18
@j-petit
Copy link
Contributor Author

j-petit commented Aug 27, 2019

clang complains that BulletDiscreteBVHManager doesn't have a virtual destructor.

Addressed the issue, Travis passes now.

  * shortening namespace
  * documentation improvements
  * virtual destructor of BVH manager
  * remove extra speed benchmark
  * bugfix for not initialized managers
@Levi-Armstrong
Copy link
Contributor

I noticed due to the restructuring some the authors and copyright information was not transferred to the new files. It would be worth taking another look.

@j-petit
Copy link
Contributor Author

j-petit commented Aug 30, 2019 via email

@Levi-Armstrong
Copy link
Contributor

@j-petit Also it would be good to add your name to the author list where you feel it is relevant since you ported it to work with moveit.

@j-petit
Copy link
Contributor Author

j-petit commented Sep 3, 2019

Addressed the license comments in last commit

Copy link
Contributor

@mamoll mamoll left a comment

Choose a reason for hiding this comment

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

I left some small comments. This is a massive diff. Would it be possible to add some unit tests? Is it documented somewhere how you select the collision checker in MoveIt?

Do you have a benchmarking tool to compare Bullet vs. FCL performance for a given robot & environment model? I imagine Bullet is typically faster, but it'd be nice to know when perhaps FCL should be used (perhaps when the robot is represented is by a collection of spheres or the environment by a point cloud?).

  * replaced include guards through pragma
  * used default instead of empty {} for ctor/dtor
@j-petit
Copy link
Contributor Author

j-petit commented Sep 17, 2019

Thanks for taking the time to review @mamoll! Indeed this PR is big, but this mainly comes from the fact that I combined the two separate collision manager parent classes into a single one. It does not really add new functionality but involves a lot of copying code around. Tests are covered through the existing templated collision checking tests and an additional test suite for continuous collision detection.

There exists a tutorial on how to use Bullet in a pending PR. Furthermore, there is a benchmarking script available which is described in the README PR #1648 with a corresponding benchmarking environment. I also updated the top post in my GSoC github issue #1427 to reflect the most recent speed improvements.

My benchmarking setup is by far not exhaustive and it would be nice to have many more scenarios like you described (point clouds, etc.). See also my future work post here #1646. However, I am not sure when and if I will be able to work on those personally.

@j-petit
Copy link
Contributor Author

j-petit commented Nov 10, 2019

I am not sure what is the current status of this PR, any thoughts @mamoll ? I'd like to see this merged :)

@mamoll mamoll self-requested a review November 10, 2019 16:33
Copy link
Contributor

@mamoll mamoll left a comment

Choose a reason for hiding this comment

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

I am ok with getting this merged in.

@j-petit
Copy link
Contributor Author

j-petit commented Nov 10, 2019

awesome, then let's get this merged!

@mamoll mamoll merged commit 564829e into moveit:feature-bullet-trajopt Nov 11, 2019
j-petit added a commit to j-petit/moveit that referenced this pull request Nov 20, 2019
* Templated tests adapted for unified collision env

* Unified Bullet collision environment:
  * broadphase filtering adapted for early culling
  * ACM from SRDF in test
  * cleanup for bullet single collision env
  * removed link2castcow for CCD and only use constructor of COW directly
  * parent class for collision managers
  * removed function pointer for ACM check
  * removed extra self-collision manager and use only single manager
  * speed benchmark for unified environment

* PR review:
  * more descriptive variable names
  * added user to TODO

* PR review:
  * shortening namespace
  * documentation improvements
  * virtual destructor of BVH manager
  * remove extra speed benchmark
  * bugfix for not initialized managers

* Licenses revised of old tesseract files

* PR review:
  * replaced include guards through pragma
  * used default instead of empty {} for ctor/dtor

* Comments in Bullet readme about thread safety and speed
j-petit added a commit to j-petit/moveit that referenced this pull request Jan 12, 2020
* Templated tests adapted for unified collision env

* Unified Bullet collision environment:
  * broadphase filtering adapted for early culling
  * ACM from SRDF in test
  * cleanup for bullet single collision env
  * removed link2castcow for CCD and only use constructor of COW directly
  * parent class for collision managers
  * removed function pointer for ACM check
  * removed extra self-collision manager and use only single manager
  * speed benchmark for unified environment

* PR review:
  * more descriptive variable names
  * added user to TODO

* PR review:
  * shortening namespace
  * documentation improvements
  * virtual destructor of BVH manager
  * remove extra speed benchmark
  * bugfix for not initialized managers

* Licenses revised of old tesseract files

* PR review:
  * replaced include guards through pragma
  * used default instead of empty {} for ctor/dtor

* Comments in Bullet readme about thread safety and speed
davetcoleman pushed a commit that referenced this pull request Jan 23, 2020
* Empty collision checker template for usage with tesseract and bullet (#1499)

* Adding documentation to collision detection (#1488)

* CMake adaptions for Tesseract integration

* Empty collision detector template for tesseract and bullet

* Making bullet as a collision plugin available

* Adding missing error messages

* Adding new folders and libraries to cmake

* Fixing the BSD license

* clang-format

* Generic collision detection test suite (#1543)

Generalize collision detection tests by using a templated test fixture.

* Bullet Collision Detection (#1504)

* Added discrete BVH Bullet manager
* Added continuous collision detection
* Cleanup of tesseract code
   * removed simple collision managers
   * changed enum to enum classes
   * fixed typos
   * removing debugging statements
   * removing tesseract allowed collision matrix
   * removed tesseract macros
   * replaced typedefs of stl containers
   * removed tesseract attached object code
   * ACM members of collision robot and world removed and ACM check into callback out of class
   * remove ContactTestType and replace through MoveIt CollisionRequest
   * BodyType int changed to enum
   * removed tesseract_msgs dependency and unnecessary tesseract code
   * changed dependency from bullet3_ros to debian Bullet package

* Adding bullet and tesseract simple collision manager to the template:
   * added benchmark case for checking collision speed
   * tests for bullet collision checking

* Adding missing features:
  * attached objects
  * contact reporting max number of contacts fixed
  * Bullet plugin xml name fixed
  * padding and scaling for robot added
  * updated tests

* Adding continuous collision detection to Bullet (#1551)

* Adding continous collision detection:
  * check only active links added
  * benchmark FCL vs Bullet
  * renaming files from bt to bullet
  * renaming variables from bt to bullet
  * clang-tidy and clang-format
  * renaming of variables to be in moveit format
  * continuous tests added
  * CCD active links changed
  * distance testing added to panda test suite

* New collision features:
  * broadphase early culling
  * minimal distance reporting
  * renaming collision filter and group
  * removed extra margin on AABB for bullet
  * ACM in test from SRDF

* PR review

* Unified Collision Environment Bullet (#1572)

* Templated tests adapted for unified collision env

* Unified Bullet collision environment:
  * broadphase filtering adapted for early culling
  * ACM from SRDF in test
  * cleanup for bullet single collision env
  * removed link2castcow for CCD and only use constructor of COW directly
  * parent class for collision managers
  * removed function pointer for ACM check
  * removed extra self-collision manager and use only single manager
  * speed benchmark for unified environment

* PR review:
  * more descriptive variable names
  * added user to TODO

* PR review:
  * shortening namespace
  * documentation improvements
  * virtual destructor of BVH manager
  * remove extra speed benchmark
  * bugfix for not initialized managers

* Licenses revised of old tesseract files

* PR review:
  * replaced include guards through pragma
  * used default instead of empty {} for ctor/dtor

* Comments in Bullet readme about thread safety and speed

* Readme for speed benchmark (#1648)

* FCL Bullet benchmark readme
  * Benchmark script and launch file updated

* PR review fixups

* Adapt cmake for Bullet (#1744)

* cmake for using Bullet only if correct version available

* Fixup

* PR review fixup

* Rewrite with own FindBullet.cmake

* Use pkg-config

* Fix travis failure for melodic

* Fix moveit_ros_planning dependency on Bullet

* Rename PR2-related collision test files (#1856)
sjahr pushed a commit to sjahr/moveit that referenced this pull request Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaits 2nd review one maintainer approved this request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants