-
Notifications
You must be signed in to change notification settings - Fork 285
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
Support for Bullet built with double precision #660
Support for Bullet built with double precision #660
Conversation
Bullet requires a pre-processor variable to be set before including any headers to determine whether the library was built with single or double precision. Failing to do so may result in a linking error. This commit: 1. Forces CMake to use CONFIG mode (BulletConfig.cmake shipped with bullet) instead of MODULE mode (FindBullet.cmake shipped with CMake by default) in find_package(Bullet). 2. Updates references to BULLET_INCLUDE_DIRS and BULLET_LIBRARIES accordingly 3. Test whether Bullet was built using double precision floating point numbers by attempting to compile code that produces a linking error when the necessary preprocessor definition is missing. 4. Set the necessary preprocessor definition in config.h.
Just for clarification, I'm pretty sure that bullet is single precision by default. The upstream option for It will use double precision if you install gazebo and bullet is not yet installed: |
@scpeters you are likely right that Bullet got installed through Gazebo. I recently used Mike Purvis' installation script to reinstall ROS, which does install Gazebo by default. In any case, I see no reason why DART shouldn't work when Bullet is compiled with double precision. 😄 |
Absolutely it should be able to use whichever version of bullet is available. I think we get around it in gazebo because the |
Yeah, using I made minor update for the cmake output for consistency. Looks good to me. 👍 |
I just ran into this same problem while compiling gazebo with dart 5.1; is it possible to backport this fix to |
Sure, I'll create an issue for that. |
Bullet requires a pre-processor variable to be set before including any headers to determine whether the library was built with single or double precision. Failing to do so may result in a linking error. This commit: 1. Forces CMake to use CONFIG mode (BulletConfig.cmake shipped with bullet) instead of MODULE mode (FindBullet.cmake shipped with CMake by default) in find_package(Bullet). 2. Updates references to BULLET_INCLUDE_DIRS and BULLET_LIBRARIES accordingly 3. Test whether Bullet was built using double precision floating point numbers by attempting to compile code that produces a linking error when the necessary preprocessor definition is missing. 4. Set the necessary preprocessor definition in config.h. combined with commits that Reverted to using Bullet MODULE mode. and Minor output message update for consistency Backport of #660 to release-5.1 branch. Closes #776.
Support for Bullet built with double precision (backport #660)
Bullet requires a pre-processor variable to be set before including any headers to determine whether the library was built with single or double precision. Failing to do so may result in a linking error.
This commit:
BulletConfig.cmake
shipped with Bullet) instead of MODULE mode (FindBullet.cmake
shipped with CMake by default) in find_package(Bullet).BULLET_INCLUDE_DIRS
andBULLET_LIBRARIES
accordinglyconfig.h
.This fixes #657: it turns out that Homebrew builds Bullet with double point precision by default.