Skip to main content

interpolate_bspline_path

Function interpolate_bspline_path 

Source
pub fn interpolate_bspline_path(
    x: &[f64],
    y: &[f64],
    n_path_points: usize,
    degree: usize,
) -> Option<BSplinePath>
Expand description

Generate an interpolating B-spline path.

Uses chord-length parameterisation so the resulting curve passes through all given waypoints (like interpolate_b_spline_path in PythonRobotics).

§Arguments

  • x - x coordinates of waypoints
  • y - y coordinates of waypoints
  • n_path_points - number of output sample points
  • degree - B-spline degree (must satisfy 1 <= degree <= n_waypoints - 1)

§Returns

A BSplinePath or None if the inputs are invalid.