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

2 ➡️ 3 #269

Merged
merged 2 commits into from
Jun 22, 2021
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 dartsim/src/SDFFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ Identity SDFFeatures::ConstructSdfCollision(
}
if (odeFriction->HasElement("slip1"))
{
aspect->setSlipCompliance(odeFriction->Get<double>("slip1"));
aspect->setPrimarySlipCompliance(odeFriction->Get<double>("slip1"));
}
if (odeFriction->HasElement("slip2"))
{
Expand Down
4 changes: 2 additions & 2 deletions dartsim/src/ShapeFeatures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ double ShapeFeatures::GetShapeFrictionPyramidPrimarySlipCompliance(
<< std::endl;
return 0.0;
}
return aspect->getSlipCompliance();
return aspect->getPrimarySlipCompliance();
}

/////////////////////////////////////////////////
Expand Down Expand Up @@ -383,7 +383,7 @@ bool ShapeFeatures::SetShapeFrictionPyramidPrimarySlipCompliance(
<< std::endl;
return false;
}
aspect->setSlipCompliance(_value);
aspect->setPrimarySlipCompliance(_value);
return true;
}

Expand Down
9 changes: 9 additions & 0 deletions dartsim/src/ShapeFeatures_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down