You can either create a new tiny class specifically to be used as your PIDOutput class, or you can have your robot class be that class too by using a line like this on your Robot class definition.
Code:
public class Robot extends SampleRobot implements PIDOutput {
Then you need to implement pidWrite() which tells the PID what you want to do with the output.
In your case, copying a line from above I assume you will want this:
Code:
@Override
/* This function is invoked periodically by the PID Controller, */
/* based upon navX-MXP yaw angle input and PID Coefficients. */
public void pidWrite(double output) {
Drive( output, 1.0 );
}
If the error between your setpoint and the gyro angle was 90 degrees or more you would want full 1.0 power, so I would start with a P constant of 1.0 / 90. So 0.01 should be a good starting place.
When you set your gyro up, here are some other suggestions straight from their example:
Code:
turnController.setInputRange(-180.0f, 180.0f);
turnController.setOutputRange(-1.0, 1.0);
turnController.setAbsoluteTolerance(2.0);
turnController.setContinuous(true);
Last, if you are trying to go to 0, then call
Code:
turnController.setSetpoint( 0.0 );
and to turn the controller on use,
Code:
turnController.enable();