RiskPlanning.jl is a Julia package for risk-aware motion planning with uncertain obstacles. It contains RRT*-style and informed sampling planners, risk-density cost models, collision checking utilities, plotting helpers, and scripts used to run benchmarks and reproduce paper figures.
The main package is intended to be usable in both interactive desktop sessions and headless environments. Package-level plotting uses CairoMakie; scripts that need an interactive window can explicitly activate GLMakie.
- Julia 1.11.6 or newer 1.x release
- A local clone of this repository
- Optional: OpenGL/display support if running scripts that use
GLMakie
From the repository root:
julia --project=. -e 'using Pkg; Pkg.instantiate()'Optional precompile step:
julia --project=. -e 'using Pkg; Pkg.precompile()'This project uses DrWatson.jl for project activation and reproducible paths in scripts. Most scripts start with @quickactivate "RiskPlanning", and generated benchmark data or figures are typically written relative to the project with DrWatson helpers such as datadir, plotsdir, and srcdir.
Running scripts from the repository root with --project=. is still recommended so the local environment and manifest are used consistently.
This example runs the paper scenario with RRTStar and saves a plot using the headless-safe Cairo backend.
using CairoMakie
using RiskPlanning
problem = get_paper_scenario()
planner = RRTStar(
n_samples = 5000,
sampler = FrontierSampler(goal_bias = 0.05),
)
solution = plan!(planner, problem, make_ntree_finder)
if is_successful(solution)
summarize_solution(solution, problem, planner)
fig = plot_solution(problem, solution)
mkpath("plots")
save("plots/example_solution.png", fig)
else
@error "Planning failed to find a solution."
endFor an interactive local window, load and activate GLMakie in your script before display:
using GLMakie
GLMakie.activate!()
display(GLMakie.Screen(), fig)Run the package test suite with:
julia --project=. test/runtests.jlThe current test entrypoint is test/runtests.jl. It includes regression tests for neighbor finding, informed search behavior, benchmark configuration, convergence history, scenario specs, and MuJoCo bundle serialization.
src/RiskPlanning.jl: module entrypoint and public exportssrc/planners/RRT.jl:RRTStarimplementation and core tree expansion logicsrc/planners/BIT.jl:BITStarimplementationsrc/planners/AIT.jl:AITStarimplementationsrc/planners/informed_search_utils/: informed-search helpers, heuristics, pruning, edge caches, and batch statesrc/risk_costs_definitions.jl: risk and cost model types such asRDProb,RDRisk, andRDProbHybridsrc/risk_computation.jl: forward and inverse risk-cost computations and steering logicsrc/collision_checking.jl: deterministic and probabilistic collision checkssrc/neighbor_finders.jl: nearest-neighbor abstractions and implementationssrc/sampling_utils.jl:UniformSampler,FrontierSampler,MahalanobisFrontierSampler, and related hookssrc/scenarios.jl: predefined and generated planning scenariossrc/plotting.jl: scenario and solution plotting helperssrc/mujoco.jl: utilities for MuJoCo experiment bundlesscripts/: benchmark, analysis, plotting, and reproduction scriptstest/: package tests included bytest/runtests.jl
PlanningProblem: start, goal, workspace, collision checker, and boundary-value problem.PlannerSolution: output tree, path, costs, status, timing, and convergence history.RRTStar,BITStar,AITStar: planner implementations exposed by the package.NeighborFinder: spatial data structure abstraction used by planners for nearest and range queries.AbstractSampler: sampler interface used to swap exploration strategies without changing planner logic.RiskCosts: cost models for risk-density planning under uncertainty.
Benchmark scripts live under scripts/benchmarks/. Examples:
julia --project=. scripts/benchmarks/benchmark1_anytime_5000.jl
julia --project=. scripts/benchmarks/benchmark7_timing_breakdown.jl
julia --project=. scripts/benchmarks/benchmark9_mujoco_rd_probability.jlAnalysis scripts live under scripts/analysis_*.jl. For example:
julia --project=. scripts/analysis_b7_timing_breakdown.jlMost scripts call @quickactivate "RiskPlanning", but running them from the repository root with --project=. is still recommended.
This project is licensed under the MIT License. See LICENSE for details.