Skip to main content Link Menu Expand (external link) Document Search Copy Copied

DriveController& setSpeedCurve(std::function<double(double)> speedCurve)

Sets the speed curve to the given function.

Parameters

  • speedCurve - The speed curve for the function

Example

//use a quadratic speed curve
DriveController dc = DriveController(&chassis);
dc.setSpeedCurve([](double pct) {
    pct /= 10.0;
    pct *= pct * sign(pct);
    return pct;
});