Skip to content

Commit

Permalink
Merge pull request #592 from gazebosim/6_to_7
Browse files Browse the repository at this point in the history
Merge 6 ➡️ 7
  • Loading branch information
scpeters authored Jan 26, 2024
2 parents 32bef6d + 97d50cb commit 5f73faf
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ jobs:
with:
project-url: https://github.com/orgs/gazebosim/projects/7
github-token: ${{ secrets.TRIAGE_TOKEN }}

13 changes: 13 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 14 additions & 7 deletions bullet-featherstone/src/SDFFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -794,35 +794,40 @@ 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())
{
if (const auto *friction = surface->Friction())
{
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<double>();

if (const auto f2 = bullet->GetElement("friction2"))
if (const auto f2 = bullet->FindElement("friction2"))
mu2 = f2->Get<double>();

// What is fdir1 for in the SDF's <bullet> spec?

if (const auto rolling = bullet->GetElement("rolling_friction"))
if (const auto rolling = bullet->FindElement("rolling_friction"))
rollingFriction = rolling->Get<double>();
}
if (const auto torsional = frictionElement->FindElement("torsional"))
{
if (const auto coefficient = torsional->FindElement("coefficient"))
torsionalCoefficient = coefficient->Get<double>();
}
}
}

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<double>();
}
}
Expand Down Expand Up @@ -873,6 +878,8 @@ bool SDFFeatures::AddSdfCollision(
linkInfo->collider->setRestitution(static_cast<btScalar>(restitution));
linkInfo->collider->setRollingFriction(
static_cast<btScalar>(rollingFriction));
linkInfo->collider->setSpinningFriction(
static_cast<btScalar>(torsionalCoefficient));
linkInfo->collider->setFriction(static_cast<btScalar>(mu));
linkInfo->collider->setAnisotropicFriction(
btVector3(static_cast<btScalar>(mu), static_cast<btScalar>(mu2), 1),
Expand Down
10 changes: 10 additions & 0 deletions test/common_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
Expand Down
17 changes: 6 additions & 11 deletions test/common_test/joint_transmitted_wrench_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <gtest/gtest.h>

#include <chrono>
#include <LinearMath/btScalar.h>

#include <gz/common/Console.hh>
#include <gz/plugin/Loader.hh>
Expand Down Expand Up @@ -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 <LinearMath/btScalar.h>` 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.
Expand Down Expand Up @@ -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 <LinearMath/btScalar.h>` 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);
Expand Down

0 comments on commit 5f73faf

Please sign in to comment.