API Reference
Welcome to the HORUS API reference documentation. This section provides detailed documentation for all public types, traits, and functions in the HORUS framework.
Crates
| Crate | Description |
|---|---|
| horus | User-facing umbrella crate and horus::prelude |
| horus_core | Core runtime - nodes, communication, scheduling |
| horus_types | Core POD geometry, diagnostics, time, and generic messages |
| horus-robotics | Robotics messages such as CmdVel, Imu, and LaserScan |
| horus-tf | Coordinate transforms and TransformFrame |
| horus_macros | Procedural macros (node!, derive(LogSummary)) |
Quick Reference
Core Types
| Type | Description | Module |
|---|---|---|
Node | Base trait for all computation units | horus_core |
Topic<T> | Unified pub/sub channel with auto-detected backends | horus_core |
Scheduler | Node execution orchestrator | horus_core |
ServiceClient | Synchronous request/response RPC | horus_core |
ActionClientNode | Long-running tasks with feedback and cancellation | horus_core |
Error Handling
Message Types
| Type | Description | Module |
|---|---|---|
Image | Camera image data | horus |
LaserScan | LiDAR scan data | horus-robotics |
Imu | IMU sensor data | horus-robotics |
CmdVel | 2D velocity command | horus-robotics |
Twist | 6-DOF velocity | horus_types via horus::prelude |
Pose2D | 2D position and orientation | horus_types via horus::prelude |
Import Patterns
Minimal Import
// simplified
use horus::prelude::*;
This import gives you the core runtime API, memory domain types, actions, services, errors, and the horus_types geometry/time/diagnostics messages. Robotics-specific messages and transform frames are separate ecosystem crates.
Explicit Import (Alternative)
If you prefer explicit imports:
// simplified
use horus::prelude::{
// Core traits and types
Node, NodeState, HealthStatus, LogSummary,
// Communication
Topic,
// Scheduling
Scheduler, FailurePolicy,
// Real-time
DurationExt, Frequency, Miss, Rate, Stopwatch,
// Errors
Error, Result, HorusError,
// Core POD messages
Pose2D, Twist, GenericMessage,
};
use horus_robotics::prelude::{CmdVel, Imu, LaserScan, MotorCommand};
use horus_tf::prelude::{Transform, TransformFrame, TransformFrameConfig, timestamp_now};
Prelude Contents
The horus::prelude re-exports the core runtime surface. Ecosystem prelude imports are shown separately where the types live outside the horus crate.
Core Traits & Types
| Type | Kind | Description |
|---|---|---|
Node | trait | Base trait for all computation units |
NodeState | enum | Uninitialized, Initializing, Running, Stopping, Stopped, Error(String), Crashed(String) |
HealthStatus | enum | Node health reporting |
LogSummary | trait | Structured logging for nodes |
Communication
| Type | Kind | Description |
|---|---|---|
Topic<T> | struct | Typed pub/sub channel with auto-detected backends |
Scheduling & Execution
| Type | Kind | Description |
|---|---|---|
Scheduler | struct | Node execution orchestrator |
FailurePolicy | enum | Fatal, Restart, Skip, Ignore |
Real-Time & Timing
| Type | Kind | Description |
|---|---|---|
DurationExt | trait | Ergonomic duration creation: 200.us(), 1.ms() |
Frequency | struct | Type-safe frequency: 100.hz() |
Miss | enum | Deadline miss policy: Warn, Skip, SafeMode, Stop |
RtStats | struct | Real-time execution statistics |
Rate | struct | Fixed-rate loop control |
Stopwatch | struct | High-resolution timer |
RuntimeParams | struct | Runtime parameter store |
Memory Domain Types
| Type | Kind | Description |
|---|---|---|
Image | struct | Pool-backed camera image (zero-copy) |
DepthImage | struct | Pool-backed depth image (F32/U16) |
PointCloud | struct | Pool-backed 3D point cloud (zero-copy) |
Transform Frame (horus_tf::prelude)
| Type | Kind | Description |
|---|---|---|
TransformFrame | struct | Coordinate frame tree manager |
TransformFrameConfig | struct | Frame tree configuration |
TransformFrameStats | struct | Frame tree statistics |
Transform | struct | 3D rigid transformation |
TransformQuery | struct | Transform lookup query |
TransformQueryFrom | struct | Transform query builder |
FrameBuilder | struct | Fluent frame registration |
FrameInfo | struct | Frame metadata |
timestamp_now() | fn | Current time in nanoseconds |
Geometry Messages
Accel, AccelStamped, Point3, Pose2D, Pose3D, PoseStamped, PoseWithCovariance, Quaternion, TransformStamped, Twist, TwistWithCovariance, Vector3
Sensor Messages (horus_robotics::prelude)
BatteryState, FluidPressure, Illuminance, Imu, JointState, LaserScan, MagneticField, NavSatFix, Odometry, RangeSensor, Temperature
Clock & Time Messages
Clock, TimeReference, SOURCE_WALL, SOURCE_SIM, SOURCE_REPLAY
Control & Actuator Messages (horus_robotics::prelude)
CmdVel, DifferentialDriveCommand, JointCommand, MotorCommand, PidConfig, ServoCommand, TrajectoryPoint
Diagnostics Messages
DiagnosticReport, DiagnosticStatus, DiagnosticValue, EmergencyStop, Heartbeat, NodeHeartbeat, NodeStateMsg, ResourceUsage, SafetyStatus, StatusLevel
Vision & Perception Messages (horus_robotics::prelude)
BoundingBox2D, BoundingBox3D, CameraInfo, CompressedImage, Detection, Detection3D, Landmark, Landmark3D, LandmarkArray, PlaneDetection, RegionOfInterest, SegmentationMask, TrackedObject, TrackingHeader
Navigation Messages (horus_robotics::prelude)
CostMap, NavGoal, NavPath, OccupancyGrid, PathPlan
Force & Impedance Messages (horus_robotics::prelude)
ForceCommand, ImpedanceParameters, WrenchStamped
Input Messages (horus_robotics::prelude)
JoystickInput, KeyboardInput
Application Messages
CmdVel, GenericMessage (flexible cross-language messaging, MAX_GENERIC_PAYLOAD = 4096)
Type Helpers
Device, ImageEncoding, PointXYZ, PointXYZI, PointXYZRGB, TensorDtype
Actions
Action, ActionClient, ActionClientBuilder, ActionClientNode, ActionError, ActionResult, ActionServerBuilder, ActionServerNode, CancelResponse, ClientGoalHandle, GoalId, GoalOutcome, GoalPriority, GoalResponse, GoalStatus, PreemptionPolicy, ServerGoalHandle
Services
AsyncServiceClient, Service, ServiceClient, ServiceError, ServiceRequest, ServiceResponse, ServiceResult, ServiceServer, ServiceServerBuilder
Error Handling
Error, Result, HorusError, HorusContext, CommunicationError, ConfigError, MemoryError, NodeError, NotFoundError, ParseError, ResourceError, SerializationError, Severity, TimeoutError, TransformError, ValidationError, retry_transient(), RetryConfig
Macros (with "macros" feature)
| Macro | Description |
|---|---|
message! | Define custom message types |
service! | Define request/response service types |
action! | Define long-running action types (goal/feedback/result) |
standard_action! | Pre-built action templates |
hlog! | Structured node logging |
hlog_once! | Log once per program execution |
hlog_every! | Throttled logging |
node! | Define node with automatic topic registration |
Version Compatibility
| HORUS Version | Rust Edition | MSRV |
|---|---|---|
| 0.2.x | 2021 | 1.92.0 |
See Also
- Cargo Feature Flags - Feature flags across all HORUS crates
- Core Concepts - Understanding HORUS architecture
- Examples - Working code examples
- Message Types - Standard message reference