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: BaseModel

Position 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: BaseModel

roll: float
pitch: float
yaw: float
class robotblockset.cameras.spatial_operations.Pose(*args: Any, **kwargs: Any)[source]

Bases: BaseModel

Pose of an object in 3D space, all units are in meters and radians.

The euler angles are extrinsic (rotations about the axes xyz of the original coordinate system, which is assumed to remain motionless).

position_in_meters: Position
rotation_euler_xyz_in_radians: EulerAngles
classmethod from_homogeneous_matrix(matrix: ndarray) Pose[source]

Build a pose from a homogeneous matrix.

Creates a Pose object from a 4x4 homogeneous transformation matrix.

as_homogeneous_matrix() ndarray[source]

Returns the pose as a 4x4 homogeneous transformation matrix.

robotblockset.cameras.spatial_operations.transform_points(homogeneous_transform_matrix: ndarray, points: ndarray) ndarray[source]

Applies a transform to a (set of) point(s).

Parameters:
  • homogeneous_transform_matrix (HomogeneousMatrixType) – _description_

  • points (PointsType) – _description_

Returns:

PointsType

Return type:

(3,) vector or (N,3) matrix.

Functions

transform_points(...)

Applies a transform to a (set of) point(s).

Classes

EulerAngles(*args, **kwargs)

Pose(*args, **kwargs)

Pose of an object in 3D space, all units are in meters and radians.

Position(*args, **kwargs)

Position in 3D space, all units are in meters.