diff --git a/src/roboticstoolbox/ets/ETS.py b/src/roboticstoolbox/ets/ETS.py index a77536ea4..8e4f669dc 100644 --- a/src/roboticstoolbox/ets/ETS.py +++ b/src/roboticstoolbox/ets/ETS.py @@ -166,6 +166,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 """ # bool subclasses int, but must not select joint 0 or 1. if ( diff --git a/src/roboticstoolbox/ets/ETS2.py b/src/roboticstoolbox/ets/ETS2.py index bac687a21..8453499ee 100644 --- a/src/roboticstoolbox/ets/ETS2.py +++ b/src/roboticstoolbox/ets/ETS2.py @@ -147,6 +147,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 """ # bool subclasses int, but must not select joint 0 or 1. if (