DWA¶
python_motion_planning.local_planner.dwa.DWA
¶
Bases: LocalPlanner
Class for Dynamic Window Approach(DWA) 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'
|
heading_weight
|
float
|
weight for heading cost |
0.2
|
obstacle_weight
|
float
|
weight for obstacle cost |
0.1
|
velocity_weight
|
float
|
weight for velocity cost |
0.05
|
predict_time
|
float
|
predict time for trajectory |
1.5
|
obstacle_inflation_radius
|
float
|
inflation radius for obstacles |
1.0
|
v_resolution
|
float
|
velocity resolution in evaulation |
0.05
|
w_resolution
|
float
|
angular velocity resolution in evaulation |
0.05
|
**params
|
other parameters can be found in the parent class LocalPlanner |
{}
|
Examples:
>>> from python_motion_planning.utils import Grid
>>> from python_motion_planning.local_planner import DWA
>>> start = (5, 5, 0)
>>> goal = (45, 25, 0)
>>> env = Grid(51, 31)
>>> planner = DWA(start, goal, env)
>>> planner.run()
References
[1] The Dynamic Window Approach to Collision Avoidance.
calDynamicWin()
¶
Calculate dynamic window.
Returns:
Name | Type | Description |
---|---|---|
v_reference |
list
|
reference velocity |
evaluation(vr, goal)
¶
Extract the path based on the CLOSED set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
closed_set
|
list
|
CLOSED set |
required |
goal
|
tuple
|
goal point coordinate |
required |
Returns:
Name | Type | Description |
---|---|---|
cost |
float
|
the cost of planning path |
path |
list
|
the planning path |
generateTraj(v, w)
¶
Generate predict trajectory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
v
|
float
|
velocity |
required |
w
|
float
|
angular velocity |
required |
Returns:
Name | Type | Description |
---|---|---|
v_reference |
ndarray
|
reference velocity |
plan()
¶
Dynamic Window Approach(DWA) motion plan function.
run()
¶
Running both plannig and animation.