pub struct Dubins { /* private fields */ }Expand description
The Dubins car: SE(2) poses (Se2State) of a vehicle that drives only forward, at unit
speed, with a minimum turning radius.
StateSpace::distance is the length of the shortest Dubins path and
StateSpace::interpolate follows that path. Ported from OMPL’s DubinsStateSpace
(Mark Moll), with the exhaustive search over all six words instead of OMPL’s
classification shortcut for long paths: both return the shortest word. As in OMPL, poses
closer than 1e-6 turning radii with headings within 1e-6 radians count as coincident:
their distance is the position distance, not the loop a real car would need.
The distance is not symmetric: d(a, b) is the length from a to b, which differs
from the way back. Planners that measure from tree nodes toward targets (RRT, RRT*, RRT#,
SST) are fine; see StateSpace::distance for the planners that need symmetry. It does
satisfy the triangle inequality.
StraightLine steering works as is: it interpolates the fraction
max_step / d of the way, and a prefix of a shortest path is a shortest path, so the steered
state is max_step away along the curve.
§Examples
use sampling_planning::{Dubins, Se2State, StateSpace};
let car = Dubins::new(1.0);
let half_loop = car.distance(&Se2State::new(0.0, 0.0, 0.0), &Se2State::new(0.0, 2.0, std::f64::consts::PI));
assert!((half_loop - std::f64::consts::PI).abs() < 1e-9);Implementations§
Source§impl Dubins
impl Dubins
Sourcepub fn new(radius: f64) -> Self
pub fn new(radius: f64) -> Self
The Dubins car with the given minimum turning radius.
§Panics
Panics if radius is not positive and finite.
Sourcepub fn path(&self, from: &Se2State, to: &Se2State) -> DubinsPath
pub fn path(&self, from: &Se2State, to: &Se2State) -> DubinsPath
The shortest Dubins path from from to to; the earliest of
DubinsWord::ALL on ties.
§Panics
Never for finite poses: LSL and RSR always have a solution. Non-finite poses panic.
Sourcepub fn candidates(
&self,
from: &Se2State,
to: &Se2State,
) -> [Option<DubinsPath>; 6]
pub fn candidates( &self, from: &Se2State, to: &Se2State, ) -> [Option<DubinsPath>; 6]
Every feasible word from from to to, in DubinsWord::ALL order; None where a
word has no solution (the CCC words when the poses are far apart, for example).
Trait Implementations§
impl Copy for Dubins
Source§impl StateSpace for Dubins
impl StateSpace for Dubins
Source§fn dimension(&self) -> usize
fn dimension(&self) -> usize
Source§fn distance(&self, from: &Se2State, to: &Se2State) -> f64
fn distance(&self, from: &Se2State, to: &Se2State) -> f64
Source§fn is_euclidean(&self) -> bool
fn is_euclidean(&self) -> bool
StateSpace::distance is the Euclidean norm of
their difference and StateSpace::interpolate the straight line. Read more