spatial_operations
Spatial pose and point utilities.
This module defines spatial utility models and transformation helpers for points and poses. It provides typed pose representations, conversion between homogeneous matrices and structured pose models, and point-transformation utilities that work directly with NumPy arrays. The module streamlines common spatial operations used by camera and calibration workflows while preserving a user-friendly API.
Key functionalities include: - Structured 3D pose models for position and Euler-angle orientation. - Conversion between homogeneous transforms and typed pose objects. - Homogeneous-coordinate helpers for batched point transformations. - Utilities for transforming single points and point sets with 4x4 matrices. - Input-shape normalization for robust NumPy-based spatial computations. - Lightweight abstractions optimized for internal camera workflow usage.
- class robotblockset.cameras.spatial_operations.Position(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelPosition in 3D space, all units are in meters.
- x: float
- y: float
- z: float
- class robotblockset.cameras.spatial_operations.EulerAngles(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelExtrinsic XYZ Euler angles in radians.
- roll: float
- pitch: float
- yaw: float
- class robotblockset.cameras.spatial_operations.Pose(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelPosition and extrinsic XYZ orientation of an object in 3D space.
Position values are expressed in meters and Euler angles in radians. The rotations are about the fixed X, Y, and Z axes of the reference frame.
- rotation_euler_xyz_in_radians: EulerAngles
- robotblockset.cameras.spatial_operations.transform_points(homogeneous_transform_matrix: ndarray, points: ArrayLike) ndarray[source]
Apply a homogeneous transformation to one or more 3D points.
- Parameters:
homogeneous_transform_matrix (HomogeneousMatrixType) – Transformation matrix with shape
(4, 4).points (numpy.typing.ArrayLike) – Single 3D point with shape
(3,)or point batch with shape(N, 3). Lists, tuples, and NumPy arrays are accepted.
- Returns:
Transformed point with shape
(3,)if the input was one-dimensional, otherwise a transformed point array with shape(N, 3).- Return type:
Vectors3DType
- Raises:
TypeError – If
pointsis not array-like or does not contain real numeric values.ValueError – If
pointshas an unsupported shape, contains non-finite values, or produces a zero or near-zero homogeneous scale.
Functions
|
Apply a homogeneous transformation to one or more 3D points. |
Classes
|
Extrinsic XYZ Euler angles in radians. |
|
Position and extrinsic XYZ orientation of an object in 3D space. |
|
Position in 3D space, all units are in meters. |