LPAStar¶
python_motion_planning.global_planner.graph_search.lpa_star.LPAStar
¶
Bases: GraphSearcher
Class for LPA* motion planning.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
tuple
|
start point coordinate |
required |
goal
|
tuple
|
goal point coordinate |
required |
env
|
Env
|
environment |
required |
heuristic_type
|
str
|
heuristic function type |
'euclidean'
|
Examples:
Python Console Session
>>> import python_motion_planning as pmp
>>> planner = pmp.LPAStar((5, 5), (45, 25), pmp.Grid(51, 31))
>>> cost, path, _ = planner.plan() # planning results only
>>> planner.plot.animation(path, str(planner), cost) # animation
>>> planner.run() # run both planning and animation
References
[1] Lifelong Planning A*
OnPress(event)
¶
Mouse button callback function.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
event
|
MouseEvent
|
mouse event |
required |
calculateKey(node)
¶
Calculate priority of node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node
|
LNode
|
current node |
required |
Returns:
Name | Type | Description |
---|---|---|
key |
list
|
priority of node |
computeShortestPath()
¶
Perceived dynamic obstacle information to optimize global path.
extractPath()
¶
Extract the path based on greedy policy.
Return
cost (float): the cost of planning path path (list): the planning path
getNeighbor(node)
¶
Find neighbors of node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node
|
LNode
|
current node |
required |
Returns:
Name | Type | Description |
---|---|---|
neighbors |
list
|
neighbors of node |
plan()
¶
LPA* dynamic motion planning function.
Returns:
Name | Type | Description |
---|---|---|
cost |
float
|
path cost |
path |
list
|
planning path |
_ |
None
|
None |
run()
¶
Running both plannig and animation.