Documentation Index
Fetch the complete documentation index at: https://docs.encord.com/llms.txt
Use this file to discover all available pages before exploring further.
Public pose types and convenience constructors.
Position Objects
@dataclass
class Position()
3-D position (translation).
CompositePose Objects
@dataclass
class CompositePose()
Rotation + position pair.
AffinePose Objects
@dataclass
class AffinePose()
4x4 affine transform matrix (16 floats, column-major).
The 16 values are stored column-by-column::
Given the matrix:
| r00 r01 r02 tx |
| r10 r11 r12 ty |
| r20 r21 r22 tz |
| 0 0 0 1 |
Flat order: [r00, r10, r20, 0,
r01, r11, r21, 0,
r02, r12, r22, 0,
tx, ty, tz, 1]
The upper-left 3x3 must be a proper rotation matrix (orthogonal,
det = 1). The fourth column is translation and the fourth row
must be [0, 0, 0, 1]. These constraints are enforced server-side.
quaternion_pose
def quaternion_pose(qx: float, qy: float, qz: float, qw: float, x: float,
y: float, z: float) -> CompositePose
Create a pose from a unit quaternion rotation and a position.
The quaternion must have unit magnitude (server-side validated).
See QuaternionRotation for constraints.
Arguments:
qx - Quaternion x component (in [-1, 1]).
qy - Quaternion y component (in [-1, 1]).
qz - Quaternion z component (in [-1, 1]).
qw - Quaternion w (scalar) component (in [-1, 1]).
x - Translation along the world x-axis.
y - Translation along the world y-axis.
z - Translation along the world z-axis.
euler_pose
def euler_pose(rx: float, ry: float, rz: float, x: float, y: float,
z: float) -> CompositePose
Create a pose from Euler angles (radians) and a position.
Rotation order is extrinsic X-Y-Z. See EulerRotation for
constraints.
Arguments:
rx - Rotation around the x-axis in radians.
ry - Rotation around the y-axis in radians.
rz - Rotation around the z-axis in radians.
x - Translation along the world x-axis.
y - Translation along the world y-axis.
z - Translation along the world z-axis.
matrix_pose
def matrix_pose(rotation: Sequence[float], x: float, y: float,
z: float) -> CompositePose
Create a pose from a 3x3 rotation matrix and a position.
See MatrixRotation for constraints (orthogonal, det = 1).
Arguments:
rotation - Nine floats in column-major order representing a
3x3 rotation matrix.
x - Translation along the world x-axis.
y - Translation along the world y-axis.
z - Translation along the world z-axis.
def affine_transform(matrix: Sequence[float]) -> AffinePose
Create a pose from a 4x4 affine transform matrix.
See AffinePose for constraints (rotation submatrix must be
proper, bottom row [0, 0, 0, 1]).
Arguments:
matrix - Sixteen floats in column-major order. The fourth
row must be [0, 0, 0, 1].
identity_pose
def identity_pose() -> CompositePose
Return the identity pose (no rotation, no translation).
translation_only
def translation_only(x: float, y: float, z: float) -> CompositePose
Create a pose with translation but no rotation.
Arguments:
x - Translation along the world x-axis.
y - Translation along the world y-axis.
z - Translation along the world z-axis.
rotation_only
def rotation_only(rotation: Rotation) -> CompositePose
Create a pose with rotation but no translation.
Arguments:
rotation - Any supported rotation type (quaternion, Euler, or
matrix).