Skip to content

Commit 77c3892

Browse files
committed
clearer error message if joint names do not match joint values
1 parent e5fe755 commit 77c3892

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compas_fab/robots/configuration.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,10 @@ def has_joint_names(self):
358358
def check_joint_names(self):
359359
"""Raises an error if there is not a joint name for every value."""
360360
if not self.has_joint_names:
361-
raise ValueError('Joint names are required for this operation.')
361+
if not len(self.joint_names):
362+
raise ValueError('Joint names are required for this operation.')
363+
else:
364+
raise ValueError('Joint names do not match the number of joint values. Joint names={}, Joint values={}'.format(len(self.values), len(self.joint_names)))
362365

363366
@property
364367
def joint_dict(self):

0 commit comments

Comments
 (0)