#include <dstar.h>
Inheritance diagram for DStar:

Public Member Functions | |
| DStar (OGrid *grid) | |
| First time search. | |
| bool | search (motion_chain &path, motion start, motion goal) |
| Incremental searches. | |
| bool | research (motion_chain &path, motion start, node_chain &changed_nodes) |
| void | update_nodes (node_chain &changed_nodes) |
| incrementally updates all nodes whose cost has changed. | |
| bool | valid () |
| returns false if path is now blocked and needed to be recalculated via research. | |
| void | dump (void) |
| uint8 | cost (int i, int j) |
| return cost of location x,y | |
| int | cost (int x, int y, CELL_STATE ctype, node_chain *shadow_nodes=NULL) |
| Node * | node (uint8 x, uint8 y) |
| void | InitStar (void) |
| void | path_flag (motion_chain &path) |
| Mark all segments in motion chain as within path. | |
Protected Member Functions | |
| DStar (void) | |
| void | GetChildren (Node *n, Node *child[EDGES+1]) |
| void | mark (int x, int y) |
Protected Attributes | |
| Node | _field [MAX_STAR_NODES] |
| OGrid * | _ogrid |
Private Member Functions | |
| void | Update_Keys (Node *) |
| void | update_succ (int) |
| void | Initialize () |
| Priority | CalculateKey (Node *) |
| bool | ComputeShortestPath () |
| void | UpdateVertex (Node *) |
| Node * | MinSucc (Node *s, int &G) |
| void | GetPred (Node *u, Node *child[EDGES+1]) |
| void | GetSucc (Node *u, Node *child[EDGES+1]) |
| Node * | Min (Node *s) |
| int | MinSuccCost (Node *s) |
| bool | GetPath (motion_chain &) |
| void | InitDstar (void) |
Private Attributes | |
| PriorityQueue | U |
| int | K_m |
| Node * | start |
| Node * | goal |
Friends | |
| class | PriorityQueue |
Original code was based upon Sven Koenig's "Improved Fast Replanning for Robot Navigation in Unknown Terrain" (2002). I started with the optimized, but couldn't get it to work; switched to basic, and still couldn't get it to work. ARRRGGGGHHHHH!!!!!!!!!!!!! Of course a single search works fine.
Most D* algorithms assumes if you have 1 node (u) centered around 4 nodes (a,b,c,d), then you have a cost between every node: c(u,a), c(u,b), c(u,c), c(u,d). Whereas I simply treat node costs like a terrain cost--thus node--not edge giving the result c(u,a) = c(u,b) = c(u,c) = c(u,d). Thus, other Dstar implementation had cost[EDGES] whereas I only have cost. Finally, the consequence of this is that any reference to c(u,v) in psuedocode can be replace with c(u). This has one other suspicious consequence in line {44} rhs(u) = min(rhs(u),c(u,v) + g(v)). Indeed, is this equalvalentto rhs(u) = min(rhs(u),c(u)+g(u)) since there is no edge involved? Remarks Order of operation to do incremental search
|
|
First time search.
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||
|
set cost of node location x,y. incrementally updates all nodes whose cost has changed. |
|
||||||||||||
|
return cost of location x,y
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
cost has range 0..255; 0 is clear, and 255 is "absolute" obstacle (whatever that means). Can recommend areas not to take by setting cell to a value less than the MINIMUM_OBSTACLE value. Once the value exceeds MINIMUM_OBSTACLE, then the cell will not be evaluated in the A* algorithm. |
|
||||||||||||
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
||||||||||||
|
Return Node at location x,y. (I forget why I needed this). Fills in a node with Terrain type specified. |
|
|
Mark all segments in motion chain as within path.
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
Incremental searches.
|
|
|
|
|
|
incrementally updates all nodes whose cost has changed. this is done this way because the node_chain is only so big, so this allows nodes to be updated incrementally. Reimplemented from Star. |
|
|
|
|
|
|
|
|
returns false if path is now blocked and needed to be recalculated via research.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3