Skip to content

Commit 9ddef9a

Browse files
committed
Raise error if group config don't match expected length
1 parent f1d90f0 commit 9ddef9a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/compas_fab/robots/robot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,16 @@ def merge_group_with_full_configuration(self, group_configuration, full_configur
492492
A full configuration: with values for all configurable joints.
493493
"""
494494
all_joint_names = self.get_configurable_joint_names()
495+
495496
if len(all_joint_names) != len(full_configuration.values):
496497
raise ValueError("Please pass a full configuration with %d values" % len(all_joint_names))
497498
elif len(all_joint_names) == len(group_configuration.values): # group config == full config
498499
return group_configuration
499500
else:
500501
group_joint_names = self.get_configurable_joint_names(group)
502+
if len(group_joint_names) != len(group_configuration.values):
503+
raise ValueError('Please pass a group configuration with {} values'.format(len(group_joint_names)))
504+
501505
configuration = full_configuration.copy()
502506
for i, name in enumerate(all_joint_names):
503507
if name in group_joint_names:

0 commit comments

Comments
 (0)