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:
  1. 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.
  2. START: starts the 30 s timer, waits the chosen delay, runs your steps (mirrored for RED).
  3. 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

    Fields
    Modifier and Type
    Field
    Description
    com.qualcomm.robotcore.hardware.Gamepad
     
    com.qualcomm.robotcore.hardware.Gamepad
     
    com.qualcomm.robotcore.hardware.HardwareMap
     
    static final int
     
    int
    Deprecated.
    static final String
    Set to "true" by the simulator; autonomous then runs with an untuned drive (with a warning).
    org.firstinspires.ftc.robotcore.external.Telemetry
     

    Fields inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode

    blackboard, msStuckDetectInit, msStuckDetectInitLoop, msStuckDetectLoop, msStuckDetectStart, time
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    Extra INIT choices, e.g.
    protected void
    Extra lines for the Driver Station during INIT (before START), every INIT loop.
    protected Alliance
    The alliance chosen in INIT.
    protected boolean
    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).
    protected AutoDrive
    The drive, for custom steps.
    protected AutoDriveConfig
    The autonomous tuning.
    protected abstract void
    Adds the steps.
    protected String
    choice(String label)
    protected com.qualcomm.robotcore.hardware.IMU
    The IMU, set up for your hub's mounting.
    protected Subsystems
    Your mechanisms, kept working during every step.
    protected DriveConfig
    The drivetrain settings.
    protected FieldPose
    The pose to hand to TeleOp at the end, or null (the default: the heading from the drive's IMU only).
    protected double
    Longest start delay offered in the menu, seconds.
    protected boolean
    True (default): routes are written for BLUE and mirrored left/right for RED.
    protected String
    What to do when the drive is not tuned, shown on the Driver Station instead of running.
    protected double
    Seconds kept at the end for the steps after thenPark().
    final void
     
    protected RobotConfig
    Your robot's settings, shared with TeleOp (see RobotConfig).
    final void
    The whole autonomous, from INIT to the end.
    protected double
    Which way the robot faces at the start, compared with "straight away from your driver", in degrees (left = positive).
    protected String
    Where 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 when mirrorForRed(), 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, waitForStart

    Methods inherited from class com.qualcomm.robotcore.eventloop.opmode.OpMode

    getRuntime, internalPostInitLoop, internalPostLoop, internalPreInit, internalUpdateTelemetryNow, resetRuntime, terminateOpModeNow, updateTelemetry

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • SIMULATOR_PROPERTY

      public static final String 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 public int msStuckDetectStop
      Deprecated.
  • Constructor Details

    • EasyAuto

      public EasyAuto()
  • Method Details

    • robotConfig

      protected RobotConfig robotConfig()
      Your robot's settings, shared with TeleOp (see RobotConfig). Return new RobotSettings(). If you do not have one, override driveConfig(), autoDriveConfig() and createImu() instead.
    • driveConfig

      protected DriveConfig driveConfig()
      The drivetrain settings. Default: robotConfig().drive().
    • autoDriveConfig

      protected AutoDriveConfig 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

      protected abstract void buildRoutine(AutoRoutine routine)
      Adds the steps. Runs AFTER INIT, so alliance() and choice(String) are known.
    • createSubsystems

      protected Subsystems 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

      protected void addChoices(InitMenu menu)
      Extra INIT choices, e.g. menu.choice("Route", "Near", "Far").
    • addInitTelemetry

      protected void addInitTelemetry(RobotTelemetry t)
      Extra lines for the Driver Station during INIT (before START), every INIT loop.
    • startPosition

      protected String 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 after thenPark(). 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 when mirrorForRed() is true.
    • startSpotIn

      protected double[] startSpotIn()
      Where to place the robot, as seen from the BLUE drivers' wall (for RED: mirrored like the routes when mirrorForRed(), 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 is startHeadingDeg(). The simulator puts the robot there in INIT.
    • maxStartDelaySec

      protected double maxStartDelaySec()
      Longest start delay offered in the menu, seconds. Default 10.
    • alliance

      protected Alliance alliance()
      The alliance chosen in INIT.
    • choice

      protected String choice(String label)
    • autoDrive

      protected AutoDrive 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:
      runOpMode in class com.qualcomm.robotcore.eventloop.opmode.LinearOpMode
    • endPose

      protected FieldPose 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

      protected String notTunedHelp()
      What to do when the drive is not tuned, shown on the Driver Station instead of running. Default: the Drive Tuner, then calibrationConfirmed = true in your settings.
    • requestOpModeStop

      public final void requestOpModeStop()