Special Euclidean Groups

class py123d.geometry.PoseSE2[source]

Class to represents a 2D pose as SE2 (x, y, yaw).

Examples

>>> from py123d.geometry import PoseSE2
>>> pose = PoseSE2(x=1.0, y=2.0, yaw=0.5)
>>> print(pose.x, pose.y, pose.yaw)
1.0 2.0 0.5
>>> print(pose.rotation_matrix)
[[ 0.87758256 -0.47942554]
 [ 0.47942554  0.87758256]]

Public Data Attributes:

x

The x-coordinate of the pose.

y

The y-coordinate of the pose.

yaw

The yaw angle of the pose.

array

Pose as numpy array of shape (3,), indexed by PoseSE2Index.

pose_se2

Returns self to match interface of other pose classes.

point_2d

The Point2D of the pose, i.e. the translation part.

vector_2d

The Vector2D translation component of the SE2 pose.

rotation_matrix

The 2x2 rotation matrix representation of the pose.

transformation_matrix

The 3x3 transformation matrix representation of the pose.

shapely_point

The Shapely point representation of the pose.

Inherited from ArrayMixin

array

The array representation of the geometric entity.

shape

Return the shape of the array.

Public Methods:

from_array(array[, copy])

Constructs a PoseSE2 from a numpy array.

from_transformation_matrix(transformation_matrix)

Constructs a PoseSE2 from a 3x3 transformation matrix.

from_R_t(rotation, translation)

Constructs a PoseSE2 from a rotation and a translation.

identity()

Constructs an identity PoseSE2.

Inherited from ArrayMixin

from_array(array[, copy])

Create an instance from a NumPy array.

from_list(values)

Create an instance from a list of values.

tolist()

Convert the array to a Python list.

to_list()

Convert the array to a Python list.

copy()

Return a copy of the object with a copied array.


__init__(x, y, yaw)[source]

Init PoseSE2 with x, y, yaw coordinates.

Parameters:
  • x (float) – The x-coordinate.

  • y (float) – The y-coordinate.

  • yaw (float) – The yaw angle in radians.

classmethod from_array(array, copy=True)[source]

Constructs a PoseSE2 from a numpy array.

Parameters:
  • array (ndarray[tuple[Any, ...], dtype[float64]]) – Array of shape (3,) representing the state [x, y, yaw], indexed by PoseSE2Index.

  • copy (bool) – Whether to copy the input array. Defaults to True.

Return type:

PoseSE2

Returns:

A PoseSE2 instance.

classmethod from_transformation_matrix(transformation_matrix)[source]

Constructs a PoseSE2 from a 3x3 transformation matrix.

Parameters:

transformation_matrix (ndarray[tuple[Any, ...], dtype[float64]]) – A 3x3 numpy array representing the transformation matrix.

Return type:

PoseSE2

Returns:

A PoseSE2 instance.

classmethod from_R_t(rotation, translation)[source]

Constructs a PoseSE2 from a rotation and a translation.

Parameters:
Return type:

PoseSE2

Returns:

A PoseSE2 instance.

classmethod identity()[source]

Constructs an identity PoseSE2.

Return type:

PoseSE2

Returns:

An identity PoseSE2 instance.

property x: float

The x-coordinate of the pose.

property y: float

The y-coordinate of the pose.

property yaw: float

The yaw angle of the pose.

property array: ndarray[tuple[Any, ...], dtype[float64]]

Pose as numpy array of shape (3,), indexed by PoseSE2Index.

property pose_se2: PoseSE2

Returns self to match interface of other pose classes.

property point_2d: Point2D

The Point2D of the pose, i.e. the translation part.

property vector_2d: Vector2D

The Vector2D translation component of the SE2 pose.

property rotation_matrix: ndarray[tuple[Any, ...], dtype[float64]]

The 2x2 rotation matrix representation of the pose.

property transformation_matrix: ndarray[tuple[Any, ...], dtype[float64]]

The 3x3 transformation matrix representation of the pose.

property shapely_point: Point

The Shapely point representation of the pose.

copy()

Return a copy of the object with a copied array.

Return type:

ArrayMixin

classmethod from_list(values)

Create an instance from a list of values.

Return type:

Self

Parameters:

values (list)

property shape: tuple

Return the shape of the array.

to_list()

Convert the array to a Python list.

Return type:

list

tolist()

Convert the array to a Python list.

Return type:

list

class py123d.geometry.PoseSE3[source]

Class representing a pose in SE3 space.

Examples

>>> from py123d.geometry import PoseSE3
>>> pose = PoseSE3(x=1.0, y=2.0, z=3.0, qw=1.0, qx=0.0, qy=0.0, qz=0.0)
>>> pose.point_3d
Point3D(array=[1. 2. 3.])
>>> pose.transformation_matrix
array([[1., 0., 0., 1.],
       [0., 1., 0., 2.],
       [0., 0., 1., 3.],
       [0., 0., 0., 1.]])
>>> PoseSE3.from_transformation_matrix(pose.transformation_matrix) == pose
True
>>> print(pose.yaw, pose.pitch, pose.roll)
0.0 0.0 0.0

Public Data Attributes:

x

The x-coordinate of the pose.

y

The y-coordinate of the pose.

z

The z-coordinate of the pose.

qw

The w-coordinate of the quaternion, representing the scalar part.

qx

The x-coordinate of the quaternion, representing the first component of the vector part.

qy

The y-coordinate of the quaternion, representing the second component of the vector part.

qz

The z-coordinate of the quaternion, representing the third component of the vector part.

array

The numpy array representation of the pose with shape (7,), indexed by PoseSE3Index

pose_se3

The PoseSE3 itself.

pose_se2

The PoseSE2 representation of the SE3 pose.

point_3d

The Point3D representation of the SE3 pose, i.e. the translation part.

point_2d

The Point2D representation of the SE3 pose, i.e. the translation part.

vector_3d

The Vector3D translation component of the SE3 pose.

vector_2d

The Vector2D 2D translation component (x, y) of the SE3 pose.

shapely_point

The Shapely point representation, of the translation part of the SE3 pose.

quaternion

The Quaternion representation of the state's orientation.

euler_angles

The EulerAngles representation of the state's orientation.

roll

The roll (x-axis rotation) angle in radians.

pitch

The pitch (y-axis rotation) angle in radians.

yaw

The yaw (z-axis rotation) angle in radians.

rotation_matrix

Returns the 3x3 rotation matrix representation of the state's orientation.

transformation_matrix

Returns the 4x4 transformation matrix representation of the state.

inverse

Returns the inverse of the SE3 pose.

Inherited from ArrayMixin

array

The array representation of the geometric entity.

shape

Return the shape of the array.

Public Methods:

from_array(array[, copy])

Constructs a PoseSE3 from a numpy array of shape (7,), indexed by PoseSE3Index.

from_transformation_matrix(transformation_matrix)

Constructs a PoseSE3 from a 4x4 transformation matrix.

from_R_t(rotation, translation)

Constructs a PoseSE3 from arbitrary rotation and translation representations.

identity()

Constructs an identity PoseSE3.

Inherited from ArrayMixin

from_array(array[, copy])

Create an instance from a NumPy array.

from_list(values)

Create an instance from a list of values.

tolist()

Convert the array to a Python list.

to_list()

Convert the array to a Python list.

copy()

Return a copy of the object with a copied array.


__init__(x, y, z, qw, qx, qy, qz)[source]

Initialize PoseSE3 with x, y, z, qw, qx, qy, qz coordinates.

Parameters:
  • x (float) – The x-coordinate.

  • y (float) – The y-coordinate.

  • z (float) – The z-coordinate.

  • qw (float) – The w-coordinate of the quaternion, representing the scalar part.

  • qx (float) – The x-coordinate of the quaternion, representing the first component of the vector part.

  • qy (float) – The y-coordinate of the quaternion, representing the second component of the vector part.

  • qz (float) – The z-coordinate of the quaternion, representing the third component of the vector part.

classmethod from_array(array, copy=True)[source]

Constructs a PoseSE3 from a numpy array of shape (7,), indexed by PoseSE3Index.

Parameters:
  • array (ndarray[tuple[Any, ...], dtype[float64]]) – Array of shape (7,) representing the state [x, y, z, qw, qx, qy, qz].

  • copy (bool) – Whether to copy the input array. Defaults to True.

Return type:

PoseSE3

Returns:

A PoseSE3 instance.

classmethod from_transformation_matrix(transformation_matrix)[source]

Constructs a PoseSE3 from a 4x4 transformation matrix.

Parameters:

transformation_matrix (ndarray[tuple[Any, ...], dtype[float64]]) – A 4x4 numpy array representing the transformation matrix.

Return type:

PoseSE3

Returns:

A PoseSE3 instance.

classmethod from_R_t(rotation, translation)[source]

Constructs a PoseSE3 from arbitrary rotation and translation representations.

Parameters:
Return type:

PoseSE3

classmethod identity()[source]

Constructs an identity PoseSE3.

Return type:

PoseSE3

Returns:

An identity PoseSE3 instance.

property x: float

The x-coordinate of the pose.

property y: float

The y-coordinate of the pose.

property z: float

The z-coordinate of the pose.

property qw: float

The w-coordinate of the quaternion, representing the scalar part.

property qx: float

The x-coordinate of the quaternion, representing the first component of the vector part.

property qy: float

The y-coordinate of the quaternion, representing the second component of the vector part.

property qz: float

The z-coordinate of the quaternion, representing the third component of the vector part.

property array: ndarray[tuple[Any, ...], dtype[float64]]

The numpy array representation of the pose with shape (7,), indexed by PoseSE3Index

property pose_se3: PoseSE3

The PoseSE3 itself.

property pose_se2: PoseSE2

The PoseSE2 representation of the SE3 pose.

property point_3d: Point3D

The Point3D representation of the SE3 pose, i.e. the translation part.

property point_2d: Point2D

The Point2D representation of the SE3 pose, i.e. the translation part.

property vector_3d: Vector3D

The Vector3D translation component of the SE3 pose.

property vector_2d: Vector2D

The Vector2D 2D translation component (x, y) of the SE3 pose.

property shapely_point: Point

The Shapely point representation, of the translation part of the SE3 pose.

property quaternion: Quaternion

The Quaternion representation of the state’s orientation.

property euler_angles: EulerAngles

The EulerAngles representation of the state’s orientation.

property roll: float

The roll (x-axis rotation) angle in radians.

property pitch: float

The pitch (y-axis rotation) angle in radians.

property yaw: float

The yaw (z-axis rotation) angle in radians.

property rotation_matrix: ndarray[tuple[Any, ...], dtype[float64]]

Returns the 3x3 rotation matrix representation of the state’s orientation.

property transformation_matrix: ndarray[tuple[Any, ...], dtype[float64]]

Returns the 4x4 transformation matrix representation of the state.

property inverse: PoseSE3

Returns the inverse of the SE3 pose.

copy()

Return a copy of the object with a copied array.

Return type:

ArrayMixin

classmethod from_list(values)

Create an instance from a list of values.

Return type:

Self

Parameters:

values (list)

property shape: tuple

Return the shape of the array.

to_list()

Convert the array to a Python list.

Return type:

list

tolist()

Convert the array to a Python list.

Return type:

list