Indexing Enums¶
Points¶
Vectors¶
Rotations¶
Poses¶
- class py123d.geometry.PoseSE2Index[source]¶
Indexing enum for array-like representations of SE2 poses (x,y,yaw).
- X = 0¶
- Y = 1¶
- YAW = 2¶
- XY = slice(<PoseSE2Index.X: 0>, 2, None)¶
- SE2 = slice(<PoseSE2Index.X: 0>, 3, None)¶
- class py123d.geometry.PoseSE3Index[source]¶
Indexing enum for array-like representations of SE3 poses (x,y,z,qw,qx,qy,qz).
- X = 0¶
- Y = 1¶
- Z = 2¶
- QW = 3¶
- QX = 4¶
- QY = 5¶
- QZ = 6¶
- XY = slice(<PoseSE3Index.X: 0>, 2, None)¶
- XYZ = slice(<PoseSE3Index.X: 0>, 3, None)¶
- QUATERNION = slice(<PoseSE3Index.QW: 3>, 7, None)¶
- SCALAR = slice(<PoseSE3Index.QW: 3>, 4, None)¶
- VECTOR = slice(<PoseSE3Index.QX: 4>, 7, None)¶
Matrices¶
- class py123d.geometry.MatrixSO2Index[source]¶
2D indexing for 2x2 SO2 rotation matrices.
Provides named column indices for accessing the basis vectors (columns) of a 2x2 rotation matrix:
[cos -sin] x_axis = [cos, sin] [sin cos] y_axis = [-sin, cos]
Examples
>>> import numpy as np >>> R = np.eye(2) >>> R[MatrixSO2Index.X_AXIS] # x-axis basis vector array([1., 0.])
- X_AXIS = (slice(None, None, None), 0)¶
- Y_AXIS = (slice(None, None, None), 1)¶
- class py123d.geometry.MatrixSO3Index[source]¶
2D indexing for 3x3 SO3 rotation matrices.
Provides named column indices for accessing the basis vectors (columns) of a 3x3 rotation matrix:
[r00 r01 r02] x_axis = R[:, 0] [r10 r11 r12] y_axis = R[:, 1] [r20 r21 r22] z_axis = R[:, 2]
Examples
>>> import numpy as np >>> R = np.eye(3) >>> R[MatrixSO3Index.Z_AXIS] # z-axis basis vector array([0., 0., 1.])
- X_AXIS = (slice(None, None, None), 0)¶
- Y_AXIS = (slice(None, None, None), 1)¶
- Z_AXIS = (slice(None, None, None), 2)¶
- class py123d.geometry.MatrixSE2Index[source]¶
2D indexing for 3x3 SE2 transformation matrices.
Provides named indices for accessing the rotation and translation blocks of a 3x3 homogeneous transformation matrix:
[r00 r01 tx] [r10 r11 ty] [ 0 0 1]
Examples
>>> import numpy as np >>> matrix = np.eye(3) >>> matrix[MatrixSE2Index.ROTATION] # 2x2 rotation block array([[1., 0.], [0., 1.]]) >>> matrix[MatrixSE2Index.TRANSLATION] # [tx, ty] array([0., 0.])
- ROTATION = (slice(0, 2, None), slice(0, 2, None))¶
- TRANSLATION = (slice(0, 2, None), 2)¶
- class py123d.geometry.MatrixSE3Index[source]¶
2D indexing for 4x4 SE3 transformation matrices.
Provides named indices for accessing the rotation and translation blocks of a 4x4 homogeneous transformation matrix:
[r00 r01 r02 tx] [r10 r11 r12 ty] [r20 r21 r22 tz] [ 0 0 0 1]
Examples
>>> import numpy as np >>> matrix = np.eye(4) >>> matrix[MatrixSE3Index.ROTATION] # 3x3 rotation block array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]) >>> matrix[MatrixSE3Index.TRANSLATION] # [tx, ty, tz] array([0., 0., 0.])
- ROTATION = (slice(0, 3, None), slice(0, 3, None))¶
- TRANSLATION = (slice(0, 3, None), 3)¶
Bounding Boxes¶
- class py123d.geometry.BoundingBoxSE2Index[source]¶
Indexing enum for array-like representations of bounding boxes in SE2 - center point (x,y). - yaw rotation. - extent (length,width).
- X = 0¶
- Y = 1¶
- YAW = 2¶
- LENGTH = 3¶
- WIDTH = 4¶
- XY = slice(<BoundingBoxSE2Index.X: 0>, 2, None)¶
- SE2 = slice(<BoundingBoxSE2Index.X: 0>, 3, None)¶
- EXTENT = slice(<BoundingBoxSE2Index.LENGTH: 3>, 5, None)¶
- class py123d.geometry.Corners2DIndex[source]¶
Indexes the corners of a bounding boxes in SE2 in the order: front-left, front-right, back-right, back-left.
- FRONT_LEFT = 0¶
- FRONT_RIGHT = 1¶
- BACK_RIGHT = 2¶
- BACK_LEFT = 3¶
- class py123d.geometry.BoundingBoxSE3Index[source]¶
Indexes array-like representations of rotated 3D bounding boxes - center point (x,y,z). - quaternion rotation (qw,qx,qy,qz). - extent (length,width,height).
- X = 0¶
- Y = 1¶
- Z = 2¶
- QW = 3¶
- QX = 4¶
- QY = 5¶
- QZ = 6¶
- LENGTH = 7¶
- WIDTH = 8¶
- HEIGHT = 9¶
- XYZ = slice(<BoundingBoxSE3Index.X: 0>, 3, None)¶
- SE3 = slice(<BoundingBoxSE3Index.X: 0>, 7, None)¶
- QUATERNION = slice(<BoundingBoxSE3Index.QW: 3>, 7, None)¶
- EXTENT = slice(<BoundingBoxSE3Index.LENGTH: 7>, 10, None)¶
- SCALAR = slice(<BoundingBoxSE3Index.QW: 3>, 4, None)¶
- VECTOR = slice(<BoundingBoxSE3Index.QX: 4>, 7, None)¶
- class py123d.geometry.Corners3DIndex[source]¶
Indexes the corners of a BoundingBoxSE3 in the order: front-left-bottom, front-right-bottom, back-right-bottom, back-left-bottom, front-left-top, front-right-top, back-right-top, back-left-top.
Visualization:
4------5 |\\ |\\ | \\ | \\ 0--\\--1 \\ \\ \\ \\ \\ l \\ 7-------6 h e \\ || \\ || e n \\|| \\|| i g \\3------2 g t width h h t
- FRONT_LEFT_BOTTOM = 0¶
- FRONT_RIGHT_BOTTOM = 1¶
- BACK_RIGHT_BOTTOM = 2¶
- BACK_LEFT_BOTTOM = 3¶
- FRONT_LEFT_TOP = 4¶
- FRONT_RIGHT_TOP = 5¶
- BACK_RIGHT_TOP = 6¶
- BACK_LEFT_TOP = 7¶
- BOTTOM = slice(<Corners3DIndex.FRONT_LEFT_BOTTOM: 0>, 4, None)¶
- TOP = slice(<Corners3DIndex.FRONT_LEFT_TOP: 4>, 8, None)¶