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. Something wrong or unclear?Tell us (a GitHub issue).

Tutorial 21: Find your numbers

You will build: only small OpModes that start the library’s ready-made finders, which measure your robot and print the code lines to copy. The main track uses the same finders: An intake, a lift and a claw.

You will learn: how to measure the numbers your code needs (servo ends, lift limits, flywheel gains, wheel size, camera offset, shot table) with the finders (library OpModes that measure one kind of number each), and how to move the results into your code.

You need: a robot with the parts you want to measure. Tutorials 14 (mechanisms) and 19 (Hardware Check).

Programs: the starter kit’s ServoFinder.java, MotorFinder.java, FlywheelFinder.java, DriveTuner.java, and the examples ExampleShotTuner.java and ExampleAimTuner.java. Reference: finders.md. Step by step: Finders guide.


A guessed servo position can push the claw into the frame until the servo burns out. A guessed lift limit can pull the lift off its rails. A guessed wheel size makes every autonomous move the wrong distance. The finders measure the real numbers, safely, and write the code line for you.

@TeleOp(name = "Servo Finder", group = "Finders")
public class ServoFinder extends ServoFinderOpMode {
}

Like the Hardware Check (tutorial 19), the library wrote the whole OpMode. It reads the robot configuration, so you do not even give it a servo name: you choose one from a list. Press GUIDE (the center button, or hold START for 1 second) in any finder for a help page with every button and the steps.

  1. Run it, choose the claw servo with the D-pad, press A. Choose a start point near where the claw sits now (D-pad; nothing moves yet), press A: it moves there.
  2. Nudge it with the D-pad until the claw is fully open without straining. Press X.
  3. Nudge it to fully closed (on a game piece). Press B.
  4. Nudge it to “open just enough” and press A (saved as P1, “position 1”).

The screen shows:

PositionServo.create(hardwareMap, "claw").limits(0.180, 0.770)
.position("P1", 0.210)
Tunables.Claw: P1 = 0.210
// rename P1, P2... (open, closed); keep them between 0.180 and 0.770

Copy it into your code and rename P1 to “OPEN”. With the robot in five files, copy the Tunables.Claw line instead: open = 0.210 in Tunables.Claw. Press STOP: the same lines are saved in /sdcard/FIRST/ftc-helper/finder-results.txt on the hub.

The Drive Tuner needs your RobotSettings (one line, like EasyTeleOp). The Shot Tuner needs your launcher and camera, and the Aim Tuner your camera (and a turret, or the drive to turn):

public class ShotTuner extends ShotTunerOpMode {
@Override protected Launcher createLauncher() { return new Robot(hardwareMap).launcher; }
@Override protected TargetSource createCamera() { return WebcamTags.create(hardwareMap, "Webcam 1"); }
@Override protected RobotConfig robotConfig() { return new RobotSettings(); } // drive between spots
}

(This is the starter kit’s Robot and RobotSettings. With the tutorials’ RobotSettings, write RobotSettings.config().)

Use the SAME launcher set-up as your TeleOp (best: from your Robot class), so the numbers you find are the numbers it uses.

Hardware Check, then Servo and Motor finders, then Flywheel, then Drive Tuner, then Aim Tuner, then Shot Tuner. Each one builds on the one before (the Shot Tuner, for example, needs a flywheel that holds its speed and a camera that aims straight): the guide explains each step.

Problem Fix
The list is empty the robot configuration has no devices of that kind: check the Driver Station configuration
The servo jumps when it first moves the start point was far from where it sat: choose a start point near its real position before pressing A
The motor will not move past a mark hold LB to move past, then mark again
“Speed test” does nothing mark both ends first (X and B)
Drive Tuner: “counts went DOWN” a wheel motor direction is wrong: fix it in RobotSettings (Hardware Check)
Shot Tuner: “no target” the camera does not see the target: check its status in INIT, light, and the tag in view
  1. Run the Motor Finder on the lift and replace the limits in your code (five files: Tunables.Lift) with the measured ones.
  2. Run the Flywheel Finder twice, with a full and a half-charged battery: compare the top speeds.

The starter kit: put the numbers you found into a whole robot program.