Skip to content

Commit 44df393

Browse files
authored
Merge pull request #2715 from JafarAbdi/fix_has_configuration_limit_mimic
Fix hasConfigurationLimit() for mimic joints to return empty vector
2 parents 790f997 + c6e7d80 commit 44df393

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
1010
- Check row dimensions of input Jacobians when computing kinematics Jacobian ([#2684](https://github.com/stack-of-tasks/pinocchio/pull/2684))
1111
- Fix case joint_id == 0 in getJointKinematicHessian ([#2705](https://github.com/stack-of-tasks/pinocchio/pull/2705))
1212
- Fix nvSubtree computation in case a mimic joint is the last joint in the branch ([#2707](https://github.com/stack-of-tasks/pinocchio/pull/2707))
13+
- Fix `JointModelMimic::hasConfigurationLimit()` to return empty vector instead of delegating to mimicking joint ([#2715](https://github.com/stack-of-tasks/pinocchio/pull/2715))
1314

1415
### Changed
1516
- Disable coal/hpp-fcl warnings when building Pinocchio ([#2686](https://github.com/stack-of-tasks/pinocchio/pull/2686))

include/pinocchio/multibody/joint/joint-mimic.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,12 +681,12 @@ namespace pinocchio
681681

682682
const std::vector<bool> hasConfigurationLimit() const
683683
{
684-
return m_jmodel_mimicking.hasConfigurationLimit();
684+
return {};
685685
}
686686

687687
const std::vector<bool> hasConfigurationLimitInTangent() const
688688
{
689-
return m_jmodel_mimicking.hasConfigurationLimitInTangent();
689+
return {};
690690
}
691691

692692
template<typename ConfigVector>

unittest/model.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,4 +1057,21 @@ BOOST_AUTO_TEST_CASE(test_mimicked_mimicking_vectors)
10571057
}
10581058
}
10591059

1060+
BOOST_AUTO_TEST_CASE(test_has_configuration_limit_mimic)
1061+
{
1062+
Model model;
1063+
// j1 -- j2
1064+
// -- j3
1065+
// with j3 mimicking j2
1066+
model.addJoint(0, JointModelRX(), SE3::Identity(), "j1");
1067+
model.addJoint(1, JointModelRX(), SE3::Identity(), "j2");
1068+
model.addJoint(
1069+
2, JointModelMimic(JointModelRX(), model.joints[1], 1., 0.), SE3::Identity(), "j3");
1070+
1071+
BOOST_CHECK_EQUAL(model.lowerPositionLimit.size(), 2);
1072+
BOOST_CHECK_EQUAL(model.upperPositionLimit.size(), 2);
1073+
BOOST_CHECK_EQUAL(model.hasConfigurationLimit().size(), 2);
1074+
BOOST_CHECK_EQUAL(model.hasConfigurationLimitInTangent().size(), 2);
1075+
}
1076+
10601077
BOOST_AUTO_TEST_SUITE_END()

0 commit comments

Comments
 (0)