Rapidly Exploring Random Tree (RRT) Algorithm
Rapidly-Exploring Random Tree (RRT) Planner for Autonomous Racing
This project implements an RRT-based motion planner for a simulated F1/10 race car navigating a 90° right-turn hallway environment. Key deliverables included RRT algorithm development, PID-controlled steering integration, tree data structure design, and trajectory visualization. The system enables the car to autonomously plan paths from arbitrary initial positions in the first hallway to a fixed goal in the second hallway under varying initial conditions.
Objectives
- Implement RRT algorithm with global coordinate sampling to explore free space in a constrained hallway environment.
- Integrate PID-controlled
steer
function for trajectory generation between tree nodes. - Design tree data structure with node-parent relationships and cost tracking for path reconstruction.
- Validate planner robustness across initial states: front-wall distance [2m, 29m], side-wall offset [0.5m, 2m], heading error [-0.1, 0.1 rad].
- Develop visualization scripts for RRT tree growth and final trajectory using matplotlib.
Project Process
- Simulator Integration: Configured Car.ipynb simulator with adjustable hallway dimensions (30m straight sections, 5m turn radius) and noise-injected dynamics. Implemented lidar scan visualization for debugging.
-
Tree Architecture:
Designed
Node
class storing state (x,y,θ), parent/child relationships, control history, and path cost. BuiltTree
class with nearest-neighbor search using Euclidean distance metric. -
RRT Core Logic:
Implemented sampling with 10% goal biasing to accelerate convergence. Integrated adaptive steering:
- Retry sampling on failed
steer
executions (collision/timeout) - PID tuning for lateral/longitudinal control during turn execution
- Retry sampling on failed
-
Visualization Pipeline:
Created plotting scripts showing:
- RRT node distribution (green markers)
- Final trajectory (red path)
- Goal region highlighting (pink bounding box)
-
Validation Framework:
Tested 50 initial configurations with success metrics:
- 100% success rate for |θ0| ≤ 0.1 rad
- Max planning time ≤ 4 minutes (Google Colab CPU)
- Final position error < 0.3m from goal centroid
Conclusion and Future Improvements
The RRT planner successfully navigated the car through 90° turns under diverse initial conditions while maintaining collision-free paths. Future enhancements could implement RRT* for optimal smoothing, integrate dynamic obstacles, or add velocity planning using ST-RRT. Expanding the simulator to include probabilistic lidar models would further test robustness.
Project Information
- Category: Design/Hardware
- Client: Rensselaer Polytechnic Institute
- Project date: 10 March, 2025