Skip to content
Work in progress. This library and its docs are new and still changing, and some parts are not yet tested on a real robot. If something is wrong or unclear,tell us with a short GitHub form.

Step 6: The autos

At the end of this step, you know robot 1’s three autonomous programs in its autos/ folder, line by line. Each one fires the four preloaded POLLEN into our HIVE’s up CELL. Then it parks with only a corner of the robot over a corner of our LOADING ZONE (LEAVE 3 + PARK 5). Robot 1’s front is the launcher: it shoots out of its front, and the intake is at the back.

Missions: try each change in the team’s code, check it in the simulator, then put it back (Try it, then undo it). Never commit a mission.

Checks: robot 1’s tests are in simulator/scenarios/. Run one:

Where: the Terminal, in the ftc-helper-lib folder inside octobots-2026-r1.

Terminal window
./gradlew :sim:scenario -Pfile=../simulator/scenarios/r1-auto.sim

Put the test’s file name in place of r1-auto.sim. To run all of them, use the Simulator tests button.

Robot 1’s three autos:

On the Driver Station File Start spot (Place robot says) Test
R1 Right Corner: Launch, Park Right autos/RightCornerLaunchAndPark.java Back corner on wall 20.5in from R, front at HIVE r1-auto.sim
R1 Right Wall: Launch, Park Right autos/RightWallLaunchAndPark.java Back on R wall, 3rd tile, centred, facing HIVE r1-auto-right.sim
R1 Left Wall: Wait, Launch, Park Left autos/LeftWallWaitLaunchAndPark.java Back on L wall, 3rd tile, 0.6in off centre, facing HIVE r1-auto-left.sim

In all three, the robot’s back (the folded intake) touches a wall, and its front (the ramp) points at our HIVE. “Right” and “left” are as our drivers see the field from our wall.

Skip these docs pages: robot 1 has no odometry (extra wheels that track where the robot is), so it uses none of these three: Drive to points on the field, Add Pedro paths and The auto builder: odometry and Pedro.

Robot 1’s code: auto 1, the right corner. The other two autos use the same steps.

autos/RightCornerLaunchAndPark.java
robot.deployAtStart = false; // the back is on the wall: the intake is pushed over while it drives away
s.start("Back corner on wall 20.5in from R, front at HIVE", 51.6, -58.5, 37.8)
.action(robot.launcher.fireAction(2, 3750), 6) // 3750: an estimate (the side walls fire at 3450); tune on the robot
// Bump: the back is on the wall, so out 2 in slowly, then back to the wall fast. The quick move back
// rolls the last two POLLEN forward into the feeder.
.forward("Bump out", 2, 0.3)
.back("Bump back", 2, 1.0)
.action(robot.launcher.fireAllAction(3750), 6)
.parkWithSeconds(10)
.alongside(Actions.deployIntake(robot))
.move("Off the wall", 9.4, -38, 0.6)
.moveWithTurn("To the LOADING ZONE", 74.5, 55, 52.2, 0.6);

Learn it: What an auto can do. Read what each step does: start, action, forward, back, move and moveWithTurn.

Why robot 1 does it this way:

  • start(note, x, y, heading): the start spot in inches. The simulator puts the robot there, and the note shows on the Driver Station at INIT.
  • Fire two, bump, fire two. The back is on the wall, so the robot goes out 2 in slowly, then back to the wall fast. The quick move back rolls the last two POLLEN forward into the feeder.
  • The moves slide. The Strafer has mecanum wheels (wheels with angled rollers), so it slides without a turn. Only auto 1 turns on the way (moveWithTurn).
  • The shot speed. Autos 2 and 3 start on the usual shooting spot. They fire at the TeleOp’s speed, Tunables.Launcher.speedRpm (3450): fireAction(2) and fireAllAction() with no number. Auto 1 starts in the right corner, another spot, so it writes its own speed, 3750, in both fire lines. 3750 is an estimate: tune it on the robot.
  • Field numbers. The s.start(...) numbers are seen from our own drivers’ wall, so they work on RED and BLUE. Only the simulator’s own numbers (and the tests’ expect robot x = ...) are seen from the red wall. On RED they are the same numbers.

Check: r1-auto.sim checks the start spot, the four shots, the bump, the park beside the LOADING ZONE, and that the auto skips no step.

Try it (optional): every angle counts counterclockwise. Change the direction of "Off the wall" from -38 to 38. Before you run it, say which way the robot will slide. Run the auto in the simulator (INIT, B for RED, ▶) and watch. Then run r1-auto.sim and read which check fails. Undo the change.

Robot 1’s code:

Robot.java
atStart(() -> deployAtStart ? Actions.deployIntake(this)
: Action.named("Intake stays folded (the autonomous deploys it)"));
autos/RightCornerLaunchAndPark.java
.parkWithSeconds(10)
.alongside(Actions.deployIntake(robot))
.move("Off the wall", 9.4, -38, 0.6)

Learn it: Put steps together. Read how alongside runs an action at the same time as the next moves, and how parkWithSeconds keeps time to park.

Why robot 1 does it this way:

  • In TeleOp, the deploy servo pushes the intake over right after START. In an auto, the back is on the wall, so the intake would fall onto the wall. So each auto sets robot.deployAtStart = false; as the first line of steps(...).
  • The intake falls over while the robot drives away from the wall. The deploy action uses the intake and its servo. The moves use the drive. No part has two owners, so they run at the same time.
  • Time to park: parkWithSeconds(10) in autos 1 and 2, parkWithSeconds(8) in the left-wall auto.
  • Red and blue: every auto has mirrorForRed() returning false. BIOBUZZ’s field is turned half a turn between the alliances, so the same steps work from each alliance’s own wall.

Check:

  • r1-auto.sim checks that the intake is still folded 1 s after START, and pushed over within 6 s.
  • r1-auto-blue.sim runs auto 1 as BLUE. Every simulator number is the RED one turned half a turn: x and y change sign, and the heading changes by 180. It checks the start spot, the four shots and the park at the right corner of the blue LOADING ZONE.

Try it (optional): in RightCornerLaunchAndPark.java, change parkWithSeconds(10) to parkWithSeconds(28). Run the auto in the simulator and read the report. Find which steps are cut short or skipped, and whether the park still runs. Undo the change.

Robot 1’s code:

autos/RightWallLaunchAndPark.java
@Autonomous(name = "R1 Right Wall: Launch, Park Right", preselectTeleOp = "R1 TeleOp")
autos/LeftWallWaitLaunchAndPark.java
s.start("Back on L wall, 3rd tile, 0.6in off centre, facing HIVE", -62, -11.2, -90)
.waitSeconds("Wait for our partner", 15)

Learn it: Having multiple autos. Read how to name autos so the drive team picks the right one.

Why robot 1 does it this way:

  • One file per start spot (the table at the top of this page).
  • The names start with the spot: R1 Right Corner, R1 Right Wall, R1 Left Wall. Then what it does: Launch, Park Right.
  • preselectTeleOp = "R1 TeleOp" in all three, so the Driver Station has the TeleOp ready after the auto.
  • Which one in a match: only one robot per spot. Use R1 Left Wall when our partner shoots first from the right. Why it waits 15 s: at the start, the HIVE’s CELL that faces the left wall is the down one. Our partner’s shots tip the HIVE, and then the CELL on our side is up.
  • The left-wall spot is 0.6 in off the tile’s center toward the field’s center line. Centered, the robot would overlap the FLOWER on that wall by 0.4 in.
  • Auto 2’s first move is 42.8 in, not 35.8. On the robot it came up short when it strafed left. The Drive Tuner tested the strafe to the right only (Drive Tuner).
  • Robot 1’s @Autonomous lines have no group.

Check: r1-auto.sim, r1-auto-right.sim and r1-auto-left.sim. Each one checks its own start spot and its park. r1-auto-left.sim tips the HIVE first with four POLLEN, as our partner’s shots would.

Try it (optional): make a fourth plan. Copy RightWallLaunchAndPark.java to RightWallLaunchOnly.java. Change the class name, and the name to R1 Right Wall: Launch Only. Delete the two moves after .alongside(...) and put the ; after .alongside(...). Restart the simulator: the new auto is on the Auto list. Run it. Then delete the new file: git restore does not remove a new file.

Robot 1’s code: the three files in autos/. Each step holds plain numbers, the way the builder writes them.

Learn it: The auto builder: steps. Read how to load an existing auto, run it, and paste the Java back.

Why robot 1 does it this way:

  • Plain numbers in the steps, so the builder can open each auto. Load an existing auto: pick one of the three, and press Load.
  • Red’s side: Rotated 180° (mirrorForRed() is false).
  • The fire actions’ flywheel box: 3750 in auto 1. Empty in autos 2 and 3 (the usual speed).
  • After Load, paste the steps under robot.deployAtStart = false;, not over it. That line is inside steps(...), but it is not a step. Without it, the intake falls onto the wall at START. First read the list of what Load did not carry over.

Check: in the builder, load R1 Right Corner: Launch, Park Right and press Run. The result table says done for every step. After you paste Java back into a file, run that file’s test again.

Try it (optional): load R1 Right Wall: Launch, Park Right, set Run as to BLUE, and press Run. Watch the same route from the blue wall. This mission changes no code.

Robot 1’s code:

autos/LeftWallWaitLaunchAndPark.java
.waitSeconds("Wait for our partner", 15)
.action(robot.launcher.fireAction(2), 4)

Learn it: Advanced autos. Read about menu lines, onlyIf, and the rule to keep code inside the steps.

Why robot 1 does it this way:

  • Robot 1’s autos use no menu lines, no Routes.java, no alliance().pick and no step of their own.
  • The 15 s wait is a step, not the Start delay line. The Start delay goes from 0 to 10 s, and the left-wall auto must wait 15 s for our partner’s shots.
  • The fire actions have 4 s each, not 6. The wait leaves less time.
  • Keep code inside the steps: robot.deployAtStart = false; is the one line in steps(...) that is not a step. It runs in INIT, more than once. That is safe: it only sets a switch, and START reads it.

Check: r1-auto-left.sim checks the wait: at 14 s after ▶, nothing has fired yet.

Try it (optional): give the drivers a choice. In LeftWallWaitLaunchAndPark.java, put the wait in a YES/NO line of the INIT menu:

autos/LeftWallWaitLaunchAndPark.java
s.start("Back on L wall, 3rd tile, 0.6in off centre, facing HIVE", -62, -11.2, -90)
.menuYesNo("Wait for partner", true)
.onlyIf("Wait for partner")
.waitSeconds("Wait for our partner", 15)
.end()
.action(robot.launcher.fireAction(2), 4)

The menu starts at YES, so r1-auto-left.sim still passes. In the simulator, INIT the auto, choose NO with the D-pad, and press ▶: it fires at once. Undo the change. (The builder’s Load cannot read a file with a menu.)

Robot 1’s code:

autos/RightCornerLaunchAndPark.java
s.start("Back corner on wall 20.5in from R, front at HIVE", 51.6, -58.5, 37.8)
Tunables.java
public static double practiceMaxPower = 0.6; // top wheel power in PRACTICE (the library's default is maxPower since v0.41.0)

Learn it: Match day. Read about setup cards, auto sheets, placing the robot, and the profiles.

Why robot 1 does it this way:

  • Setup cards and auto sheets: load each of the three autos in the auto builder, and print its setup card and its auto sheet.
  • Placing the robot: the Place robot notes are in the table at the top of this page. The right-corner spot: the back-left corner is on our wall, 20.5 in from the right-hand wall. The body is at about 52 degrees to the wall, so the front aims at our HIVE’s up CELL.
  • Wrong alliance in TeleOp: robot 1’s Controls.java has no lib.switchAlliance(...) line. On robot 1, START, then BACK, shows the debug lines (lib.debug(g1.start, g1.back)). So get the alliance right in INIT: X for BLUE, B for RED.
  • PRACTICE is slower on robot 1: practiceMaxPower = 0.6, so PRACTICE drives at 0.6. Set COMPETITION before each match.
  • calibrated = true is in robot 1’s Tunables.Drive (the Drive Tuner is done), so AUTONOMOUS IS OFF does not show.

Check: r1-place-notes.sim checks that each auto shows its Place robot note at INIT, in the COMPETITION profile (the simulator starts in it).

Try it (optional): in the simulator, INIT R1 Right Corner: Launch, Park Right, choose RED, and set the Start delay to 5 s with the D-pad. Press ▶. Read the report, and check whether every step still says done. This mission changes no code.

Done when: you know robot 1’s three autonomous programs, line by line.


Next: Step 7: The simulator and tests.