Navigation Messages
Messages for goal-based navigation: send a target pose, receive a planned path, and follow waypoints. These form the interface between high-level commands ("go to the kitchen") and low-level control (CmdVel).
NavGoal — Where to Go
A navigation target with position, orientation, and tolerances.
Rust
use horus::prelude::*;
let goal = NavGoal {
target_pose: Pose2D { x: 5.0, y: 3.0, theta: 0.0 },
tolerance_position: 0.1, // 10cm position tolerance
tolerance_angle: 0.05, // ~3° heading tolerance
timeout_seconds: 30.0, // 30s to reach goal (0 = no limit)
timestamp_ns: 0,
};
let topic: Topic<NavGoal> = Topic::new("nav.goal")?;
topic.send(goal);
Fields
| Field | Type | Unit | Description |
|---|---|---|---|
target_pose | Pose2D | m, rad | Target position and heading |
tolerance_position | f64 | m | Acceptable position error |
tolerance_angle | f64 | rad | Acceptable heading error |
timeout_seconds | f64 | s | Max time to reach goal (0 = unlimited) |
timestamp_ns | u64 | ns | Timestamp |
NavPath — Planned Waypoints
A sequence of waypoints computed by a path planner. Each waypoint has position, heading, and speed.
Rust
use horus::prelude::*;
// Subscribe to planned paths from the planner node
let path_sub: Topic<NavPath> = Topic::new("nav.path")?;
if let Some(path) = path_sub.recv() {
for i in 0..path.waypoint_count as usize {
let wp = &path.waypoints[i];
// Follow waypoint: wp.x, wp.y, wp.theta, wp.velocity
}
}
Key Fields
| Field | Type | Description |
|---|---|---|
waypoints | [Waypoint; 256] | Array of waypoints (max 256) |
waypoint_count | u16 | Number of valid waypoints |
total_length | f64 | Total path length in meters |
estimated_time | f64 | Estimated completion time in seconds |
PathPlan — Compact Path Representation
A flat-array path format optimized for zero-copy IPC. Stores waypoints as packed [x, y, theta] triples.
Rust
use horus::prelude::*;
let plan_sub: Topic<PathPlan> = Topic::new("nav.plan")?;
if let Some(plan) = plan_sub.recv() {
let n = plan.waypoint_count as usize;
for i in 0..n {
let x = plan.waypoint_data[i * 3];
let y = plan.waypoint_data[i * 3 + 1];
let theta = plan.waypoint_data[i * 3 + 2];
}
}
Key Fields
| Field | Type | Description |
|---|---|---|
waypoint_data | [f32; 768] | Packed [x, y, theta] × 256 waypoints |
goal_pose | [f32; 3] | Target [x, y, theta] |
waypoint_count | u16 | Number of valid waypoints |
CostMap — Navigation Cost Grid
An inflated cost grid built on top of an OccupancyGrid. Used by planners to avoid obstacles with safety margins.
Key Fields
| Field | Type | Description |
|---|---|---|
occupancy_grid | OccupancyGrid | Base grid data |
costs | Vec<u8> | Cell costs (0=free, 254=inscribed, 255=lethal) |
inflation_radius | f32 | Obstacle inflation radius in meters |
cost_scaling_factor | f32 | Exponential cost decay factor |
Navigation Pipeline
User/Planner → NavGoal → Path Planner → NavPath/PathPlan → Path Follower → CmdVel → Drive
↑
CostMap (from OccupancyGrid + LiDAR)
Related Types
- CmdVel — Velocity commands (output of path follower)
- Odometry — Robot position feedback
- OccupancyGrid — 2D grid map
- Pose2D — Position representation