basic_robotics.general.faser_twist module

Model a Twist, a Screw representing a spatial velocity.

class basic_robotics.general.faser_twist.Twist(twist_data, frame_applied=None)[source]

Bases: Screw

Model a Twist.

A Twist is a Screw that represents an instantaneous spatial velocity (linear and angular), and can be converted to and from homogeneous transforms and se(3) matrix form.

__init__(twist_data, frame_applied=None)[source]

Create a new Twist.

Parameters:
  • twist_data (np.ndarray[float]) – data representing a twist, of shape (6,1).

  • frame_applied (tm, optional) – If not specified, assumes origin.

classmethod fromTM(twist_transform, frame_applied=None)[source]

Build a Twist from a homogeneous transform by taking its matrix logarithm.

Parameters:
  • twist_transform (tm) – Homogeneous transform to convert into a twist.

  • frame_applied (tm, optional) – Frame the resulting twist is expressed in. Defaults to None.

Returns:

Twist – New Twist equivalent to the given transform.

toTM()[source]

Convert this Twist to a homogeneous transform via the matrix exponential.

Returns:

tm – Transform obtained by exponentiating this twist’s se(3) representation.

twistMatrix()[source]

Build the 4x4 se(3) matrix representation of this twist.

Returns:

np.ndarray[float] – 4x4 matrix with the skew-symmetric angular velocity in the upper-left 3x3 block and the linear velocity in the top of the last column.

toScrew()[source]

Convert this Twist to its equivalent Screw axis representation.

Handles the pure-rotation case (zero linear component) by returning a Screw aligned with the angular velocity axis and infinite pitch, and otherwise derives the screw axis point from the normalized twist.

Returns:

Screw – Screw axis (angular direction and axis point) equivalent to this twist.