Rapidly-exploring Random Tree (RRT)¶
The RRT (Rapidly-exploring Random Tree) solver implements the classic incremental tree-growth motion planning algorithm. It explores continuous configuration spaces by iteratively sampling random points, finding their nearest neighbor in the tree, steering toward the sample by a step size
, and adding valid nodes/edges to the roadmap.
Architectural Design & Algorithm Flow¶
Base Contract: Inherits from
SamplingSolver.Multi-Robot C-Space: Operates in composite
-dimensional configuration space using Point_drepresentations, enabling joint single- and multi-robot tree expansion.Steering Function: Implements
steer(p_near, p_rand, eta)to project incremental motion vectors bounded by step length
.Roadmap Construction:
build_roadmap()initializes the tree root at the start configuration, repeatedly samples free configurations via injectedSampler, queriesNearestNeighbors, performs collision verification on edges, and attempts final connection to the goal configuration.
RRT Incremental Tree Expansion Flow¶
Parameters & Configuration¶
Usage Example¶
from discopygal.solvers.rrt.rrt import RRT
from discopygal.solvers_infra import Scene
# Load scene and construct solver
solver = RRT.init_solver(num_landmarks=1500, eta=0.5)
path_collection = solver.solve(scene)
API Reference¶
- class discopygal.solvers.rrt.rrt.RRT(num_landmarks, eta, **kwargs)¶
Bases:
SamplingSolverImplementation of the plain RRT algorithm. Supports multi-robot motion planning, though might be inefficient for more than two-three robots.
- Parameters:
num_landmarks (
int) – number of landmarks to sampleeta (
FT) – maximum distance when steeringnearest_neighbors (
NearestNeighborsorNone) – a nearest neighbors algorithm. if None then use sklearn implementationmetric (
MetricorNone) – a metric for weighing edges, can be different then the nearest_neighbors metric! If None then use euclidean metricsampler (
Sampler) – sampling algorithm/method. if None then use uniform sampling
- build_roadmap() Roadmap¶
Constructs the roadmap of points in the configuration space which a path will be searched on to find a solution. Every sampling solver should implement how to build the roadmap.
- Returns:
The built roadmap. Each node represents a point in configuration space (dimension = 2*robots_num)
- Return type:
- classmethod get_arguments()¶
Return a list of arguments and their description, defaults and types. Can be used by a GUI to generate fields dynamically. Should be overridded by solvers.
- Returns:
arguments dict
- Return type:
dict