Package com.crossbotics.ftchelper.drive
Class AutoDriveConfig
java.lang.Object
com.crossbotics.ftchelper.drive.AutoDriveConfig
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 Summary
FieldsModifier and TypeFieldDescriptiondoubleEach move or turn gives up after this many seconds.booleanMust be set to true beforeAutoDrivewill run.doubleMotor turns per wheel turn.doublemoveWithTurn: largest heading-correction power, so moving stays the main job.doubleSlowest translation power near the end of a move.doublemoveWithTurn: heading correction is multiplied by this before mixing.booleanStop a move early if the robot is stuck (pushing a wall or another robot).doubleThe robot counts as stuck if it gets less thanstallProgressIncloser to the target withinstallTimeSec.doubleSeestallProgressIn.doubleMecanum wheels slip sideways: the wheels turn more than the robot moves.doubleThe last part of the move (as a fraction, 0.10 = last 10%) where speed tapers down.doubleEncoder counts per motor output turn.doubleTurn D gain.doubleTurn P gain: power per degree of error.doubleSmallest turn power while outside the tolerance, so the robot does not stall just short of the target.double...for this long (seconds).doubleA turn is done when the error is this small (degrees)...doubleWheel diameter, inches. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleEncoder counts per inch of wheel travel, worked out from the values above.
-
Field Details
-
calibrationConfirmed
public boolean calibrationConfirmedMust be set to true beforeAutoDrivewill 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 ticksPerRevEncoder counts per motor output turn. goBILDA Yellow Jacket 312 RPM (19.2:1) = 537.7. -
wheelDiameterIn
public double wheelDiameterInWheel 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 gearRatioMotor turns per wheel turn. 1.0 if the wheel is on the motor shaft. -
strafeCorrection
public double strafeCorrectionMecanum 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 turnKpTurn P gain: power per degree of error. -
turnKd
public double turnKdTurn D gain. Slows the turn as it gets close, to stop overshoot. -
turnToleranceDeg
public double turnToleranceDegA turn is done when the error is this small (degrees)... -
turnSettleSec
public double turnSettleSec...for this long (seconds). -
turnMinPower
public double turnMinPowerSmallest 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 moveMinPowerSlowest translation power near the end of a move. -
taperStartFraction
public double taperStartFractionThe last part of the move (as a fraction, 0.10 = last 10%) where speed tapers down. -
moveTurnScale
public double moveTurnScalemoveWithTurn: heading correction is multiplied by this before mixing. -
moveMaxTurnPower
public double moveMaxTurnPowermoveWithTurn: largest heading-correction power, so moving stays the main job. -
actionTimeoutSec
public double actionTimeoutSecEach 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 stallExitEnabledStop a move early if the robot is stuck (pushing a wall or another robot). -
stallProgressIn
public double stallProgressInThe robot counts as stuck if it gets less thanstallProgressIncloser to the target withinstallTimeSec. Defaults: 0.25 in within 0.4 s. -
stallTimeSec
public double stallTimeSecSeestallProgressIn. 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.
-