Skip to content

Commit aa8cd6e

Browse files
author
David Butterworth
committed
Make CheckJointLimits() check if number of joints in the configuration is the same as the number of active DOF.'
1 parent 5d391c1 commit aa8cd6e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/prpy/util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,10 @@ def CheckJointLimits(robot, q):
936936
q_limit_min, q_limit_max = robot.GetActiveDOFLimits()
937937
active_dof_indices = robot.GetActiveDOFIndices()
938938

939+
if len(q) != len(active_dof_indices):
940+
raise ValueError('The number of joints in the configuration q '
941+
'is not equal to the number of active DOF.')
942+
939943
lower_position_violations = (q < q_limit_min)
940944
if lower_position_violations.any():
941945
index = lower_position_violations.nonzero()[0][0]

0 commit comments

Comments
 (0)