Skip to main content

auki-geometry-py

Synced from the repository

This page mirrors bindings/python/auki-geometry-py/README.md in the auki-sdk repo (branch develop). The repository is the source of truth.

PyO3 bindings for auki-geometry. Lets Python consumers compose, invert, and convert spatial transforms and frame conventions on equal footing with Rust callers.

Status: Shipped.

Surface​

Math types (Vec3, Quat, SpatialTransform) cross the seam as flat float arrays β€” matching the robotics-team convention:

  • Vec3 ↔ [x, y, z]
  • Quat ↔ [qx, qy, qz, qw] (scalar-last, Hamilton / ROS / prost wire order)
  • SpatialTransform ↔ [tx, ty, tz, qx, qy, qz, qw]

Categorical types (FrameRegistryEntry, AxisConvention, axis directions, length units, handedness) stay as dicts and strings β€” exactly what auki-registry-py returns.

Public functions​

  • meters_per_unit(unit) β€” "meters" / "centimeters" / "millimeters" β†’ float multiplier.
  • axis_convention_matrix(from_axes, to_axes) β†’ 3Γ—3 nested list.
  • convention_matrix(from_entry, to_entry) β†’ 4Γ—4 nested list (axis permutation + unit scale).
  • convert_point_convention(point, from_entry, to_entry) β†’ 3-list (axis + unit).
  • convert_vector_convention(vector, from_entry, to_entry) β†’ 3-list (axis + unit).
  • convert_direction_convention(direction, from_entry, to_entry) β†’ 3-list (axis only, no unit scale).
  • convert_pose_convention(pose, from_entry, to_entry) β†’ 7-list.
  • inverse_spatial_transform(transform) β†’ 7-list.
  • compose_spatial_transforms(from_to_mid, mid_to_to) β†’ 7-list (the fromβ†’to composition).
  • relative_spatial_transform(common_to_from, common_to_to) β†’ 7-list (the fromβ†’to derivation).
  • spatial_transform_to_matrix4(pose) β†’ 4Γ—4 nested list.
  • spatial_transform_from_matrix4(matrix) β†’ 7-list.

Errors​

  • GeometryError (subclass of ValueError) β€” raised for invalid axes, handedness mismatch, or zero-length orientation quaternion.
  • Plain ValueError β€” raised for array length mismatches, non-numeric elements, or malformed registry dicts.

Depends on​