Everything is in real time. FrameRate set to fixed at 60 since nothing is very hard to calculate.
This path planning animation is created using PRM and A*. It works as adding a point to the graph and check if the point is valid, then add edges that are less than a constant length and then check if the edge is valid. Repeating this process untill a path to the goal if found by A* search. The user can add obstacles to the graph at any time. When an obstacle is added, edges and vertices that are violated is deleted. The user also have the ability to change the start and end node at any time. The heristics funtion we used is a simple function that returns the distance between the current vertice and the end vertice.
We did not face any large problems. But we encoutered a lot of small problem that are most due small errors. However among all of them there are a few that are worth noticing. The first problem we faced was to detect if an edge is colliding with the obstacle. This was quickly fixed after doing some google search and reading some mathematical solutions. The results are satisfiying. Another problem that is worth noticing is details about A* search. We are familiar with A* search in lisp, but we never implemented it in other languages. So a lot of details that in lisp is easily dealed with, java was not. So we spend a lot of time trying to make the code from lisp into java. After numerous trials we finally have a working version.
We implemented a mode based control system, after any operation, the mode will be reset to mode 0 which is the default mode.
Modes
0 | Normal mode | shortcut: na |
1 | replace start mode | shortcut: s |
2 | replace end node | shortcut: g |
3 | add vertice | shortcut: v |
4 | agent start to move | shortcut: p |
5 | reset agent location | shortcut: r |
6 | add obstacles | shortcut: o |
7 | generate a valid map | shortcut: m |
8 | clear the map | shortcut: c |
Thanks for Lucygirl88 from deviantart for the sprite sheet we used for the animated walking agent.
deviantart
Real-time implementation. FrameRate set to fixed at 60.
This animation is created using Optimal Rapidly exploring random tree(RRT). It works as generating a random vertice in the graph and then generate new vertice according to this random vertice and eta(constant). And detecting whether there is a collision with obstacles and boundary. If not, add this new vertice to the graph and add edge from nearest to this new vertice to the collection of edges. Else, give up this vertice. Add vertice and optimize graph until find the path from start to the final. Finally, animate agent.
Real-time implementation. FrameRate set to fixed at 60.
This animation is created using Optimal Rapidly exploring random tree(Optimal RRT). It works as generating a random vertice in the graph and then generate new vertice according to this random vertice and eta(constant). And detecting whether there is a collision with obstacles. If not, add this new vertice to the graph and generate collection of near vertices according to this new vertice. Next step, optimize edges in the collection of edges of RRT by evaluating the cost of new point and related edges and near vertices one by one. Else, give up this vertice.