Skip to content
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

Merge 6 ➡️ 7 #592

Merged
merged 14 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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"))

Check warning on line 807 in bullet-featherstone/src/SDFFeatures.cc

View check run for this annotation

Codecov / codecov/patch

bullet-featherstone/src/SDFFeatures.cc#L807

Added line #L807 was not covered by tests
mu = f1->Get<double>();

if (const auto f2 = bullet->GetElement("friction2"))
if (const auto f2 = bullet->FindElement("friction2"))

Check warning on line 810 in bullet-featherstone/src/SDFFeatures.cc

View check run for this annotation

Codecov / codecov/patch

bullet-featherstone/src/SDFFeatures.cc#L810

Added line #L810 was not covered by tests
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"))

Check warning on line 815 in bullet-featherstone/src/SDFFeatures.cc

View check run for this annotation

Codecov / codecov/patch

bullet-featherstone/src/SDFFeatures.cc#L815

Added line #L815 was not covered by tests
rollingFriction = rolling->Get<double>();
}
if (const auto torsional = frictionElement->FindElement("torsional"))
{
if (const auto coefficient = torsional->FindElement("coefficient"))
torsionalCoefficient = coefficient->Get<double>();

Check warning on line 821 in bullet-featherstone/src/SDFFeatures.cc

View check run for this annotation

Codecov / codecov/patch

bullet-featherstone/src/SDFFeatures.cc#L820-L821

Added lines #L820 - L821 were not covered by tests
}
}
}

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 @@
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
Loading