robotics_toolbox.core.so3.SO3

class robotics_toolbox.core.so3.SO3(rotation_matrix=None)

Bases: object

This class represents an SO3 rotations internally represented by rotation matrix.

Parameters:

rotation_matrix (ArrayLike | None)

__init__(rotation_matrix=None)

Creates a rotation transformation from rot_vector.

Parameters:

rotation_matrix (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] | None)

Return type:

None

Methods

__init__([rotation_matrix])

Creates a rotation transformation from rot_vector.

act(vector)

Rotate given vector by this transformation.

exp(rot_vector)

Compute SO3 transformation from a given rotation vector, i.e. exponential representation of the rotation.

from_angle_axis(angle, axis)

Compute rotation from angle axis representation.

from_euler_angles(angles, seq)

Compute rotation from euler angles defined by a given sequence.

from_quaternion(q)

Compute rotation from quaternion in a form [qx, qy, qz, qw].

inverse()

Return inverse of the transformation.

log()

Compute rotation vector from this SO3

rx(angle)

Return rotation matrix around x axis.

ry(angle)

Return rotation matrix around y axis.

rz(angle)

Return rotation matrix around z axis.

to_angle_axis()

Compute angle axis representation from self.

to_quaternion()

Compute quaternion from self.

act(vector)

Rotate given vector by this transformation.

Parameters:

vector (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])

Return type:

ndarray

static exp(rot_vector)

Compute SO3 transformation from a given rotation vector, i.e. exponential representation of the rotation.

Parameters:

rot_vector (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])

Return type:

SO3

static from_angle_axis(angle, axis)

Compute rotation from angle axis representation.

Parameters:
  • angle (float)

  • axis (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])

Return type:

SO3

static from_euler_angles(angles, seq)

Compute rotation from euler angles defined by a given sequence. angles: is a three-dimensional array of angles seq: is a list of axis around which angles rotate, e.g. ‘xyz’, ‘xzx’, etc.

Parameters:
  • angles (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])

  • seq (list[str])

Return type:

SO3

static from_quaternion(q)

Compute rotation from quaternion in a form [qx, qy, qz, qw].

Parameters:

q (_SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes])

Return type:

SO3

inverse()

Return inverse of the transformation.

Return type:

SO3

log()

Compute rotation vector from this SO3

Return type:

ndarray

static rx(angle)

Return rotation matrix around x axis.

Parameters:

angle (float)

Return type:

SO3

static ry(angle)

Return rotation matrix around y axis.

Parameters:

angle (float)

Return type:

SO3

static rz(angle)

Return rotation matrix around z axis.

Parameters:

angle (float)

Return type:

SO3

to_angle_axis()

Compute angle axis representation from self.

Return type:

tuple[float, ndarray]

to_quaternion()

Compute quaternion from self.

Return type:

ndarray