diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5534c1d87..fa88665d8 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,4 +1,4 @@ # More info: # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners -* @azeey @mxgrey @scpeters +* @azeey @scpeters diff --git a/dartsim/src/SDFFeatures.cc b/dartsim/src/SDFFeatures.cc index 819aee3f8..d06e2cff2 100644 --- a/dartsim/src/SDFFeatures.cc +++ b/dartsim/src/SDFFeatures.cc @@ -654,6 +654,7 @@ Identity SDFFeatures::ConstructSdfLink( bodyProperties.mInertia.setLocalCOM(localCom); + bodyProperties.mGravityMode = _sdfLink.EnableGravity(); dart::dynamics::FreeJoint::Properties jointProperties; jointProperties.mName = bodyProperties.mName + "_FreeJoint"; diff --git a/test/common_test/world_features.cc b/test/common_test/world_features.cc index e1e68c0f0..f1178df2d 100644 --- a/test/common_test/world_features.cc +++ b/test/common_test/world_features.cc @@ -123,6 +123,12 @@ TEST_F(WorldFeaturesTestGravity, GravityFeatures) auto link = model->GetLink(0); ASSERT_NE(nullptr, link); + auto modelNoGravity = world->GetModel("sphere_no_gravity"); + ASSERT_NE(nullptr, modelNoGravity); + + auto linkNoGravity = modelNoGravity->GetLink(0); + ASSERT_NE(nullptr, linkNoGravity); + AssertVectorApprox vectorPredicate6(1e-6); // initial link pose @@ -175,6 +181,16 @@ TEST_F(WorldFeaturesTestGravity, GravityFeatures) EXPECT_PRED_FORMAT2(vectorPredicate2, Eigen::Vector3d(0.5, 0, 2.5), pos); + + if (this->PhysicsEngineName(name) == "dartsim") + { + // pose for link without gravity should not change + Eigen::Vector3d posNoGravity = linkNoGravity->FrameDataRelativeToWorld() + .pose.translation(); + EXPECT_PRED_FORMAT2(vectorPredicate2, + Eigen::Vector3d(10, 10, 10), + posNoGravity); + } } } } diff --git a/test/common_test/worlds/falling.world b/test/common_test/worlds/falling.world index 1d2ea2f43..1b3e32273 100644 --- a/test/common_test/worlds/falling.world +++ b/test/common_test/worlds/falling.world @@ -71,5 +71,17 @@ + + + false + 10 10 10 0 0 0 + + 1 + + + 1 + + +