Skip to content

Commit 52e13ec

Browse files
committed
mimic joints are not configurable
1 parent 204b39e commit 52e13ec

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212

1313
### Changed
1414

15+
* Fixed bug where mimic joints were considered configurable.
16+
1517
### Removed
1618

1719

src/compas/robots/model/joint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ def calculate_transformation(self, position):
835835

836836
def is_configurable(self):
837837
"""Returns ``True`` if the joint can be configured, otherwise ``False``."""
838-
return self.type != Joint.FIXED
838+
return self.type != Joint.FIXED and self.mimic is None
839839

840840
def is_scalable(self):
841841
"""Returns ``True`` if the joint can be scaled, otherwise ``False``."""

tests/compas/robots/test_model.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,21 @@ def test_unknown_axis_attribute_data(urdf_with_unknown_attr):
604604
assert r.joints[0].axis.attr['rpy'] == '0 0 0'
605605

606606

607+
def test_get_configurable_joints(urdf_file):
608+
model = RobotModel.from_urdf_file(urdf_file)
609+
expected_joints = [
610+
'panda_joint1',
611+
'panda_joint2',
612+
'panda_joint3',
613+
'panda_joint4',
614+
'panda_joint5',
615+
'panda_joint6',
616+
'panda_joint7',
617+
'panda_finger_joint1',
618+
]
619+
assert model.get_configurable_joint_names() == expected_joints
620+
621+
607622
def test_ensure_geometry(urdf_file, urdf_file_with_shapes_only):
608623
robot = RobotModel.from_urdf_file(urdf_file)
609624
with pytest.raises(Exception):

0 commit comments

Comments
 (0)