Skip to content

Commit 168cdc3

Browse files
authored
Merge pull request #771 from compas-dev/mimic_not_config
mimic joints are not configurable
2 parents 204b39e + 8774b3f commit 168cdc3

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,11 @@ 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_joint_names(urdf_file):
608+
model = RobotModel.from_urdf_file(urdf_file)
609+
assert 'panda_finger_joint2' not in model.get_configurable_joint_names()
610+
611+
607612
def test_ensure_geometry(urdf_file, urdf_file_with_shapes_only):
608613
robot = RobotModel.from_urdf_file(urdf_file)
609614
with pytest.raises(Exception):

0 commit comments

Comments
 (0)