diff --git a/dartsim/src/SDFFeatures.cc b/dartsim/src/SDFFeatures.cc index 1a1fc2ed4..27496e992 100644 --- a/dartsim/src/SDFFeatures.cc +++ b/dartsim/src/SDFFeatures.cc @@ -562,7 +562,7 @@ Identity SDFFeatures::ConstructSdfCollision( } if (odeFriction->HasElement("slip1")) { - aspect->setSlipCompliance(odeFriction->Get("slip1")); + aspect->setPrimarySlipCompliance(odeFriction->Get("slip1")); } if (odeFriction->HasElement("slip2")) { diff --git a/dartsim/src/ShapeFeatures.cc b/dartsim/src/ShapeFeatures.cc index 11d042325..6d33a4de2 100644 --- a/dartsim/src/ShapeFeatures.cc +++ b/dartsim/src/ShapeFeatures.cc @@ -347,7 +347,7 @@ double ShapeFeatures::GetShapeFrictionPyramidPrimarySlipCompliance( << std::endl; return 0.0; } - return aspect->getSlipCompliance(); + return aspect->getPrimarySlipCompliance(); } ///////////////////////////////////////////////// @@ -383,7 +383,7 @@ bool ShapeFeatures::SetShapeFrictionPyramidPrimarySlipCompliance( << std::endl; return false; } - aspect->setSlipCompliance(_value); + aspect->setPrimarySlipCompliance(_value); return true; } diff --git a/dartsim/src/ShapeFeatures_TEST.cc b/dartsim/src/ShapeFeatures_TEST.cc index 1617b10a8..c488850c3 100644 --- a/dartsim/src/ShapeFeatures_TEST.cc +++ b/dartsim/src/ShapeFeatures_TEST.cc @@ -70,6 +70,7 @@ using TestFeatureList = ignition::physics::FeatureList< physics::RevoluteJointCast, physics::SetJointVelocityCommandFeature, #if DART_VERSION_AT_LEAST(6, 10, 0) + physics::GetShapeFrictionPyramidSlipCompliance, physics::SetShapeFrictionPyramidSlipCompliance, #endif physics::sdf::ConstructSdfModel, @@ -180,7 +181,11 @@ TEST_F(ShapeFeaturesFixture, PrimarySlipCompliance) const Eigen::Vector3d cmdForce{1, 0, 0}; const double primarySlip = 0.5; + // expect 0.0 initial slip + EXPECT_DOUBLE_EQ(0.0, boxShape->GetPrimarySlipCompliance()); + boxShape->SetPrimarySlipCompliance(primarySlip); + EXPECT_DOUBLE_EQ(primarySlip, boxShape->GetPrimarySlipCompliance()); const std::size_t numSteps = 10000; for (std::size_t i = 0; i < numSteps; ++i) @@ -239,7 +244,11 @@ TEST_F(ShapeFeaturesFixture, SecondarySlipCompliance) const Eigen::Vector3d cmdForce{0, 1, 0}; const double secondarySlip = 0.25; + // expect 0.0 initial slip + EXPECT_DOUBLE_EQ(0.0, boxShape->GetSecondarySlipCompliance()); + boxShape->SetSecondarySlipCompliance(secondarySlip); + EXPECT_DOUBLE_EQ(secondarySlip, boxShape->GetSecondarySlipCompliance()); const std::size_t numSteps = 10000; for (std::size_t i = 0; i < numSteps; ++i)