Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/roboticstoolbox/ets/ETS.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
12 changes: 12 additions & 0 deletions src/roboticstoolbox/ets/ETS2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Loading