Package com.crossbotics.ftchelper.auto
Class EasyAuto
java.lang.Object
com.qualcomm.robotcore.eventloop.opmode.OpMode
com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
com.crossbotics.ftchelper.auto.EasyAuto
- Direct Known Subclasses:
Auto
public abstract class EasyAuto
extends com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
The easiest way to write an autonomous: fill in a few methods, and list your steps.
(Autonomous steps block on purpose; everything else here keeps the loop running.)
Everything else is done for you:
- INIT: sets up the drive, IMU and your mechanisms; shows a menu (alliance, start delay, your own choices, profile) and where to place the robot; warns about tuned values and the PRACTICE profile.
- START: starts the 30 s timer, waits the chosen delay, runs your steps (mirrored for RED).
- End: stops everything (even after an error), remembers the alliance and heading for TeleOp, and shows what happened to each step.
abstract means this class is not finished on its own: your class "extends EasyAuto"
and fills in the abstract methods below (marked "you fill these in"). The methods marked
"optional" already have a body; write your own version only if you need something different.
@Autonomous(name = "Basket Side", preselectTeleOp = "Main TeleOp")
public class BasketSide extends EasyAuto {
private Robot robot;
protected RobotConfig robotConfig() { return new RobotSettings(); } // shared with TeleOp
protected Subsystems createSubsystems() { robot = new Robot(hardwareMap); return robot.all; }
protected String startPosition() { return "Back wall, 2nd tile from the left, facing in"; }
protected void buildRoutine(AutoRoutine r) {
r.move("Drive out", 24, 0, 0.6)
.step("Lift up", robot.lift.goToStep("HIGH"))
.run("Drop", robot.claw::open)
.thenPark()
.move("Park", 24, 180, 0.8);
}
}
Docs: docs/guides/easy-autos.md (Tutorial 16, docs/tutorials/16-easy-autos.md, builds one step by step)-
Field Summary
FieldsModifier and TypeFieldDescriptioncom.qualcomm.robotcore.hardware.Gamepadcom.qualcomm.robotcore.hardware.Gamepadcom.qualcomm.robotcore.hardware.HardwareMapstatic final intintDeprecated.static final StringSet to "true" by the simulator; autonomous then runs with an untuned drive (with a warning).org.firstinspires.ftc.robotcore.external.TelemetryFields inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode
blackboard, msStuckDetectInit, msStuckDetectInitLoop, msStuckDetectLoop, msStuckDetectStart, time -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddChoices(InitMenu menu) Extra INIT choices, e.g.protected voidExtra lines for the Driver Station during INIT (before START), every INIT loop.protected Alliancealliance()The alliance chosen in INIT.protected booleanTrue when both alliances' drivers stand at the same wall (a mirrored field like DECODE 2025-26); false (default) when BLUE's drivers face RED's from the far wall (BIOBUZZ 2026-27).protected AutoDriveThe drive, for custom steps.protected AutoDriveConfigThe autonomous tuning.protected abstract voidbuildRoutine(AutoRoutine routine) Adds the steps.protected StringAn INIT choice (fromaddChoices(com.crossbotics.ftchelper.match.InitMenu)).protected com.qualcomm.robotcore.hardware.IMUThe IMU, set up for your hub's mounting.protected SubsystemsYour mechanisms, kept working during every step.protected DriveConfigThe drivetrain settings.protected FieldPoseendPose()The pose to hand to TeleOp at the end, or null (the default: the heading from the drive's IMU only).protected doubleLongest start delay offered in the menu, seconds.protected booleanTrue (default): routes are written for BLUE and mirrored left/right for RED.protected StringWhat to do when the drive is not tuned, shown on the Driver Station instead of running.protected doubleSeconds kept at the end for the steps afterthenPark().final voidprotected RobotConfigYour robot's settings, shared with TeleOp (seeRobotConfig).final voidThe whole autonomous, from INIT to the end.protected doubleWhich way the robot faces at the start, compared with "straight away from your driver", in degrees (left = positive).protected StringWhere to place the robot, shown in INIT so the drive team sets it up right.protected double[]Where to place the robot, as seen from the BLUE drivers' wall (for RED: mirrored like the routes whenmirrorForRed(), else the same numbers from the red wall): {x, y} in inches, x to the right of the field's centre line, y from the centre toward the far wall (negative = your half).Methods inherited from class com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
idle, init, init_loop, isStarted, isStopRequested, loop, opModeInInit, opModeIsActive, sleep, start, stop, waitForStartMethods inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode
getRuntime, internalPostInitLoop, internalPostLoop, internalPreInit, internalUpdateTelemetryNow, resetRuntime, terminateOpModeNow, updateTelemetry
-
Field Details
-
SIMULATOR_PROPERTY
Set to "true" by the simulator; autonomous then runs with an untuned drive (with a warning).- See Also:
-
MS_BEFORE_FORCE_STOP_AFTER_STOP_REQUESTED
public static final int MS_BEFORE_FORCE_STOP_AFTER_STOP_REQUESTED- See Also:
-
gamepad1
public volatile com.qualcomm.robotcore.hardware.Gamepad gamepad1 -
gamepad2
public volatile com.qualcomm.robotcore.hardware.Gamepad gamepad2 -
telemetry
public org.firstinspires.ftc.robotcore.external.Telemetry telemetry -
hardwareMap
public volatile com.qualcomm.robotcore.hardware.HardwareMap hardwareMap -
msStuckDetectStop
Deprecated.
-
-
Constructor Details
-
EasyAuto
public EasyAuto()
-
-
Method Details
-
robotConfig
Your robot's settings, shared with TeleOp (seeRobotConfig). Returnnew RobotSettings(). If you do not have one, overridedriveConfig(),autoDriveConfig()andcreateImu()instead. -
driveConfig
The drivetrain settings. Default:robotConfig().drive(). -
autoDriveConfig
The autonomous tuning. Default:robotConfig().auto(). -
createImu
protected com.qualcomm.robotcore.hardware.IMU createImu()The IMU, set up for your hub's mounting. Default:robotConfig().imu(...). -
buildRoutine
Adds the steps. Runs AFTER INIT, soalliance()andchoice(String)are known. -
createSubsystems
Your mechanisms, kept working during every step. Default: none. Returning null also means none. It is called again (after START) if the drivers change the profile in INIT, so the mechanisms get the new profile's values: make new objects here, do not keep old ones. -
addChoices
Extra INIT choices, e.g.menu.choice("Route", "Near", "Far"). -
addInitTelemetry
Extra lines for the Driver Station during INIT (before START), every INIT loop. -
startPosition
Where to place the robot, shown in INIT so the drive team sets it up right. -
parkReserveSec
protected double parkReserveSec()Seconds kept at the end for the steps afterthenPark(). Default 0. -
mirrorForRed
protected boolean mirrorForRed()True (default): routes are written for BLUE and mirrored left/right for RED. Return false for a field that is ROTATED between alliances (then the same robot-relative route works for both). Check each season's field drawing. -
alliancesOnOneWall
protected boolean alliancesOnOneWall()True when both alliances' drivers stand at the same wall (a mirrored field like DECODE 2025-26); false (default) when BLUE's drivers face RED's from the far wall (BIOBUZZ 2026-27). Only the simulator's start spot (startSpotIn()) uses it. Check each season's field drawing. -
startHeadingDeg
protected double startHeadingDeg()Which way the robot faces at the start, compared with "straight away from your driver", in degrees (left = positive). Default 0. TeleOp's field-centric "forward" uses it (see drive/DriverHeading.java). Example: the robot starts turned a quarter turn left, so return 90. Write it for BLUE, like the routes: it is mirrored for RED whenmirrorForRed()is true. -
startSpotIn
protected double[] startSpotIn()Where to place the robot, as seen from the BLUE drivers' wall (for RED: mirrored like the routes whenmirrorForRed(), else the same numbers from the red wall): {x, y} in inches, x to the right of the field's centre line, y from the centre toward the far wall (negative = your half). Null (default) = not given. The heading isstartHeadingDeg(). The simulator puts the robot there in INIT. -
maxStartDelaySec
protected double maxStartDelaySec()Longest start delay offered in the menu, seconds. Default 10. -
alliance
The alliance chosen in INIT. -
choice
An INIT choice (fromaddChoices(com.crossbotics.ftchelper.match.InitMenu)). -
autoDrive
The drive, for custom steps. -
runOpMode
public final void runOpMode()The whole autonomous, from INIT to the end. The FTC SDK calls this when you press INIT.final: your class cannot replace it, so the safety steps here always run.- Specified by:
runOpModein classcom.qualcomm.robotcore.eventloop.opmode.LinearOpMode
-
endPose
The pose to hand to TeleOp at the end, or null (the default: the heading from the drive's IMU only). With odometry: x inches right, y away from the drivers' wall, heading 0 = facing away. -
notTunedHelp
What to do when the drive is not tuned, shown on the Driver Station instead of running. Default: the Drive Tuner, thencalibrationConfirmed = truein your settings. -
requestOpModeStop
public final void requestOpModeStop()
-