Class HeadingAssistModule

java.lang.Object
xbot.common.subsystems.drive.control_logic.HeadingAssistModule

public class HeadingAssistModule extends Object
Encaspulates a useful bit of driving logic: - The robot should attempt to hold its current heading, even if it's temporarily rotated by outside forces. - If the human driver wants the robot to turn (above some small threshold), then the robot should turn according to human desires. - After a few moments, the robot should memorize its current heading, and attempt to hold it again. The automatic response can take one of two forms: - Hold a specific heading, as mentioned above, using a PID controller - Resist changes in rotational velocity using a D-only controller.
  • Constructor Details

  • Method Details

    • setMode

      public void setMode(HeadingAssistModule.HeadingAssistMode mode)
    • reset

      public void reset()
    • calculateHeadingPower

      public double calculateHeadingPower(double humanRotationalPower)
      Core method of the HeadingAssistModule. You input the human rotational power input, and this will determine whether or not to have the human drive the robot or whether the robot should continue on its last heading. In either case, it will return the suggested power output to the drive subsystem in order to achieve those goals.
      Parameters:
      humanRotationalPower - - values between -1 and 1, in terms of "maximum rotational power"
      Returns:
      values between -1 and 1, in terms of "how hard you should try in order to satisfy rotational goals."