Motion planning is the problem of finding a collision-free path from a start configuration to a goal in a space cluttered with obstacles. This project implements and compares two fundamentally different strategies β sampling-based (Bi-RRT) and graph-search (Weighted A*) β across seven 3D environments of varying complexity: a single cube, a maze, flappy-bird-style corridors, pillars, a window gap, a tower, and a room.
Collision detection uses vectorized axis-aligned bounding box (AABB) segment tests via the slab method. The improved Bi-RRT with a greedy-connect extension now successfully solves all seven environments, including topologically complex ones. However, a key trade-off remains: Bi-RRT finds significantly longer paths on narrow-passage maps (maze: 135.3 vs. A*'s 91.9), while Weighted A* reliably produces near-optimal paths at the cost of higher computation time on complex environments.
Grows two random trees simultaneously β one from the start, one from the goal β using goal-biased sampling (pgoal = 0.05). After each extension step, a greedy-connect phase steps the opposite tree toward the new node until blocked or connected (gap < step/2). Trees swap roles each iteration for balanced growth. Fast on open spaces; finds longer paths on narrow passages.
Searches a voxelized grid with resolution 0.5 m and 26-neighbor connectivity (Β±1 in each axis). The weight parameter w β {1.0, 1.2, 1.5} scales the heuristic: w = 1.0 is optimal A*, higher weights trade path quality for speed. Guarantees a solution in all tested environments; slower on mazes due to exhaustive grid expansion.
Step-by-step logic for both planners, including the greedy-connect extension in Bi-RRT.
Bi-RRT vs. Weighted A* (w = 1.0) across all seven test environments. All runs successful.
| Environment | Bi-RRT | RRT Time (s) | RRT Length | Weighted A* | A* Time (s) | A* Length |
|---|---|---|---|---|---|---|
| Single Cube | β | 0.008 | 8.39 | β | 0.010 | 7.98 |
| Maze | β | 8.566 | 135.31 | β | 8.918 | 91.99 |
| Flappy Bird | β | 0.074 | 42.69 | β | 2.500 | 28.80 |
| Pillars | β | 0.010 | 36.23 | β | 0.170 | 32.49 |
| Window | β | 0.012 | 28.11 | β | 4.183 | 29.72 |
| Tower | β | 0.213 | 44.86 | β | 2.116 | 32.85 |
| Room | β | 0.037 | 19.75 | β | 0.242 | 13.68 |
Weighted A* β effect of weight parameter on planning time and path length.
| Environment | w = 1.0 Time | w = 1.0 Length | w = 1.2 Time | w = 1.2 Length | w = 1.5 Time | w = 1.5 Length |
|---|---|---|---|---|---|---|
| Single Cube | 0.010 s | 7.98 | 0.011 s | 7.98 | 0.010 s | 7.98 |
| Maze | 8.918 s | 91.99 | 11.086 s | 91.99 | 12.757 s | 91.99 |
| Flappy Bird | 2.500 s | 28.80 | 2.144 s | 28.80 | 1.232 s | 29.41 |
| Pillars | 0.170 s | 32.49 | 0.073 s | 32.08 | 0.060 s | 31.89 |
| Window | 4.183 s | 29.72 | 0.138 s | 28.68 | 0.093 s | 28.63 |
| Tower | 2.116 s | 32.85 | 2.583 s | 32.85 | 1.149 s | 33.43 |
| Room | 0.242 s | 13.68 | 0.186 s | 13.68 | 0.164 s | 13.68 |
| Parameter | Value | Description |
|---|---|---|
max_iter | 500,000 | Bi-RRT max iterations |
step_size | 0.5 m | RRT steer & greedy-connect step |
p_goal | 0.05 | Goal-bias sampling probability |
connect_thr | step / 2 | Tree connection gap threshold |
grid_res | 0.5 m | A* voxel grid resolution |
| Connectivity | 26-neighbor | Β±1 in x, y, z axes |
weight w | 1.0 / 1.2 / 1.5 | A* heuristic inflation factor |