Module rrtTree :: Class RRTTreeXYOrientationEuclidDist
[hide private]
[frames] | no frames]

Class RRTTreeXYOrientationEuclidDist

source code


Implements a simple RRT, which assumes a state is (x,y,orientation), and the distance between two states is euclidean, after normalizing their attributes to a similar scale.

Instance Methods [hide private]
 
__init__(self, initialShipState, distanceUnit, angleUnit)
Initialize the tree.
source code
 
addNode(self, node)
Adds a new node to the tree.
source code
 
getPathTo(self, currentState)
Returns a path (a sequence of actions) from root to currentState.
source code
 
getNodesPathTo(self, currentState)
Returns a path OF NODES from root to currentState.
source code
 
findClosestNode(self, newState)
Find closest node in the RRT w.r.t.
source code
Method Details [hide private]

__init__(self, initialShipState, distanceUnit, angleUnit)
(Constructor)

source code 
Initialize the tree.

Keyword arguments:
initialShipState -- initial ShipExternalState that would be 
                    the root of the tree

distanceUnit -- 
angleUnit -- Both are used for normalization of x, y and angle
             to the same scale, to determine similarity (or distance)
             between two points (x1, y1, ang1) and (x2, y2, ang2).
             These could be, for instance, the amount of distance / orientation
             a ship can travel in a given time unit.

addNode(self, node)

source code 

Adds a new node to the tree.

Overrides: RRTTree.addNode
(inherited documentation)

getPathTo(self, currentState)

source code 

Returns a path (a sequence of actions) from root to currentState.

Overrides: RRTTree.getPathTo

findClosestNode(self, newState)

source code 

Find closest node in the RRT w.r.t. x, y, orientation. 
Distance is euclidean, where x, y and orientation are
normalized.

Keyword arguments:
newState -- ShipExternalState that is going to be part of the
            new tree node.

Returns:
RRTNode which is the noded closest to 'newState' in the current RRT

Overrides: RRTTree.findClosestNode