Pose2D / Pose3D

Position and orientation in 2D or 3D space. The fundamental geometry types for localization, navigation, and manipulation.

Pose2D — 2D Position + Heading

The standard representation for ground robots: position (x, y) and heading angle (theta).

Rust

use horus::prelude::*;

let pose = Pose2D { x: 1.5, y: 2.0, theta: 0.785 }; // 45 degrees

Python

import horus
pose = horus.Pose2D(x=1.5, y=2.0, theta=0.785)

Fields

FieldTypeUnitDescription
xf64mX position
yf64mY position
thetaf64radHeading angle (0 = forward, positive = counter-clockwise)

Pose3D — 3D Position + Quaternion

Full 6-DOF pose for 3D applications: drones, manipulator end-effectors, VR tracking.

Rust

use horus::prelude::*;

let pose = Pose3D {
    position: Point3 { x: 1.0, y: 2.0, z: 0.5 },
    orientation: Quaternion { x: 0.0, y: 0.0, z: 0.0, w: 1.0 }, // identity
    timestamp_ns: 0,
};

Python

import horus
pose = horus.Pose3D(
    position=horus.Point3(x=1.0, y=2.0, z=0.5),
    orientation=horus.Quaternion(x=0.0, y=0.0, z=0.0, w=1.0),
)

Fields

FieldTypeDescription
positionPoint33D position { x, y, z } in meters
orientationQuaternionOrientation as { x, y, z, w } quaternion
timestamp_nsu64Timestamp

PoseStamped — Pose3D with Frame ID

Adds a coordinate frame identifier for use with the Transform Frame system.

let stamped = PoseStamped {
    pose: Pose3D {
        position: Point3 { x: 1.0, y: 0.0, z: 0.0 },
        orientation: Quaternion { x: 0.0, y: 0.0, z: 0.0, w: 1.0 },
        timestamp_ns: 0,
    },
    frame_id: *b"base_link\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
    timestamp_ns: 0,
};

Fields

FieldTypeDescription
posePose3DThe 3D pose
frame_id[u8; 32]Coordinate frame (null-terminated string, max 31 chars)
timestamp_nsu64Timestamp

PoseWithCovariance — Uncertainty-Aware Pose

For EKF and probabilistic localization. The 6x6 covariance matrix represents uncertainty in [x, y, z, roll, pitch, yaw].

let pose_cov = PoseWithCovariance {
    pose: Pose3D {
        position: Point3 { x: 1.0, y: 2.0, z: 0.0 },
        orientation: Quaternion { x: 0.0, y: 0.0, z: 0.0, w: 1.0 },
        timestamp_ns: 0,
    },
    covariance: [0.0; 36], // 6x6 row-major
};

Fields

FieldTypeDescription
posePose3DThe 3D pose
covariance[f64; 36]6x6 covariance matrix (row-major)

Choosing the Right Type

TypeDimensionsUse Case
Pose2Dx, y, thetaGround robots, 2D navigation
Pose3Dxyz + quaternionDrones, arms, 3D perception
PoseStampedPose3D + frameTransform frame integration
PoseWithCovariancePose3D + covarianceEKF, probabilistic localization