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
| Field | Type | Unit | Description |
|---|---|---|---|
x | f64 | m | X position |
y | f64 | m | Y position |
theta | f64 | rad | Heading 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
| Field | Type | Description |
|---|---|---|
position | Point3 | 3D position { x, y, z } in meters |
orientation | Quaternion | Orientation as { x, y, z, w } quaternion |
timestamp_ns | u64 | Timestamp |
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
| Field | Type | Description |
|---|---|---|
pose | Pose3D | The 3D pose |
frame_id | [u8; 32] | Coordinate frame (null-terminated string, max 31 chars) |
timestamp_ns | u64 | Timestamp |
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
| Field | Type | Description |
|---|---|---|
pose | Pose3D | The 3D pose |
covariance | [f64; 36] | 6x6 covariance matrix (row-major) |
Choosing the Right Type
| Type | Dimensions | Use Case |
|---|---|---|
Pose2D | x, y, theta | Ground robots, 2D navigation |
Pose3D | xyz + quaternion | Drones, arms, 3D perception |
PoseStamped | Pose3D + frame | Transform frame integration |
PoseWithCovariance | Pose3D + covariance | EKF, probabilistic localization |
Related Types
- Odometry — Pose + velocity from wheel encoders
- Twist — Velocity (the derivative of pose)
- TransformStamped — Relative transform between frames
- Point3, Vector3, Quaternion — Primitive geometry types