From 6774545c73023d1d782fbe96abd3fcb65fce1b96 Mon Sep 17 00:00:00 2001 From: Simon Le Goff <32677536+simheo@users.noreply.github.com> Date: Tue, 19 Dec 2023 16:57:19 +0100 Subject: [PATCH] Raise error if joints goals list for goto_joints does not have the right size. --- src/reachy2_sdk/arm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/reachy2_sdk/arm.py b/src/reachy2_sdk/arm.py index 3a4e2d7e..889322c3 100644 --- a/src/reachy2_sdk/arm.py +++ b/src/reachy2_sdk/arm.py @@ -405,6 +405,9 @@ def goto_joints( Given a list of joint positions (exactly 7 joint positions), it will move the arm to that position. """ + if len(positions) != 7: + raise ValueError(f"positions should be length 7 (got {len(positions)} instead)!") + arm_pos = self._list_to_arm_position(positions, degrees) request = GoToRequest( joints_goal=JointsGoal(