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
horusUser-facing umbrella crate and horus::prelude
horus_coreCore runtime - nodes, communication, scheduling
horus_typesCore POD geometry, diagnostics, time, and generic messages
horus-roboticsRobotics messages such as CmdVel, Imu, and LaserScan
horus-tfCoordinate transforms and TransformFrame
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
LaserScanLiDAR scan datahorus-robotics
ImuIMU sensor datahorus-robotics
CmdVel2D velocity commandhorus-robotics
Twist6-DOF velocityhorus_types via horus::prelude
Pose2D2D position and orientationhorus_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

TypeKindDescription
NodetraitBase trait for all computation units
NodeStateenumUninitialized, Initializing, Running, Stopping, Stopped, Error(String), Crashed(String)
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 (horus_tf::prelude)

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 (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)

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

See Also

Spotted an error on this page?