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

CrateDescription
horus_coreCore runtime - nodes, communication, scheduling
horus_libraryStandard message types for robotics
horus_macrosProcedural macros (node!, derive(LogSummary))

Quick Reference

Core Types

TypeDescriptionModule
NodeBase trait for all computation unitshorus_core
Topic<T>Unified pub/sub channel with auto-detected backendshorus_core
SchedulerNode execution orchestratorhorus_core
ServiceClientSynchronous request/response RPChorus_core
ActionClientNodeLong-running tasks with feedback and cancellationhorus_core

Error Handling

TypeDescriptionModule
ErrorUnified error typehorus_core
Result<T>Result aliashorus_core

Message Types

TypeDescriptionModule
ImageCamera image datahorus_library
LaserScanLiDAR scan datahorus_library
ImuIMU sensor datahorus_library
TwistVelocity commandshorus_library
Pose2D2D position and orientationhorus_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

TypeKindDescription
NodetraitBase trait for all computation units
NodeStateenumRunning, Paused, Stopped, Error
HealthStatusenumNode health reporting
LogSummarytraitStructured logging for nodes

Communication

TypeKindDescription
Topic<T>structTyped pub/sub channel with auto-detected backends

Scheduling & Execution

TypeKindDescription
SchedulerstructNode execution orchestrator
FailurePolicyenumFatal, Restart, Skip, Ignore

Real-Time & Timing

TypeKindDescription
DurationExttraitErgonomic duration creation: 200.us(), 1.ms()
FrequencystructType-safe frequency: 100.hz()
MissenumDeadline miss policy: Warn, Skip, SafeMode, Stop
RtStatsstructReal-time execution statistics
RatestructFixed-rate loop control
StopwatchstructHigh-resolution timer
RuntimeParamsstructRuntime parameter store

Memory Domain Types

TypeKindDescription
ImagestructPool-backed camera image (zero-copy)
DepthImagestructPool-backed depth image (F32/U16)
PointCloudstructPool-backed 3D point cloud (zero-copy)

Transform Frame

TypeKindDescription
TransformFramestructCoordinate frame tree manager
TransformFrameConfigstructFrame tree configuration
TransformFrameStatsstructFrame tree statistics
Transformstruct3D rigid transformation
TransformQuerystructTransform lookup query
TransformQueryFromstructTransform query builder
FrameBuilderstructFluent frame registration
FrameInfostructFrame metadata
timestamp_now()fnCurrent 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

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)

MacroDescription
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 VersionRust EditionMSRV
0.1.x20211.92.0

See Also