This Julia package provides implementations of two popular sampling-based path planning algorithms:
- Rapidly exploring random tree (RRT)
![]() |
|---|
- Probabilistic roadmap (the simplified, k-nearest variant: k-Nearest sPRM)
![]() |
|---|
This package is not registered, but you can install it using Julia's Pkg package manager:
(@v1.10) pkg> add https://github.com/B0B36JUL-FinalProjects-2024/Project_draholeo-
Define your
PlanningSpaceusing PathFinder dimension_of_my_configuration_space = 2 limits_matrix_of_my_configuration_space = [0 1; 0 1] my_collision_checker = conf -> false # environment with no obstacles ps = PlanningSpace( dim=dimension_of_my_configuration_space, limits=limits_matrix_of_my_configuration_space, collision_check=my_collision_checker, collision_resolution=0.01)
where:
PlanningSpace.dimis the dimension of the configuration spacePlanningSpace.limitsis (dim, 2)Matrixwith [min, max] for each dimensionPlanningSpace.collision_checkis a user-defined function that takes a configuration (a dim-dimensional vector) as input and returnstrueif the configuration is in collision with an obstacle, otherwisefalsePlanningSpace.collision_resolutiondefines the resolution at which the planner checks for collisions along a path (smaller values result in finer collision checks but may slow down planning)
-
Select your favorite planner
planner = RRTPlanner(step_size=0.05, max_iters=10000, tolerance=0.05)
or
planner = PRMPlanner(roadmap_size=200, k_neighbors=8)
-
Run the
planfunctionstart_conf = [0.1, 0.1] goal_conf = [0.9, 0.9] path, graph = plan(start_conf, goal_conf, ps, planner)
which returns:
pathfrom start_conf to goal_conf ((dim, num_of_waypoints)Matrix{Float64}) ornothingif the planning algorithm could not find a collision-free pathgraphwhich is either aPathFinder.Graphfor PRM algorithm orPathFinder.Treefor RRT algorithm
For a complete working example, see examples/example.jl.
Leoš Drahotský (draholeo@fel.cvut.cz)
This project is licensed under the MIT License - see the LICENSE file for details.

