This project utilizes weighted A* and RRT to have our agent compute a minimal cost path from a specified start point to a specified goal point. Our agent is required to find this path while avoiding obstacles and without stepping outside of boundaries. We use search-based and sampling-based planning algorithms to solve this problem, namely, weighted A* and Rapidly exploring Random Tree (RRT), respectively.
This was implemented in Python using NumPy. The code has been redacted, if you wish to see it, you may contact me at charles.lychee@gmail.com
Single Cube |
Window |
Monza |
Flappy |
Room |
Maze |
Tower |
Single Cube |
Window |
Monza |
Flappy |
Room |
Maze |
Tower |
We formulate the problem as a Deterministic Shortest Path (DSP) problem.
Find the path between start node
This algorithm is essentially an informed version of Djikstra's algorithm. We inform this algorithm by provide a heuristic function
We choose the heuristic function to be
We can bias our search to trust the heuristic more by weighting the heuristic function by
This algorithm is not optimal, however, it usually will result in significantly less nodes considered than A*. This is because RRT doesn't need to search node by node, but instead, samples nodes from the full vertex set and connects them to existing paths. This also results in paths generated by RRT to be jagged.
We expect time complexity of A* to be
We cannot assigned a time complexity or space complexity to RRT because it randomly samples nodes for its search.
The observed runtimes are as follows:
Algorithm | Map | Num Considered Nodes | Runtime |
---|---|---|---|
A* | Single Cube | 726 | 0.537 |
A* | Maze | 1149017 | 867.836 |
A* | Flappy Bird | 41727 | 26.116 |
A* | Monza | 67038 | 64.614 |
A* | Window | 3851 | 1.982 |
A* | Tower | 12816 | 12.416 |
A* | Room | 37332 | 36.465 |
RRT | Single Cube | 83 | 0.0428 |
RRT | Maze | 145475 | 143.999 |
RRT | Flappy Bird | 6382 | 3.434 |
RRT | Monza | 605665 | 373.060 |
RRT | Window | 2137 | 1.551 |
RRT | Tower | 15118 | 10.177 |
RRT | Room | 2561 | 1.590 |