API Quick Reference

One-page index of every HORUS API. Use Ctrl+F to find what you need.

Message Types — "What type do I use for...?"

Motion & Control

TaskTypeConstructorTopic
Move a wheeled robotCmdVelCmdVel::new(linear, angular)cmd_vel
Move a differential driveDifferentialDriveCommandDifferentialDriveCommand::new(left, right)drive_cmd
Control a servoServoCommandServoCommand::new(position, velocity)servo_cmd
Control a jointJointCommandJointCommand::for_joint(id, position)joint_cmd
Control a motorMotorCommandMotorCommand::velocity(rpm)motor_cmd
Follow a trajectoryTrajectoryPointTrajectoryPoint::new(position, velocity)trajectory
PID tuningPidConfigPidConfig::new(kp, ki, kd)pid_config

Sensors

TaskTypeConstructorTopic
LiDAR scanLaserScanLaserScan::from_ranges(&ranges)scan
Camera imageImageImage::rgb(w, h, &pixels)image
Depth imageDepthImageDepthImage::new(w, h, &depths)depth
Compressed imageCompressedImageCompressedImage::jpeg(&bytes)image/compressed
IMU (accel+gyro)ImuImu::new(ax, ay, az, gx, gy, gz)imu
Odometry (pose+velocity)OdometryOdometry::new(x, y, theta)odom
Joint positionsJointStateJointState::from_positions(&pos)joint_states
Battery levelBatteryStateBatteryState::new(voltage, percentage)battery
TemperatureTemperatureTemperature::celsius(value)temperature
GPSNavSatFixNavSatFix::new(lat, lon, alt)gps
Range sensorRangeSensorRangeSensor::new(distance)range
Magnetic fieldMagneticFieldMagneticField::new(x, y, z)mag
AudioAudioFrameAudioFrame::mono(sample_rate, &samples)audio

Perception

TaskTypeConstructor
2D object detectionDetectionDetection::new(label, confidence, bbox)
3D object detectionDetection3DDetection3D::new(label, confidence, bbox3d)
2D bounding boxBoundingBox2DBoundingBox2D::new(x, y, w, h)
3D bounding boxBoundingBox3DBoundingBox3D::new(center, size)
Object trackingTrackedObjectTrackedObject::new(id, detection)
Segmentation maskSegmentationMaskSegmentationMask::new(w, h, &classes)
Point cloudPointCloudPointCloud::from_xyz(&points)
Plane detectionPlaneDetectionPlaneDetection::new(normal, distance)
LandmarkLandmarkLandmark::new(x, y, confidence)
TaskTypeConstructor
Send a goalNavGoalNavGoal::new(x, y, theta)
Plan a pathPathPlanPathPlan::from_waypoints(&waypoints)
Occupancy gridOccupancyGridOccupancyGrid::new(w, h, resolution)
Cost mapCostMapCostMap::new(w, h, resolution)
WaypointWaypointWaypoint::new(x, y)

Geometry

TaskTypeConstructor
3D pointPoint3Point3::new(x, y, z)
3D vectorVector3Vector3::new(x, y, z)
RotationQuaternionQuaternion::identity()
2D posePose2DPose2D::new(x, y, theta)
3D posePose3DPose3D::new(position, orientation)
VelocityTwistTwist::new(linear, angular)
AccelerationAccelAccel::new(linear, angular)
TransformTransformStampedTransformStamped::new(parent, child, translation, rotation)

Force & Contact

TaskTypeConstructor
Force commandForceCommandForceCommand::force_only(force_vec)
Impedance controlImpedanceParametersImpedanceParameters::new(stiffness, damping)
Wrench (force+torque)WrenchStampedWrenchStamped::new(force, torque)
Contact infoContactInfoContactInfo::new(force, position)

Diagnostics

TaskTypeConstructor
Status reportDiagnosticStatusDiagnosticStatus::ok("message")
Emergency stopEmergencyStopEmergencyStop::trigger("reason")
HeartbeatHeartbeatHeartbeat::now()
Resource usageResourceUsageResourceUsage::new(cpu, memory)

Core API Cheatsheet

use horus::prelude::*;

// ── Create a scheduler ────────────────────────────
let mut scheduler = Scheduler::new()
    .tick_rate(100.hz())           // 100 Hz main loop
    .monitoring(true)              // Enable health monitoring
    .deterministic(true);          // Simulation mode (optional)

// ── Add a node ────────────────────────────────────
scheduler.add(MyNode::new())
    .order(0)                      // Execution priority
    .rate(50.hz())                 // Node tick rate
    .budget(2.ms())                // Max tick duration
    .deadline(5.ms())              // Hard deadline
    .on_miss(Miss::Skip)           // What to do on deadline miss
    .build()?;

// ── Run ───────────────────────────────────────────
scheduler.run()?;                  // Blocks until Ctrl+C

// ── Topics (pub/sub) ──────────────────────────────
let pub_topic: Topic<CmdVel> = Topic::new("cmd_vel")?;
pub_topic.send(CmdVel::new(1.0, 0.0));

let sub_topic: Topic<LaserScan> = Topic::new("scan")?;
if let Some(scan) = sub_topic.try_recv() {
    println!("Got {} ranges", scan.ranges.len());
}

// ── Time ──────────────────────────────────────────
let now = horus::now();            // Current ClockInstant
let dt = horus::dt();              // Time since last tick
let elapsed = horus::elapsed();    // Total runtime

// ── Parameters ────────────────────────────────────
let params = RuntimeParams::new();
params.set("speed", 1.5)?;
let speed: f64 = params.get_or("speed", 1.0);

// ── Duration/Frequency helpers ────────────────────
let rate = 100_u64.hz();           // 100 Hz
let budget = 200_u64.us();         // 200 microseconds
let deadline = 1_u64.ms();         // 1 millisecond

CLI Commands

CommandPurpose
horus new NAME -r/-pCreate Rust/Python project
horus runBuild and run
horus buildBuild only
horus testRun tests
horus add NAME --source SOURCEAdd dependency
horus remove NAMERemove dependency
horus install PKGInstall package from registry
horus topic listList active topics
horus node listList running nodes
horus param get/set KEY VALUERuntime parameters
horus monitorWeb dashboard
horus monitor --tuiTerminal dashboard
horus logView logs
horus doctorHealth check
horus checkValidate project
horus fmtFormat code
horus lintLint code
horus deploy TARGETDeploy to robot
horus publishPublish to registry
horus auth loginAuthenticate

See Also