acmerobotics / road-runner-quickstart

FTC quickstart for https://github.com/acmerobotics/road-runner
BSD 3-Clause Clear License
168 stars 855 forks source link

Custom Spline :00000 V1.0 #337

Open IKKNIGHT opened 6 months ago

IKKNIGHT commented 6 months ago

Need Custom Spline rn rn rn V1.0

IKKNIGHT commented 6 months ago

image Reality

image Expectation

rbrott commented 6 months ago

You can drop down to the low-level spline API to have more control over derivatives:

        QuinticSpline1d xSpline = new QuinticSpline1d(
                new DualNum<>(new double[]{ x_0, dx_0, d2x_0 }),
                new DualNum<>(new double[]{ x_1, dx_1, d2x_1 })
        );
        QuinticSpline1d ySpline = new QuinticSpline1d(
                new DualNum<>(new double[]{ y_0, dy_0, d2y_0 }),
                new DualNum<>(new double[]{ y_1, dy_1, d2y_1 })
        );
        QuinticSpline2d spline = new QuinticSpline2d(xSpline, ySpline);

A QuinticSpline2d in Road Runner world is more like a quintic spline segment that just goes between two knots.