Standard Library
The HORUS Standard Library (horus_library) provides 55+ typed messages for robotics, coordinate transforms (TransformFrame), and zero-copy domain types (Image, PointCloud, DepthImage). All types work in both Rust and Python.
Which Type Do I Need?
| I need to... | Use | Rust | Python |
|---|---|---|---|
| Drive wheels / send velocity | CmdVel | CmdVel::new(0.5, 0.1) | CmdVel(linear=0.5, angular=0.1) |
| Read IMU (accel + gyro) | Imu | imu.linear_acceleration | imu.linear_acceleration |
| Read LiDAR scan | LaserScan | scan.ranges | scan.ranges |
| Send camera images | Image | Image::new(640, 480, Rgb8) | Image(640, 480, encoding=0) |
| Send 3D point cloud | PointCloud | PointCloud::new(1000, XYZ) | PointCloud(num_points=1000) |
| Read wheel odometry | Odometry | odom.x, odom.y | odom.x, odom.y |
| Control joints | JointState | js.positions | js.positions |
| Detect objects (2D) | Detection | det.class_name | det.class_name |
| Detect objects (3D) | Detection3D | det.bbox | det.bbox |
| Build a 2D map | OccupancyGrid | grid.is_free(x, y) | grid.is_free(x, y) |
| Plan a path | NavPath | path.add_waypoint(wp) | path.add_waypoint(wp) |
| Estimate body pose | LandmarkArray | .coco_pose() | .coco_pose() |
| Transform coordinates | TransformFrame | tf.lookup("camera", "world") | tf.lookup("camera", "world") |
| Monitor robot health | SafetyStatus | status.estop_engaged | status.estop_engaged |
Sections
- Message Types — All 55+ message types organized by category
- TransformFrame — Coordinate transform system
- Image — Zero-copy camera images
- PointCloud — 3D point cloud data
- DepthImage — Depth maps from stereo/structured light
- Tensor & DLPack — ML tensor exchange with PyTorch/JAX
- Python Message Library — All types in Python with field tables
Design Decisions
Why a standard library instead of user-defined messages only? Standardized message types enable interoperability: a SLAM node from one developer works with a path planner from another because they agree on OccupancyGrid. Without standard types, every team invents its own Pose, IMU, and scan formats, making integration painful (the ROS2 ecosystem learned this lesson early).
Why 55+ types instead of a minimal set? Robotics has well-established data patterns (IMU, LiDAR, odometry, detection, etc.). Providing them out of the box means users start building application logic immediately instead of defining message schemas. Custom messages (message! macro or horus.msggen) cover domain-specific needs.
Why Rust and Python parity? Mixed-language systems are common: Rust for real-time control, Python for ML inference and prototyping. Every standard type is available in both languages with binary-compatible zero-copy IPC, so a Rust SLAM node can publish OccupancyGrid that a Python planner consumes with no translation layer.
See Also
- Message Types Concept — How messages work in HORUS
- Rust API Messages — Complete Rust message reference
- Python Message Library — Python equivalents