Control: tags -1 fixed-upstream patch Hi,
On 20.07.2015 13:45, Markus Koschany wrote: > gazebo fails to build from source with the latest version of Bullet, > 2.83.5. Please update your package. This is fixed upstream [1][2]. Attached is a patch for the debian package. > I am sorry for the short notice of this bug report because I became > only recently aware of gazebo being a new reverse dependency of > Bullet. The upload to unstable happened in May but the package passed > the NEW queue only yesterday. Preparing library transitions in experimental avoids such problems. Best regards, Andreas 1: https://bitbucket.org/osrf/gazebo/commits/53bd6fdb10e57d8a70353dd02a48e2ff8a8c7f4b 2: https://bitbucket.org/osrf/gazebo/commits/893065d361d16cd39dfe25716408e36543272e24
--- /dev/null +++ b/debian/patches/0010-backport-bullet-fix.patch @@ -0,0 +1,114 @@ +Description: Use btHingeAccumulatedAngleConstraint if bullet 2.83 or greater is available +Author: Steve Peters <scpet...@osrfoundation.org> +Origin: https://bitbucket.org/osrf/gazebo/commits/53bd6fdb10e57d8a70353dd02a48e2ff8a8c7f4b + +diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake +--- a/cmake/SearchForStuff.cmake ++++ b/cmake/SearchForStuff.cmake +@@ -379,6 +379,10 @@ + add_definitions( -DLIBBULLET_VERSION=0.0 ) + BUILD_WARNING ("Bullet > 2.82 not found, for bullet physics engine option, please install libbullet2.82-dev.") + endif() ++ ++ if (BULLET_VERSION VERSION_GREATER 2.82) ++ add_definitions( -DLIBBULLET_VERSION_GT_282 ) ++ endif() + + else (PKG_CONFIG_FOUND) + set (BUILD_GAZEBO OFF CACHE INTERNAL "Build Gazebo" FORCE) +diff --git a/gazebo/physics/bullet/BulletHingeJoint.cc b/gazebo/physics/bullet/BulletHingeJoint.cc +--- a/gazebo/physics/bullet/BulletHingeJoint.cc ++++ b/gazebo/physics/bullet/BulletHingeJoint.cc +@@ -104,7 +104,11 @@ + // If both links exist, then create a joint between the two links. + if (bulletChildLink && bulletParentLink) + { ++#ifdef LIBBULLET_VERSION_GT_282 ++ this->bulletHinge = new btHingeAccumulatedAngleConstraint( ++#else + this->bulletHinge = new btHingeConstraint( ++#endif + *(bulletChildLink->GetBulletLink()), + *(bulletParentLink->GetBulletLink()), + BulletTypes::ConvertVector3(pivotChild), +@@ -116,7 +120,11 @@ + // and the world. + else if (bulletChildLink) + { ++#ifdef LIBBULLET_VERSION_GT_282 ++ this->bulletHinge = new btHingeAccumulatedAngleConstraint( ++#else + this->bulletHinge = new btHingeConstraint( ++#endif + *(bulletChildLink->GetBulletLink()), + BulletTypes::ConvertVector3(pivotChild), + BulletTypes::ConvertVector3(axisChild)); +@@ -125,7 +133,11 @@ + // and the world. + else if (bulletParentLink) + { ++#ifdef LIBBULLET_VERSION_GT_282 ++ this->bulletHinge = new btHingeAccumulatedAngleConstraint( ++#else + this->bulletHinge = new btHingeConstraint( ++#endif + *(bulletParentLink->GetBulletLink()), + BulletTypes::ConvertVector3(pivotParent), + BulletTypes::ConvertVector3(axisParent)); +@@ -209,7 +221,18 @@ + { + math::Angle result; + if (this->bulletHinge) +- result = this->bulletHinge->getHingeAngle() - this->angleOffset; ++ { ++#ifdef LIBBULLET_VERSION_GT_282 ++ btHingeAccumulatedAngleConstraint* hinge = ++ static_cast<btHingeAccumulatedAngleConstraint*>(this->bulletHinge); ++ if (hinge) ++ result = hinge->getAccumulatedHingeAngle(); ++ else ++#else ++ result = this->bulletHinge->getHingeAngle(); ++#endif ++ result -= this->angleOffset; ++ } + return result; + } + +diff --git a/test/integration/joint_revolute.cc b/test/integration/joint_revolute.cc +--- a/test/integration/joint_revolute.cc ++++ b/test/integration/joint_revolute.cc +@@ -16,6 +16,7 @@ + */ + + #include "ServerFixture.hh" ++#include "gazebo/gazebo_config.h" + #include "gazebo/physics/physics.hh" + #include "SimplePendulumIntegrator.hh" + #include "helper_physics_generator.hh" +@@ -99,12 +100,15 @@ + //////////////////////////////////////////////////////////// + void JointTestRevolute::WrapAngle(const std::string &_physicsEngine) + { +- /// \TODO: bullet hinge angles are wrapped (#1074) ++#ifndef LIBBULLET_VERSION_GT_282 ++ /// bullet hinge angles are wrapped for 2.82 and less + if (_physicsEngine == "bullet") + { +- gzerr << "Aborting test for bullet, see issues #1074.\n"; ++ gzerr << "Aborting test for bullet, angle wrapping requires bullet 2.83" ++ << std::endl; + return; + } ++#endif + + // Load an empty world + Load("worlds/empty.world", true, _physicsEngine); +@@ -127,6 +131,7 @@ + ASSERT_TRUE(joint != NULL); + + // set velocity to 2 pi rad/s and step forward 1.5 seconds. ++ // angle should reach 3 pi rad. + double vel = 2*M_PI; + unsigned int stepSize = 50; + unsigned int stepCount = 30; --- /dev/null +++ b/debian/patches/0011-backport-bullet-fix2.patch @@ -0,0 +1,37 @@ +Description: Fix build when compiled against bullet 2.83 +Author: Steve Peters <scpet...@osrfoundation.org> +Origin: https://bitbucket.org/osrf/gazebo/commits/893065d361d16cd39dfe25716408e36543272e24 + +diff --git a/gazebo/physics/bullet/BulletHinge2Joint.cc b/gazebo/physics/bullet/BulletHinge2Joint.cc +--- a/gazebo/physics/bullet/BulletHinge2Joint.cc ++++ b/gazebo/physics/bullet/BulletHinge2Joint.cc +@@ -211,8 +211,12 @@ + return math::Angle(); + } + +- btRotationalLimitMotor *motor = +- this->bulletHinge2->getRotationalLimitMotor(_index); ++#ifndef LIBBULLET_VERSION_GT_282 ++ btRotationalLimitMotor ++#else ++ btRotationalLimitMotor2 ++#endif ++ *motor = this->bulletHinge2->getRotationalLimitMotor(_index); + if (motor) + return motor->m_hiLimit; + +@@ -229,8 +233,12 @@ + return math::Angle(0.0); + } + +- btRotationalLimitMotor *motor = +- this->bulletHinge2->getRotationalLimitMotor(_index); ++#ifndef LIBBULLET_VERSION_GT_282 ++ btRotationalLimitMotor ++#else ++ btRotationalLimitMotor2 ++#endif ++ *motor = this->bulletHinge2->getRotationalLimitMotor(_index); + if (motor) + return motor->m_loLimit; + --- a/debian/patches/series +++ b/debian/patches/series @@ -6,3 +6,5 @@ 0006-remove-maiden-font.patch 0008-arial-font-removed-in-dfsg.patch 0009-backport-model-path-fix.patch +0010-backport-bullet-fix.patch +0011-backport-bullet-fix2.patch
-- debian-science-maintainers mailing list debian-science-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-science-maintainers