-
Notifications
You must be signed in to change notification settings - Fork 491
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
port of bullet collision to ros2 #322
port of bullet collision to ros2 #322
Conversation
I'll take a quick look at this since I've been poking around Bullet lately |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see anything wrong 👍 but haven't tested it
moveit_core/CMakeLists.txt
Outdated
# endif() | ||
find_package(Bullet 2.87) | ||
|
||
# TODO(j-petit): Version check can be dropped when Xenial reaches end-of-life |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're so close to the 16.04 EOL that you could probably drop this (April 2021)
moveit_core/package.xml
Outdated
@@ -28,7 +28,7 @@ | |||
<depend>assimp</depend> | |||
<depend>boost</depend> | |||
<depend>eigen</depend> | |||
<depend>bullet</depend> | |||
<depend>libbullet-dev</depend> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to be available with rosdep, bullet
however is. Were there any issues with the bullet
dependency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think at some point I had an issue when I was building in eloquent but I no longer do in foxy
moveit_core/CMakeLists.txt
Outdated
# endif() | ||
find_package(Bullet 2.87) | ||
|
||
# TODO(j-petit): Version check can be dropped when Xenial reaches end-of-life |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can safely remove this check since bullet is available from Foxy/Focal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean this entire section
set(BULLET_ENABLE "Bullet")
set(BULLET_LIB "moveit_collision_detection_bullet")
set(BULLET_INC "collision_detection_bullet/include")
message(STATUS "Compiling with Bullet")
else()
message(STATUS "Version of Bullet too old or not available: disabling Bullet collision detection plugin. Try using Ubuntu 18.04 or later.")
endif()
?
moveit_core/CMakeLists.txt
Outdated
# else() | ||
# message(STATUS "Version of Bullet too old or not available: disabling Bullet collision detection plugin. Try using Ubuntu 18.04 or later.") | ||
# endif() | ||
find_package(Bullet 2.87) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current version in focal is 2.88 so this should be updated. We could probably also disable the check altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in our meeting we agreed to leave it in this version (2.87). However let me know if you'd prefer I change this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think we can ignore the case that bullet is not available because MoveIt 2 doesn't support systems older than 20.04 and even with 18.04 bullet is available with the right version. Also, rosdep already installs bullet on the system since it's listed in the package.xml. I would simply add a REQUIRED to the find_package()
and remove the BULLET_FOUND
check altogether.
@@ -33,6 +33,9 @@ | |||
|
|||
namespace collision_detection_bullet | |||
{ | |||
|
|||
static const rclcpp::Logger BULLET_LOGGER = rclcpp::get_logger("collision_detection.bullet"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not ideal to put static const instances in header files like this as it will produce logger instances for all compilation units. Better declare the logger and define a single global instance in a cpp file. We are still at C++14 so using extern
would be the best solution for now. With C++17 we should switch to inline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been addressed. I couldn't use extern as I had to declare this global variable in each cpp file that needed it and so having extern would cause a multiple definition build error.
3cbe341
to
c10244d
Compare
@henningkayser I've made the requested change, please review |
12378cd
to
92f66e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me code-wise. Were you already able to test this somehow?
moveit_core/CMakeLists.txt
Outdated
# else() | ||
# message(STATUS "Version of Bullet too old or not available: disabling Bullet collision detection plugin. Try using Ubuntu 18.04 or later.") | ||
# endif() | ||
find_package(Bullet 2.87) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I think we can ignore the case that bullet is not available because MoveIt 2 doesn't support systems older than 20.04 and even with 18.04 bullet is available with the right version. Also, rosdep already installs bullet on the system since it's listed in the package.xml. I would simply add a REQUIRED to the find_package()
and remove the BULLET_FOUND
check altogether.
target_link_libraries(collision_detector_bullet_plugin | ||
${MOVEIT_LIB_NAME} | ||
moveit_planning_scene | ||
) | ||
|
||
install(TARGETS ${MOVEIT_LIB_NAME} collision_detector_bullet_plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The plugin needs to be exported here for symlink support. See https://github.com/ros-planning/moveit2/pull/339/files#diff-049302fd4031b4efb956b186b90e32e634cc629a6a7740c3feb205b805881522
return false; | ||
} | ||
} | ||
bool acmCheck(const std::string& body_1, const std::string& body_2, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that this should be moved to the cpp files. @j-petit could you comment on any potential drawbacks with this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine to move. I simply used the structure which was given in the old tesseract / bullet code.
* POSSIBILITY OF SUCH DAMAGE. | ||
*********************************************************************/ | ||
|
||
/* Author: Jorge Nicho*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also list the original authors of these functions?
I haven't, Is there a unit test or demo program I can run? |
92f66e0
to
5854fec
Compare
@henningkayser I've made the requested changes |
Codecov Report
@@ Coverage Diff @@
## main #322 +/- ##
==========================================
+ Coverage 53.23% 53.23% +0.01%
==========================================
Files 209 209
Lines 18849 18849
==========================================
+ Hits 10032 10033 +1
+ Misses 8817 8816 -1
Continue to review full report at Codecov.
|
Sorry if this is too obvious but take a look at the Bullet tutorial from MoveIt1. Source code here: You should be able to take any MoveIt2 application and switch to Bullet like this, I believe:
|
OK, thanks for providing that link. Looks like I may have to port that example just to test it |
It looks like ament lint is coming back with an error. How do I run this locally? I tried the directions here with the .clang-tidy file in the moveit2 repo but it didn't find any changes to make. |
I don't think you need to do that. Just find an existing example and set it to use Bullet. There must be some unit tests for FCL collisions you could modify? |
This just passed the CI checks |
ce0c6eb
to
45b539c
Compare
f0bcf75
to
bf98396
Compare
@henningkayser looks like merging caused a build error, I just rebased and resolved the conflicts |
Did anyone get to test this? |
@henningkayser I'm trying to test using the bullet collision detector in the run_moveit_cpp demo program but I haven't been able to get it to find Bullet from the exports coming from the moveit_core package. I'm far from being a Cmake wizard so I could use some guidance on this, my branch with the demo can be found here |
* Fix to move_group list and change formatting of references to move_group to be consistent * Run pre-commit Co-authored-by: JafarAbdi <cafer.abdi@gmail.com>
Description
Port of bullet collision module to ROS2
@henningkayser please review