Skip to content

RRT, RRT* and Informed RRT* path planner with tree-growth animation #34

@darshit-desai

Description

@darshit-desai

Summary

I’d like to add a sampling-based planner: RRT (Rapidly-exploring Random Tree) for 2D path planning. This would complement the existing grid planners (A*, Dijkstra) with a continuous-space method and a tree-growth animation.

Why this fits the repo

  • Beginner-friendly algorithm with visual intuition (tree expansion).
  • Uses only Python + NumPy + Matplotlib (and optionally SciPy, but not required).
  • Adds a new planning approach without changing existing code.

Proposed plan

  1. Add a planner component:

    • New module: src/components/plan/rrt/rrt_path_planner.py
    • Inputs similar to A*: start, goal, map_file, x_lim, y_lim
    • Parameters: step_size, goal_radius, max_iters, seed
    • Collision checking on the occupancy grid by sampling along each edge.
    • Treat any grid cell > 0 as blocked (same semantics as A*).
  2. Add a simulation:

    • New folder: src/simulations/path_planning/rrt_path_planning/
    • Script: rrt_path_planning.py
    • Build the same obstacle map as A* using BinaryOccupancyGrid
    • Run RRT, save path to path.json
    • Generate rrt_search.gif showing tree growth and final path
    • (Optional) Use CubicSplineCourse + PurePursuitController to create rrt_navigate.gif
  3. Add unit tests:

    • test/test_rrt_path_planning.py
    • Disable animation via a show_plot flag
    • Use a fixed RNG seed
    • Assert: path starts near start, ends near goal, and edges are collision-free.
  4. Update README:

    • Add RRT under Path Planning with GIF(s)

Testing

  • python -m pytest test/test_rrt_path_planning.py -v
  • run_test_suites.sh / run_test_suites.bat

Question

Does this plan look OK? Any preferences on parameters, file layout, or the animation style?

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions