From b18a55f32159f1930840c6a5d25698f954f4f30b Mon Sep 17 00:00:00 2001 From: huxiaoyi-ovo Date: Wed, 21 Oct 2026 04:53:46 -0400 Subject: [PATCH 1/2] docs(ets): demonstrate locking a flipped joint and a robot ETS Co-Authored-By: ChatGPT (OpenAI GPT-6) --- src/roboticstoolbox/ets/ETS.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/roboticstoolbox/ets/ETS.py b/src/roboticstoolbox/ets/ETS.py index 2be215940..2c7f3d2b0 100644 --- a/src/roboticstoolbox/ets/ETS.py +++ b/src/roboticstoolbox/ets/ETS.py @@ -174,6 +174,23 @@ def fixjoint(self, j: int, value: float, unit: str = "rad") -> ETS: :param unit: angular unit for rotational joints, "rad" [default] or "deg" :returns: ETS with one fewer joint :raises ValueError: for an invalid joint position or angular unit + + A flipped joint can be fixed in degrees, without modifying the original + sequence. This also works on the kinematics of a robot: + + .. runblock:: pycon + + >>> from roboticstoolbox import ET, models + >>> ets = ET.Rz(flip=True) * ET.tx(1) * ET.Ry() + >>> fixed = ets.fixjoint(0, 90, unit="deg") + >>> fixed.n, ets.n + (1, 2) + >>> robot = models.ETS.Panda() + >>> reduced = robot.ets().fixjoint(2, 0) + >>> reduced.n == robot.n - 1 + True + + .. versionadded:: 1.5.0 """ if not isinstance(j, (int, np.integer)) or not 0 <= j < self.n: raise ValueError(f"joint index {j} out of range for {self.n} joints") From 22b42a377cf74c2741114919946a2b439f4f3c31 Mon Sep 17 00:00:00 2001 From: huxiaoyi-ovo Date: Wed, 21 Oct 2026 04:54:01 -0400 Subject: [PATCH 2/2] docs(ets2): show a degree-valued flipped joint constraint Co-Authored-By: ChatGPT (OpenAI GPT-6) --- src/roboticstoolbox/ets/ETS2.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/roboticstoolbox/ets/ETS2.py b/src/roboticstoolbox/ets/ETS2.py index 8261a0abe..1ae415780 100644 --- a/src/roboticstoolbox/ets/ETS2.py +++ b/src/roboticstoolbox/ets/ETS2.py @@ -146,6 +146,18 @@ def fixjoint(self, j: int, value: float, unit: str = "rad") -> ETS2: :param unit: angular unit for rotational joints, "rad" [default] or "deg" :returns: ETS2 with one fewer joint :raises ValueError: for an invalid joint position or angular unit + + Fixing a flipped revolute joint preserves the other joint as a variable: + + .. runblock:: pycon + + >>> from roboticstoolbox import ET2 + >>> ets = ET2.R(flip=True) * ET2.tx(1) * ET2.R() + >>> fixed = ets.fixjoint(0, 90, unit="deg") + >>> fixed.n, ets.n + (1, 2) + + .. versionadded:: 1.5.0 """ if not isinstance(j, (int, np.integer)) or not 0 <= j < self.n: raise ValueError(f"joint index {j} out of range for {self.n} joints")