diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8baec81f..a77b95c3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ jobs: name: Ubuntu Jammy CI steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compile and test id: ci uses: gazebo-tooling/action-gz-ci@jammy diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml index 2c94852da..2332244bf 100644 --- a/.github/workflows/triage.yml +++ b/.github/workflows/triage.yml @@ -14,4 +14,3 @@ jobs: with: project-url: https://github.com/orgs/gazebosim/projects/7 github-token: ${{ secrets.TRIAGE_TOKEN }} - diff --git a/Changelog.md b/Changelog.md index 165497ca6..0b80efede 100644 --- a/Changelog.md +++ b/Changelog.md @@ -658,6 +658,19 @@ ## Gazebo Physics 2.x +### Gazebo Physics 2.6.2 (2024-01-05) + +1. dartsim: fix handling inertia matrix pose rotation + * [Pull request #351](https://github.com/gazebosim/gz-physics/pull/351) + +1. Fix a crash due to an invalid pointer + * [Pull request #486](https://github.com/gazebosim/gz-physics/pull/486) + +1. Infrastructure + * [Pull request #488](https://github.com/gazebosim/gz-physics/pull/488) + * [Pull request #487](https://github.com/gazebosim/gz-physics/pull/487) + * [Pull request #572](https://github.com/gazebosim/gz-physics/pull/572) + ### Gazebo Physics 2.6.1 (2023-01-09) 1. Fix build errors and warnings for DART 6.13.0 diff --git a/bullet-featherstone/src/SDFFeatures.cc b/bullet-featherstone/src/SDFFeatures.cc index 01854690e..da528ae35 100644 --- a/bullet-featherstone/src/SDFFeatures.cc +++ b/bullet-featherstone/src/SDFFeatures.cc @@ -794,7 +794,7 @@ bool SDFFeatures::AddSdfCollision( double mu = 1.0; double mu2 = 1.0; double restitution = 0.0; - + double torsionalCoefficient = 1.0; double rollingFriction = 0.0; if (const auto *surface = _collision.Surface()) { @@ -802,27 +802,32 @@ bool SDFFeatures::AddSdfCollision( { if (const auto frictionElement = friction->Element()) { - if (const auto bullet = frictionElement->GetElement("bullet")) + if (const auto bullet = frictionElement->FindElement("bullet")) { - if (const auto f1 = bullet->GetElement("friction")) + if (const auto f1 = bullet->FindElement("friction")) mu = f1->Get(); - if (const auto f2 = bullet->GetElement("friction2")) + if (const auto f2 = bullet->FindElement("friction2")) mu2 = f2->Get(); // What is fdir1 for in the SDF's spec? - if (const auto rolling = bullet->GetElement("rolling_friction")) + if (const auto rolling = bullet->FindElement("rolling_friction")) rollingFriction = rolling->Get(); } + if (const auto torsional = frictionElement->FindElement("torsional")) + { + if (const auto coefficient = torsional->FindElement("coefficient")) + torsionalCoefficient = coefficient->Get(); + } } } if (const auto surfaceElement = surface->Element()) { - if (const auto bounce = surfaceElement->GetElement("bounce")) + if (const auto bounce = surfaceElement->FindElement("bounce")) { - if (const auto r = bounce->GetElement("restitution_coefficient")) + if (const auto r = bounce->FindElement("restitution_coefficient")) restitution = r->Get(); } } @@ -873,6 +878,8 @@ bool SDFFeatures::AddSdfCollision( linkInfo->collider->setRestitution(static_cast(restitution)); linkInfo->collider->setRollingFriction( static_cast(rollingFriction)); + linkInfo->collider->setSpinningFriction( + static_cast(torsionalCoefficient)); linkInfo->collider->setFriction(static_cast(mu)); linkInfo->collider->setAnisotropicFriction( btVector3(static_cast(mu), static_cast(mu2), 1), diff --git a/test/common_test/CMakeLists.txt b/test/common_test/CMakeLists.txt index 8b702f2a0..b8421b48e 100644 --- a/test/common_test/CMakeLists.txt +++ b/test/common_test/CMakeLists.txt @@ -48,6 +48,10 @@ endfunction() set(GZ_PHYSICS_RESOURCE_DIR "${CMAKE_SOURCE_DIR}/resources") +# Get bullet version using pkg_check_modules as it is not available +# through the cmake module +gz_pkg_check_modules_quiet(bullet_version_check "bullet") + foreach(test ${tests}) set(test_executable "${TEST_TYPE}_${test}") add_executable(${test_executable} ${test}.cc) @@ -68,6 +72,12 @@ foreach(test ${tests}) "GZ_PHYSICS_RESOURCE_DIR=\"${GZ_PHYSICS_RESOURCE_DIR}\"" ) + if (bullet_version_check_VERSION VERSION_LESS_EQUAL 3.25) + target_compile_definitions(${test_executable} PRIVATE + "BT_BULLET_VERSION_LE_325" + ) + endif() + if (DART_HAS_CONTACT_SURFACE_HEADER) target_compile_definitions(${test_executable} PRIVATE DART_HAS_CONTACT_SURFACE) endif() diff --git a/test/common_test/joint_transmitted_wrench_features.cc b/test/common_test/joint_transmitted_wrench_features.cc index 8d1563b2d..21fb52576 100644 --- a/test/common_test/joint_transmitted_wrench_features.cc +++ b/test/common_test/joint_transmitted_wrench_features.cc @@ -17,7 +17,6 @@ #include #include -#include #include #include @@ -225,12 +224,10 @@ TYPED_TEST(JointTransmittedWrenchFixture, PendulumAtZeroAngle) TYPED_TEST(JointTransmittedWrenchFixture, PendulumInMotion) { // This test requires https://github.com/bulletphysics/bullet3/pull/4462 - // When removing this check, also remove - // `#include ` at the top of this file, and - // `include_directories(${BULLET_INCLUDE_DIRS})` from - // test/common_test/CMakeLists.txt - if (this->engineName == "bullet-featherstone" && btGetVersion() <= 325) +#ifdef BT_BULLET_VERSION_LE_325 + if (this->engineName == "bullet-featherstone") GTEST_SKIP(); +#endif // Start pendulum at 90° (parallel to the ground) and stop at about 40° // so that we have non-trivial test expectations. @@ -418,12 +415,10 @@ TYPED_TEST(JointTransmittedWrenchFixture, JointLosses) TYPED_TEST(JointTransmittedWrenchFixture, ContactForces) { // This test requires https://github.com/bulletphysics/bullet3/pull/4462 - // When removing this check, also remove - // `#include ` at the top of this file, and - // `include_directories(${BULLET_INCLUDE_DIRS})` from - // test/common_test/CMakeLists.txt - if (this->engineName == "bullet-featherstone" && btGetVersion() <= 325) +#if BT_BULLET_VERSION_LE_325 + if (this->engineName == "bullet-featherstone") GTEST_SKIP(); +#endif auto box = this->world->GetModel("box"); ASSERT_NE(nullptr, box);