robust_planning/lib.rs
1//! # Robust planning
2//!
3//! Planning over reachable sets under uncertainty: Robust-RRT and reachability-guided search.
4//!
5//! Every check in this crate is conservative. A check that cannot prove safety answers
6//! [`SafetyVerdict::Indeterminate`], never [`SafetyVerdict::Safe`], and planners reject
7//! anything that is not proven safe.
8//!
9//! ## Building blocks
10//!
11//! - [`Reach`]: propagates a reachable set along one edge under one control. The crate defines
12//! the trait; implementations come from the user.
13//! Its optional [`Reach::certify_collision`] hook lets a model whose sets are exact turn an
14//! unproven edge into [`SafetyVerdict::Unsafe`] with a [`Witness`]; [`check_edge`] runs
15//! one edge check.
16//! - [`Steer`]: picks the control of one edge. Implement it on the model, or pair a model
17//! with a steering function through [`WithSteering`]; `sampling-planning`'s
18//! [`StraightLine`](sampling_planning::StraightLine) steers models whose control is a
19//! setpoint.
20//! - [`Cost`]: how planners price an edge: the nominal length, or the length plus a weight
21//! times the width of the edge's end set (a robustness-weighted cost).
22//! - [`Obstacles`]: polytope obstacles, checked against reachable sets with optional
23//! refinement by splitting.
24//! - [`Goal`]: a goal region tested against whole reachable sets. [`PolytopeGoal`] is a
25//! convex polytope in H-representation; it answers
26//! [`Containment::Inside`](polyzonotope::Containment::Inside) only when the set is proven
27//! inside.
28//! - [`proven_within`] and [`decide_within`]: prove one set inside a zonotope in up to four
29//! dimensions, through polyzonotope's set-in-polytope test on an inner
30//! H-representation with rigorously rounded facets.
31//! - [`ReachChecker`]: a [`sampling_planning::ValidityChecker`] that runs a [`Reach`] model
32//! along each motion, so `sampling-planning`'s planners only accept proven-safe edges.
33//! - [`RobustRrt`]: an RRT whose nodes carry the reachable set they are reached with.
34//! - [`RobustRrtStar`]: the RRT* variant of [`RobustRrt`]. Choose-parent and rewiring accept
35//! only proven-safe edges, and a rewire re-propagates and re-proves the whole moved
36//! subtree before it commits.
37//! - [`ReachSearch`]: A* over reachable-set nodes along a fixed set of motion primitives,
38//! expanding only proven-safe edges, with deduplication on a lattice of nominal states.
39//!
40//! ## The `sound` feature
41//!
42//! Without `sound`, polyzonotope computes in plain `f64`, so [`SafetyVerdict::Safe`] means
43//! "safe up to floating-point rounding". Only with `sound` (outward rounding) is it a proof.
44//! See `docs/design.md`.
45//!
46//! Repository: <https://github.com/sunsided/robust-planning>
47
48#![forbid(unsafe_code)]
49
50mod checker;
51pub mod containment;
52mod cost;
53mod goal;
54mod node;
55mod obstacles;
56mod reach;
57pub mod robust_rrt;
58pub mod robust_rrt_star;
59pub mod search;
60mod steer;
61mod verdict;
62
63pub use checker::ReachChecker;
64pub use containment::{decide_within, proven_within};
65pub use cost::Cost;
66pub use goal::{Goal, PolytopeGoal};
67pub use node::Node;
68pub use obstacles::Obstacles;
69pub use reach::{Reach, check_edge};
70pub use robust_rrt::RobustRrt;
71pub use robust_rrt_star::RobustRrtStar;
72pub use search::ReachSearch;
73pub use steer::{Steer, WithSteering};
74pub use verdict::{SafetyVerdict, Witness};
75
76pub use polyzonotope;
77pub use sampling_planning;