diff --git a/dartsim/src/JointFeatures.cc b/dartsim/src/JointFeatures.cc index c4f4e2bcb..0a60f5ff4 100644 --- a/dartsim/src/JointFeatures.cc +++ b/dartsim/src/JointFeatures.cc @@ -200,7 +200,11 @@ void JointFeatures::SetJointMinPosition( << "]. The command will be ignored\n"; return; } +#if DART_VERSION_AT_LEAST(6, 10, 0) joint->setLimitEnforcement(true); +#else + joint->setPositionLimitEnforced(true); +#endif // We do not check min/max mismatch, we leave that to DART. joint->setPositionLowerLimit(_dof, _value); } @@ -221,7 +225,11 @@ void JointFeatures::SetJointMaxPosition( << "]. The command will be ignored\n"; return; } +#if DART_VERSION_AT_LEAST(6, 10, 0) joint->setLimitEnforcement(true); +#else + joint->setPositionLimitEnforced(true); +#endif // We do not check min/max mismatch, we leave that to DART. joint->setPositionUpperLimit(_dof, _value); } @@ -242,7 +250,11 @@ void JointFeatures::SetJointMinVelocity( << "]. The command will be ignored\n"; return; } +#if DART_VERSION_AT_LEAST(6, 10, 0) joint->setLimitEnforcement(true); +#else + joint->setPositionLimitEnforced(true); +#endif // We do not check min/max mismatch, we leave that to DART. joint->setVelocityLowerLimit(_dof, _value); } @@ -263,7 +275,11 @@ void JointFeatures::SetJointMaxVelocity( << "]. The command will be ignored\n"; return; } +#if DART_VERSION_AT_LEAST(6, 10, 0) joint->setLimitEnforcement(true); +#else + joint->setPositionLimitEnforced(true); +#endif // We do not check min/max mismatch, we leave that to DART. joint->setVelocityUpperLimit(_dof, _value); } diff --git a/dartsim/src/JointFeatures_TEST.cc b/dartsim/src/JointFeatures_TEST.cc index e7e368844..d8ff7d7de 100644 --- a/dartsim/src/JointFeatures_TEST.cc +++ b/dartsim/src/JointFeatures_TEST.cc @@ -230,6 +230,7 @@ TEST_F(JointFeaturesFixture, JointSetPositionLimitsWithForceControl) EXPECT_LT(pos + 0.5, joint->GetPosition(0)); } +#if DART_VERSION_AT_LEAST(6, 10, 0) TEST_F(JointFeaturesFixture, JointSetVelocityLimitsWithForceControl) { sdf::Root root; @@ -632,6 +633,7 @@ TEST_F(JointFeaturesFixture, JointSetCombinedLimitsWithVelocityControl) } EXPECT_NEAR(-0.5, joint->GetVelocity(0), 1e-6); } +#endif // Test detaching joints. TEST_F(JointFeaturesFixture, JointDetach)