Class AutoDriveConfig

java.lang.Object
com.crossbotics.ftchelper.drive.AutoDriveConfig

public class AutoDriveConfig extends Object
Tuning for AutoDrive (autonomous encoder and IMU moves).

The defaults are last season's (DECODE 2025-26) values. They are a starting point only. Measure and tune them on the new robot: docs/modules/drive.md, "Tune AutoDrive". Tutorial 09 walks through the tuning on a real robot.

These are plain public numbers (no getters): make one, change what is different on your robot, and give it to AutoDrive.

  • Field Details

    • calibrationConfirmed

      public boolean calibrationConfirmed
      Must be set to true before AutoDrive will run. It is a reminder: set it only after you checked the wheel size, motor directions and IMU mounting. (A robot with wrong numbers can drive the wrong way or much too far in autonomous.)
    • ticksPerRev

      public double ticksPerRev
      Encoder counts per motor output turn. goBILDA Yellow Jacket 312 RPM (19.2:1) = 537.7.
    • wheelDiameterIn

      public double wheelDiameterIn
      Wheel diameter, inches. Tune it so a 48-inch move really moves 48 inches. 96 mm = 3.78 in. The default 4.098 in is last season's value (about the size of a 104 mm wheel).
    • gearRatio

      public double gearRatio
      Motor turns per wheel turn. 1.0 if the wheel is on the motor shaft.
    • strafeCorrection

      public double strafeCorrection
      Mecanum wheels slip sideways: the wheels turn more than the robot moves. Sideways wheel travel is divided by this to get the real distance, and the sideways power is raised by it so diagonal moves keep their direction. Tune on field tiles.
    • turnKp

      public double turnKp
      Turn P gain: power per degree of error.
    • turnKd

      public double turnKd
      Turn D gain. Slows the turn as it gets close, to stop overshoot.
    • turnToleranceDeg

      public double turnToleranceDeg
      A turn is done when the error is this small (degrees)...
    • turnSettleSec

      public double turnSettleSec
      ...for this long (seconds).
    • turnMinPower

      public double turnMinPower
      Smallest turn power while outside the tolerance, so the robot does not stall just short of the target. 0 = off (last season's behavior). Try 0.05 to 0.1 if turns stop early.
    • moveMinPower

      public double moveMinPower
      Slowest translation power near the end of a move.
    • taperStartFraction

      public double taperStartFraction
      The last part of the move (as a fraction, 0.10 = last 10%) where speed tapers down.
    • moveTurnScale

      public double moveTurnScale
      moveWithTurn: heading correction is multiplied by this before mixing.
    • moveMaxTurnPower

      public double moveMaxTurnPower
      moveWithTurn: largest heading-correction power, so moving stays the main job.
    • actionTimeoutSec

      public double actionTimeoutSec
      Each move or turn gives up after this many seconds. This keeps one bad move (a wrong number, a robot in the way) from eating the whole autonomous period.
    • stallExitEnabled

      public boolean stallExitEnabled
      Stop a move early if the robot is stuck (pushing a wall or another robot).
    • stallProgressIn

      public double stallProgressIn
      The robot counts as stuck if it gets less than stallProgressIn closer to the target within stallTimeSec. Defaults: 0.25 in within 0.4 s.
    • stallTimeSec

      public double stallTimeSec
      See stallProgressIn. Seconds.
  • Constructor Details

    • AutoDriveConfig

      public AutoDriveConfig()
  • Method Details

    • ticksPerInch

      public double ticksPerInch()
      Encoder counts per inch of wheel travel, worked out from the values above.