File-By-File
AngleDeltaController

AngleDeltaController

This controller is designed specifically for operations where the robot is being fed angles in degrees or radians. This controller requires a coefficient to be provided. This coefficient will be multiplied by the minimum angle delta.

For example, let's say the robot is currently facing 90 degrees. We want the robot to face 135 degrees. This controller will calculate that the robot must turn 45 degrees, and then multiply that number (45) by whatever coefficient you provide. This number should typically be very low, but it'll require some testing to get it right.

This controller can operate in one of two modes. Firstly, there's the degrees mode. Secondly, there's the radians mode. By default, unless you specify otherwise, the controller will operate in degrees mode. Anyways. When the calculate(double) method is called, it will generate a delta and a coefficient. If the controller is in degrees mode, the delta will be the amount of degrees between the two angles. If the controller is in radians mode, the delta will be the amount of radians between the two angles. Pretty neat, right? Of course it is.

Methods

AngleDeltaController(double coefficient)

Creates a new AngleDeltaController. By default, this controller will be set to degrees mode.

AngleDeltaController(double coefficient, Angle.AngleUnit angleUnit)

Creates a new AngleDeltaController. This constructor allows you to select either degrees or radians mode.

calculate(double value)

Calculates the output of the controller.