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_core | Core runtime - nodes, communication, scheduling |
| horus_library | Standard message types for robotics |
| 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_library |
LaserScan | LiDAR scan data | horus_library |
Imu | IMU sensor data | horus_library |
Twist | Velocity commands | horus_library |
Pose2D | 2D position and orientation | horus_library |
Import Patterns
Minimal Import
use horus::prelude::*;
This single import gives you access to 165+ types — everything needed for typical robotics applications.
Explicit Import (Alternative)
If you prefer explicit imports:
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,
// Messages
Pose2D, LaserScan, Imu, CmdVel, MotorCommand,
};
Prelude Contents
The horus::prelude re-exports everything you need without hunting for module paths. Here is the full inventory, grouped by category.
Core Traits & Types
| Type | Kind | Description |
|---|---|---|
Node | trait | Base trait for all computation units |
NodeState | enum | Running, Paused, Stopped, Error |
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
| 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
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
CmdVel, DifferentialDriveCommand, JointCommand, MotorCommand, PidConfig, ServoCommand, TrajectoryPoint
Diagnostics Messages
DiagnosticReport, DiagnosticStatus, DiagnosticValue, EmergencyStop, Heartbeat, NodeHeartbeat, NodeStateMsg, ResourceUsage, SafetyStatus, StatusLevel
Vision & Perception Messages
BoundingBox2D, BoundingBox3D, CameraInfo, CompressedImage, Detection, Detection3D, Landmark, Landmark3D, LandmarkArray, PlaneDetection, RegionOfInterest, SegmentationMask, TrackedObject, TrackingHeader
Navigation Messages
CostMap, NavGoal, NavPath, OccupancyGrid, PathPlan
Force & Impedance Messages
ForceCommand, ImpedanceParameters, WrenchStamped
Input Messages
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 #[repr(C)] 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.1.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