diff options
author | Benjamin Chrétien | 2015-07-01 12:53:31 +0900 |
---|---|---|
committer | Benjamin Chrétien | 2015-07-01 12:54:22 +0900 |
commit | 8bf19153ea4814e8950b33a13394fb0848bc677a (patch) | |
tree | 734c96805495b8712143e30ae16dceb044269d51 | |
parent | 9306355666329b86c2cb7a8f9f4ee0a11424b378 (diff) | |
download | aur-8bf19153ea4814e8950b33a13394fb0848bc677a.tar.gz |
Apply patches for Boost and Bullet
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 21 | ||||
-rw-r--r-- | boost1.58.patch | 24 | ||||
-rw-r--r-- | bullet2.83.patch | 164 |
4 files changed, 211 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = gazebo pkgdesc = A multi-robot simulator for outdoor environments pkgver = 5.0.1 - pkgrel = 3 + pkgrel = 4 url = http://gazebosim.org/ install = gazebo.install arch = i686 @@ -34,7 +34,11 @@ pkgbase = gazebo optdepends = simbody>=3.3: Simbody support optdepends = urdfdom: Load URDF files source = http://osrf-distributions.s3.amazonaws.com/gazebo/releases/gazebo-5.0.1.tar.bz2 + source = boost1.58.patch + source = bullet2.83.patch sha256sums = 81773edbf709359f4191ff33b6b2e6adf395a88806022c8cfa964963e5c7099b + sha256sums = e4bf17b4e0fbe3094a17af108e4e08627b169890b365737b42a80456c17d7bad + sha256sums = 7e82c241e1179348e9040bdf87232fb655c492597d4efcb87a6c886a77fa0567 pkgname = gazebo @@ -4,7 +4,7 @@ pkgname=gazebo pkgver=5.0.1 -pkgrel=3 +pkgrel=4 pkgdesc="A multi-robot simulator for outdoor environments" arch=('i686' 'x86_64') url="http://gazebosim.org/" @@ -25,26 +25,41 @@ optdepends=('bullet>=2.82: Bullet support' 'urdfdom: Load URDF files') makedepends=('cmake' 'doxygen' 'pkg-config>=0.26') install="${pkgname}.install" -source=(http://osrf-distributions.s3.amazonaws.com/gazebo/releases/${pkgname}-${pkgver}.tar.bz2) -sha256sums=('81773edbf709359f4191ff33b6b2e6adf395a88806022c8cfa964963e5c7099b') +source=("http://osrf-distributions.s3.amazonaws.com/gazebo/releases/${pkgname}-${pkgver}.tar.bz2" + "boost1.58.patch" + "bullet2.83.patch") +sha256sums=('81773edbf709359f4191ff33b6b2e6adf395a88806022c8cfa964963e5c7099b' + 'e4bf17b4e0fbe3094a17af108e4e08627b169890b365737b42a80456c17d7bad' + '7e82c241e1179348e9040bdf87232fb655c492597d4efcb87a6c886a77fa0567') build() { cd "${srcdir}/${pkgname}-${pkgver}" # Fix gdal includes + msg "Applying gdal includes fix..." find . -type f -exec sed -i 's|include <gdal/|include <|g' {} \; + # Apply Boost 1.58 patch (fixed upstream) + msg "Applying Boost 1.58 patch..." + patch -p1 < ${srcdir}/boost1.58.patch + + # Apply Bullet 2.83 patch (fixed upstream) + msg "Applying Bullet 2.83 patch..." + patch -p1 < ${srcdir}/bullet2.83.patch + # Create build directory mkdir -p build && cd build # Run CMake # Note: we skip unit tests (else set to TRUE) + msg "Preparing Makefiles..." cmake .. -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_INSTALL_PREFIX="/usr" \ -DCMAKE_INSTALL_LIBDIR="lib" \ -DENABLE_TESTS_COMPILATION:BOOL=False # Compile Gazebo + msg "Compiling..." make } diff --git a/boost1.58.patch b/boost1.58.patch new file mode 100644 index 000000000000..eaf667e227d4 --- /dev/null +++ b/boost1.58.patch @@ -0,0 +1,24 @@ +diff --git a/gazebo/gui/TimePanel.cc b/gazebo/gui/TimePanel.cc +--- a/gazebo/gui/TimePanel.cc ++++ b/gazebo/gui/TimePanel.cc +@@ -178,7 +178,7 @@ + } + + ///////////////////////////////////////////////// +-void TimePanel::OnFullScreen(bool & /*_value*/) ++void TimePanel::OnFullScreen(bool /*_value*/) + { + /*if (_value) + this->hide(); +diff --git a/gazebo/gui/TimePanel.hh b/gazebo/gui/TimePanel.hh +--- a/gazebo/gui/TimePanel.hh ++++ b/gazebo/gui/TimePanel.hh +@@ -66,7 +66,7 @@ + /// \brief Called when the GUI enters/leaves full-screen mode. + /// \param[in] _value True when entering full screen, false when + /// leaving. +- private: void OnFullScreen(bool &_value); ++ private: void OnFullScreen(bool _value); + + /// \brief Called when a world stats message is received. + /// \param[in] _msg World statistics message. diff --git a/bullet2.83.patch b/bullet2.83.patch new file mode 100644 index 000000000000..b3f4ea70f823 --- /dev/null +++ b/bullet2.83.patch @@ -0,0 +1,164 @@ +diff -r 59fe735eb3442e86d6277dfbd984103939405dca -r 48cbb03cc128623f8c1aaad8746bf8bf5f08b1f9 cmake/SearchForStuff.cmake +--- a/cmake/SearchForStuff.cmake ++++ b/cmake/SearchForStuff.cmake +@@ -122,7 +122,7 @@ + set(SimTK_INSTALL_DIR ${SimTK_INSTALL_PREFIX}) + #list(APPEND CMAKE_MODULE_PATH ${SimTK_INSTALL_PREFIX}/share/cmake) + find_package(Simbody) +- if (SIMBODY_FOUND) ++ if (Simbody_FOUND) + set (HAVE_SIMBODY TRUE) + else() + BUILD_WARNING ("Simbody not found, for simbody physics engine option, please install libsimbody-dev.") +@@ -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 -r 59fe735eb3442e86d6277dfbd984103939405dca -r 48cbb03cc128623f8c1aaad8746bf8bf5f08b1f9 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 *motor; ++#else ++ btRotationalLimitMotor2 *motor; ++#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 *motor; ++#else ++ btRotationalLimitMotor2 *motor; ++#endif ++ motor = this->bulletHinge2->getRotationalLimitMotor(_index); + if (motor) + return motor->m_loLimit; + +diff -r 59fe735eb3442e86d6277dfbd984103939405dca -r 48cbb03cc128623f8c1aaad8746bf8bf5f08b1f9 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)); +@@ -148,7 +160,7 @@ + + // Set angleOffset based on hinge angle at joint creation. + // GetAngleImpl will report angles relative to this offset. +- this->angleOffset = this->bulletHinge->getHingeAngle(); ++ this->angleOffset = this->GetAngleImpl(0).Radian(); + + // Apply joint angle limits here. + // TODO: velocity and effort limits. +@@ -209,7 +221,21 @@ + { + 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 ++#endif ++ { ++ result = this->bulletHinge->getHingeAngle(); ++ } ++ result -= this->angleOffset; ++ } + return result; + } + +diff -r 59fe735eb3442e86d6277dfbd984103939405dca -r 48cbb03cc128623f8c1aaad8746bf8bf5f08b1f9 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; |