Skip to content

Repository files navigation

RiskPlanning.jl

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.

Requirements

  • 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

Setup

From the repository root:

julia --project=. -e 'using Pkg; Pkg.instantiate()'

Optional precompile step:

julia --project=. -e 'using Pkg; Pkg.precompile()'

DrWatson

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.

Quick Start

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."
end

For an interactive local window, load and activate GLMakie in your script before display:

using GLMakie

GLMakie.activate!()
display(GLMakie.Screen(), fig)

Running Tests

Run the package test suite with:

julia --project=. test/runtests.jl

The 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.

Repository Layout

  • src/RiskPlanning.jl: module entrypoint and public exports
  • src/planners/RRT.jl: RRTStar implementation and core tree expansion logic
  • src/planners/BIT.jl: BITStar implementation
  • src/planners/AIT.jl: AITStar implementation
  • src/planners/informed_search_utils/: informed-search helpers, heuristics, pruning, edge caches, and batch state
  • src/risk_costs_definitions.jl: risk and cost model types such as RDProb, RDRisk, and RDProbHybrid
  • src/risk_computation.jl: forward and inverse risk-cost computations and steering logic
  • src/collision_checking.jl: deterministic and probabilistic collision checks
  • src/neighbor_finders.jl: nearest-neighbor abstractions and implementations
  • src/sampling_utils.jl: UniformSampler, FrontierSampler, MahalanobisFrontierSampler, and related hooks
  • src/scenarios.jl: predefined and generated planning scenarios
  • src/plotting.jl: scenario and solution plotting helpers
  • src/mujoco.jl: utilities for MuJoCo experiment bundles
  • scripts/: benchmark, analysis, plotting, and reproduction scripts
  • test/: package tests included by test/runtests.jl

Main Concepts

  • 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.

Benchmarks And Analysis

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.jl

Analysis scripts live under scripts/analysis_*.jl. For example:

julia --project=. scripts/analysis_b7_timing_breakdown.jl

Most scripts call @quickactivate "RiskPlanning", but running them from the repository root with --project=. is still recommended.

License

This project is licensed under the MIT License. See LICENSE for details.

About

# Motion planning with a twist

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages