Skip to main content

plan

Function plan 

Source
pub fn plan(
    axes: &[AxisInfo],
    start: &[f64],
    pieces: &[Piece],
    cycle: f64,
    tolerance: impl Into<Tolerance>,
    slack: f64,
) -> Result<Vec<(f64, Vec<f64>)>, CommandError>
Expand description

Plans the timing of a path within the velocity, acceleration and jerk limits of every axis, from rest to rest.

Each piece gets one speed, acceleration and jerk limit along the path that hold on all of it (limits), and each junction a highest speed (junction_speed). Look-ahead then lowers the junction speeds until every piece is long enough to change from the speed at its start to the speed at its end; a tight arc or a corner far ahead so slows the pieces before it. On each piece the speed goes by a jerk-limited ramp to the highest speed the piece has room for, stays there, and goes by a second ramp to the speed at its end.

With a tolerance above zero the path gets transition curves first (blend), which let it pass from a line into an arc at speed, and is off the given pieces by up to the tolerance (deviation says by how much).