setRunToPositionController

Set a system controller to use for RUN_TO_POSITION.

The coefficients of this controller can be gain scheduled through scheduleRunToPositionGains. Otherwise, you can adjust the coefficients directly on the controller instance and they will be respected, unless a gain scheduler is set for this controller.

Note that when using a motor with this class, the PIDF coefficients attached to the motor itself will be used only if a controller is not specified, and will only take a snapshot at runtime of these values to populate a controller, making a fallback default PID controller to use. The SDK PIDF values are otherwise ignored. Falling back on a default controller will also push a robot global warning as it is highly dangerous to use the stock PIDF values in this context. Set your own controller using this method.

Parameters

controller

the controller to use, recommended to use a closed-loop controller such as PID