Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Mecha10 Planning
Path planning and navigation algorithms as BehaviorNode implementations for autonomous robots.
Overview
This package provides production-ready path planning algorithms that implement the BehaviorNode trait, making them fully composable with the Mecha10 behavior system.
Available Algorithms:
- A (A-Star)* - Optimal grid-based path planning
- RRT (Rapidly-exploring Random Tree) - Sampling-based planning for complex spaces
Installation
[]
= "0.1.0"
Quick Start
A* Path Planning
A* is optimal for grid-based environments and guarantees the shortest path.
use *;
async
###RRT Path Planning
RRT is better for high-dimensional or complex spaces where grid-based methods struggle.
use *;
// Create RRT planner
let mut planner = new
.with_max_iterations
.with_goal_sample_rate // 10% chance to sample goal
.with_bounds;
// Add obstacles
planner.add_obstacle;
// Execute planning
let path = planner.plan;
Algorithms
A* Algorithm
Best for:
- Grid-based environments
- 2D navigation
- When optimality is required
Features:
- Guaranteed shortest path
- Configurable diagonal movement
- Efficient with good heuristics
Parameters:
resolution: Grid cell size (smaller = more precise, slower)diagonal_movement: Allow diagonal moves (default: true)
Example:
let planner = new
.with_diagonal_movement; // Manhattan distance only
RRT Algorithm
Best for:
- Complex/cluttered environments
- High-dimensional spaces
- When speed > optimality
Features:
- Sampling-based exploration
- Handles complex obstacles
- Probabilistically complete
Parameters:
step_size: Maximum extension distance per iterationmax_iterations: Maximum planning iterations (default: 1000)goal_sample_rate: Probability of sampling goal (default: 0.1)bounds: Search space boundaries
Example:
let planner = new
.with_max_iterations
.with_goal_sample_rate; // Sample goal 20% of the time
Path Representation
Paths are represented as sequences of waypoints:
Path Simplification
Remove redundant waypoints to reduce path complexity:
let mut path = planner.plan.unwrap;
println!;
path.simplify; // Remove points within 0.5m tolerance
println!;
Obstacles
Circular obstacles are supported:
// Create obstacle at (x, y) with radius
let obstacle = new;
// Check if point is inside
if obstacle.contains
// Check if line segment intersects
if obstacle.intersects_segment
Integration with Behavior System
Use planning as part of larger behavior compositions:
use *;
// Combine planning with navigation
let sequence = new;
Or use with subsumption for reactive planning:
let subsumption = new
.add_layer
.add_layer
.add_layer;
JSON Configuration
Path planning can be configured via JSON:
Performance
A Performance:*
- Time Complexity: O(b^d) where b=branching factor, d=depth
- Space Complexity: O(b^d)
- Typical: ~100ms for 100x100 grid
- Optimizations: Good heuristics, pruning
RRT Performance:
- Time Complexity: O(n) where n=iterations
- Space Complexity: O(n)
- Typical: ~50-500ms depending on environment
- Probabilistically complete (not optimal)
Testing
# Run all tests
# Run specific algorithm tests
# Run clippy
Future Enhancements
Planned additions (see TODOS.md 7.3):
- TEB Local Planner: For dynamic obstacle avoidance
- D Lite*: For replanning in changing environments
- Hybrid A*: For non-holonomic robots (cars, etc.)
- 3D Planning: Extend to 3D spaces (drones)
See Also
- mecha10-behavior-runtime - Core behavior system
- mecha10-behavior-patterns - Subsumption, Ensemble
- TODOS.md - Priority 7.3: Non-AI Behavior Nodes
License
MIT