RRTConnect¶
python_motion_planning.global_planner.sample_search.rrt_connect.RRTConnect
¶
Bases: RRT
Class for RRT-Connect motion planning.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
start
|
tuple
|
start point coordinate |
required |
goal
|
tuple
|
goal point coordinate |
required |
env
|
Env
|
environment |
required |
max_dist
|
float
|
Maximum expansion distance one step |
0.5
|
sample_num
|
int
|
Maximum number of sample points |
10000
|
goal_sample_rate
|
float
|
heuristic sample |
0.05
|
Examples:
Python Console Session
>>> import python_motion_planning as pmp
>>> planner = pmp.RRTConnect((5, 5), (45, 25), pmp.Map(51, 31))
>>> cost, path, expand = planner.plan() # planning results only
>>> planner.plot.animation(path, str(planner), cost, expand) # animation
>>> planner.run() # run both planning and animation
References
[1] RRT-Connect: An Efficient Approach to Single-Query Path Planning
extractPath(boundary, sample_list_b, sample_list_f)
¶
Extract the path based on the CLOSED set.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
boundary
|
Node
|
the boundary node |
required |
sample_list_b
|
dict
|
Sample list backward |
required |
sample_list_f
|
dict
|
Sample list forward |
required |
Returns:
Name | Type | Description |
---|---|---|
cost |
float
|
the cost of planning path |
path |
list
|
the planning path |
getExpand(sample_list_b, sample_list_f)
¶
Get the expand list from sample list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sample_list_b
|
list
|
Sample list backward |
required |
sample_list_f
|
list
|
Sample list forward |
required |
Returns:
Name | Type | Description |
---|---|---|
expand |
list
|
expand list |
plan()
¶
RRT-Connected motion plan function.
Returns:
Name | Type | Description |
---|---|---|
cost |
float
|
path cost |
path |
list
|
planning path |
expand |
list
|
expanded (sampled) nodes list |