Skip to content

Add RRT online replanning in continuous space (navigation/41)#17

Merged
rsasaki0109 merged 1 commit into
mainfrom
add-rrt-replanning
Jun 5, 2026
Merged

Add RRT online replanning in continuous space (navigation/41)#17
rsasaki0109 merged 1 commit into
mainfrom
add-rrt-replanning

Conversation

@rsasaki0109

Copy link
Copy Markdown
Owner

What

A new example, examples/navigation/41_rrt_replanning.py: a Rapidly-exploring Random Tree (LaValle, 1998) running the online-replanning loop in continuous space. The repo had grid A* online replanning (04_online_replanning_astar.py) but no sampling-based planner — this adds the continuous-space counterpart.

The lesson

RRT plans by growing a tree from the start (sample a point, extend the nearest node a short step toward it, keep collision-free edges) until it reaches the goal. The robot plans with the obstacles it knows and follows the path, but one obstacle is hidden until it comes within sensor range. When a newly sensed obstacle is found to block the remaining path, the world reports path_blocked, the agent replans an RRT from its current position, and it continues. Plan, discover, replan, arrive.

RRT is randomized, so the first tree occasionally routes around the hidden disc and no replan is needed — the robot reaches the goal either way; the default seed always replans.

Contents

  • A self-contained RRTWorld (known + hidden discs, local sensing, segment–disc collision), a standalone plan_rrt() (nearest-node extension, goal bias, reconstruction), and an RRTReplanAgent that detects a blocked remaining path and replans.
  • Two smoke tests: the default seed threads the gap, senses the disc, replans, and reaches the goal with no collision; the planner + replanner reach the goal on every seed in range(6).
  • examples/README.md row + a full examples/navigation/README.md section; example count 43→44 and test count 120→122 in README.md / docs/status.md.

Verification

  • Seeds 0–9: 10/10 reach the goal, ~8/10 trigger a replan; the default seed replans once.
  • Full suite green (135 passed); matplotlib render path confirmed under Agg.

References

  • S. M. LaValle, "Rapidly-Exploring Random Trees: A New Tool for Path Planning," TR 98-11, Iowa State University, 1998.
  • S. M. LaValle & J. J. Kuffner, "Randomized Kinodynamic Planning," IJRR 2001.

🤖 Generated with Claude Code

The repo had grid A* online replanning (04) but no sampling-based planner. This
adds an RRT (LaValle, 1998) — the continuous-space counterpart — running the same
plan/discover/replan loop.

The robot plans an RRT with the obstacles it knows and follows the path, but one
obstacle is hidden until it comes within sensor range. When a newly sensed
obstacle is found to block the remaining path, the world reports a path_blocked
failure and the agent replans an RRT from its current position with the updated
obstacle set. Plan, discover, replan, arrive. (RRT is randomized, so the first
tree occasionally routes around the hidden disc and no replan is needed; the
robot reaches the goal either way — the default seed always replans.)

- self-contained RRTWorld (known + hidden discs, local sensing, segment-disc
  collision) + a standalone plan_rrt() and an RRTReplanAgent that detects a
  blocked path and replans, plus a References section
- two smoke tests: the default seed threads the gap, senses the disc, replans,
  and reaches the goal with no collision; the planner+replanner reach the goal on
  every seed in range(6)
- examples index + navigation README section; example 43->44, tests 120->122

Verified across seeds 0-9 (10/10 reach the goal, ~8/10 trigger a replan; default
seed replans once) and the matplotlib render path under Agg.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rsasaki0109 rsasaki0109 merged commit a827a4c into main Jun 5, 2026
3 checks passed
@rsasaki0109 rsasaki0109 deleted the add-rrt-replanning branch June 5, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant