Troubleshooting
Find your problem below. Each answer says what is wrong and what to do. Tip: copy the exact error text and search this page for it (Ctrl+F, or Cmd+F on a Mac).
Build problems
Section titled “Build problems”Project directory ‘…/ftc-helper-lib/library’ does not exist
The submodule folder is empty: someone cloned the project (copied it from GitHub) without the library in it. Run this command.
Where: Android Studio’s Terminal tab, in the project folder (a new Terminal tab starts there). (Which folder)
git submodule update --initCannot resolve symbol ‘crossbotics’ / red imports
Gradle does not know about the library yet. Check steps 2 and 3 in Add the library, then File > Sync Project with Gradle Files.
Plugin [id: ‘com.android.library’] was not found
Your project’s top build.gradle (the one in the project folder, not in TeamCode) must list the
Android library plugin. Every FtcRobotController
project does (id 'com.android.library' version '...' apply false). If yours is very old, update the SDK.
Errors in the library after an FTC SDK update
Driver Station errors
Section titled “Driver Station errors”INIT STOPPED: the robot did not start.
The library found a mistake at INIT. The line under it says what is wrong and how to fix it: find it below. Nothing moves. Press STOP, fix it, then press INIT again. (After ▶ on the Driver Hub, a mistake shows after every part has stopped. It shows as the FTC app’s red line, User code threw an uncaught exception: …. The words after the dash are the same messages as below.)
A mistake in your own code (not a library message) shows its kind and where it is. For example: NullPointerException in Robot.java line 42. Open that line.
No DcMotorEx named “…” in the active robot configuration
- or No Servo named “intake_deploy” …
The name in code and the name in the Driver Station configuration differ. The message lists the names that do exist. Fix the spelling, or pick the right configuration on the Driver Station.
When the part is not on the robot yet, the message ends Not on the robot yet? Add .optional() …
Add .optional() to its line in Robot.java. Then INIT goes on and says the part is off. Its
buttons and actions skip it until it is in the configuration
(parts not on the robot yet). The
Hardware Check with robot() lists every Robot.java device
the configuration is missing.
libraryButtons: Two library features are on G1 BACK: “pause / go on” and “debug lines”. A button can do only one. …
- or Two hold-down library features are on …
- or G1 LT is the slow trigger, and also …
- or G1 A cannot open the tuning menu …
In libraryButtons(...) in Controls.java, you moved one of the library’s features onto a button that
already has one. The message ends with the line to change: move that feature to a free button
(lib.debug(g1.start, null)), or turn it off with null (lib.debug(null, null)).
Moving the library’s buttons.
Tunables.Lift has no max: write max (the top of the safe range, in counts: Motor Finder, B). A safety limit never comes from a library default.
- or has no min
- or Tunables.java has no Lift section
- or the same for Arm, in deg
INIT stops on purpose: a lift or arm
must never use a library default for its safe range. Run the Motor Finder, then
write min and max in that section of Tunables.java.
Tunables.Lift.max must be a public static number (like “public static double max = 1000;”): …
The field is there but written another way: not public, or not a number (for example a String).
Write it exactly like public static double max = 2900;. (Without static, it counts as missing: you
get has no max instead.)
Tunables.Lift: max (…) must be more than min (…)
The two numbers are swapped or equal. max is the top of the safe range, min the bottom.
Tunables.Lift.Max looks like “max” (capitals and spelling count). Fix the name in Tunables.java; a position must not look like a setting.
A field name is a known setting with other capitals or an _ (Max, MAX, MIN, kp, KP,
k_P): INIT always stops on this. INIT also stops on a name up to two letters off a setting (maxPowr,
maxPwr for maxPower) that the section does not write itself. (slowZone2 next to a written
slowZone is a position, not a typo.)
Without this stop, the field would quietly become a named position, and the real setting would stay the
library’s default. Fix the spelling. If it is a position on purpose, give it a name that does not look
like a setting. The known names: Lift.
Tunables.Intake.inPowr is not a setting of Intake (did you mean inPower?): the robot would quietly ignore it. …
- or the same for any part: Tunables.Aim.goalx, Tunables.Launcher.nominalVolt, Tunables.TurretLift.turetFrom
A field
in that section is not a name the part reads: a typo, other capitals, or a leftover from an older robot.
Before, the library quietly skipped the line, and the part used its default. Fix the name (the “did you
mean” is the closest real one. Known: lists them all, and so does the Tunables reference),
or delete the line. A number you keep for your own code goes in a section of your own (a name no part uses).
An autonomous’s distances go in its steps, not in Tunables.java (why).
!! Tunables.Launcher is not read by any part: your launcher’s section is Tunables.Shooter (its device name “shooter” in CamelCase). Move the numbers there
A part reads the section named after its DEVICE (its configuration name in CamelCase), not after its
kind: Launcher.flywheel("shooter", ...) reads Tunables.Shooter, Indexer.servo("feeder") reads
Tunables.Feeder, Lift.slide("lift_left") reads Tunables.LiftLeft. Until you move the numbers, the part
uses the library’s defaults. (INIT also says did you mean Tunables.LiftLeft? for a section spelled almost like a
part’s.) An interlock rule’s fields follow the same name: liftLeftAbove, not liftAbove.
The interlock line says … held …: Turret angle unknown (…)
The library does not know the other part’s position yet (a turret looking for its home switch, a servo turret before ▶). So it counts that part as maybe in its zone, and this part waits. It goes on by itself when the angle is known.
AutoDriveConfig.calibrationConfirmed is false
- or AUTONOMOUS IS OFF: the drive is not tuned yet (EasyAuto, Auto)
The autonomous stops on purpose: a robot with untuned numbers can drive much too far. Tune AutoDrive, then set it to true: Tune AutoDrive. With the
robot in five files, run the Drive Tuner, then set Tunables.Drive.calibrated = true.
Warnings on the Driver Station (!! … at the top)
Section titled “Warnings on the Driver Station (!! … at the top)”| Warning | Meaning |
|---|---|
| lift: push it DOWN to the switch to home it | homing (finding where 0 is): drive it down to the switch once |
| lift: no switch “lift_bottom” in the configuration | the switch name is wrong or missing: it runs without the switch |
| claw: no position called “OPNE” | a typo in a position name: the library ignored the command |
| homing failed: switch not found (turret) | the switch never closed: wire, magnet gap, or the wrong direction in home(...) |
| follower encoder not reading: follower switched off (flywheel) | the second flywheel motor has no encoder cable: plug it in (or use one motor) |
| Launcher gave up: flywheel (or hood, Turret…) | it was not ready in time: that part is the problem |
| Launcher: defaults from the catalog (gobilda-5203-6000): kF 11.7, kP 1.17, … | normal on a first run: with no gains written, it starts from the motor’s catalog numbers. The wheel gets to speed, but slower after each shot than when tuned: run the Flywheel Finder and write its line (First run) |
| Aim odometry: the pose was never set … | TeleOp ran without autonomous, so the robot does not know where it is: aiming uses the camera only. Run autonomous first, or park on the reset spot and hold gamepad 1 START 1 s (“set pose here”, Tunables.Odometry.resetX, resetY, resetHeading; Add odometry) |
| No reset spot: add resetX, resetY, resetHeading to Tunables.Odometry | someone held gamepad 1 START 1 s (“set pose here”), but Tunables.Odometry has no spot: add the three numbers (inches and degrees from your wall, for BLUE) |
| Alliance now RED (was BLUE) | the alliance switch is on (lib.switchAlliance(...)) and someone held gamepad 1 START, then BACK, 1.5 s: the alliance switched. Hold them again to switch back (ControlMap) |
| Alliance now RED: odometry aim OFF until the pose is set (…) | someone switched the alliance on a turned field (mirrorForRed = false): the library cannot fix the pose from autonomous. Park on the reset spot and hold gamepad 1 START 1 s (buttons guide) |
| Set pose here needs odometry: … | someone held gamepad 1 START 1 s, but the robot has no odometry(...) line in Robot.java, so it cannot know where it is (Add odometry). Nothing changed |
| Launcher : WAITING_READY left 1 waits for: turret aimed | the launcher holds the piece until that check is true (here: the turret on the goal). Launcher gave up: … shows for 5 s when it waited too long |
| Pose NOT set: stop first … | someone held “set pose here” while the robot drove (a drive stick pushed) or whole-robot aim was on. Stop, then hold gamepad 1 START 1 s again |
| No pause button (libraryButtons freed it): … | lib.pause(null) in libraryButtons: nothing pauses the robot. Put it on a button: lib.pause(g1.back) |
| No slow button (libraryButtons freed it): … | lib.slow(null) with no slow() of your own: add one, for example g1.rt.slow() |
| COMPETITION: “intake_deploy” not in the configuration: IntakeDeploy is OFF (optional part). On the robot? … | the same as the note below, loud because the COMPETITION profile is on: at an event, a part that is off is most likely a misspelled or lost configuration name. Fix the name (or plug it in) and INIT again. If the part is not built yet, it is safe to play |
| “intake_deploy” not in the configuration: IntakeDeploy is off (optional part) | a note, not a problem: the part is marked optional() and not on the robot yet. The library skips its commands, buttons (- off: … not on the robot on the map) and action steps. When you plug it in, add it to the configuration and INIT again (parts not on the robot yet) |
| Launcher: battery 11.2 V: low. The flywheel gets back to speed slower: charge or swap it | swap in a charged battery: the wheel gets back to speed slower, so shots wait longer |
| Aim odometry: … more than the field allows / Aim: camera says … odometry … | the pose is wrong or drifted, or Tunables.Aim.goalX, goalY are not where the camera measures to |
| goal out of turret range (behind the robot: holding) | the goal is behind the robot: turn the robot toward it |
| PRACTICE profile | set COMPETITION at events |
| N tuned value(s) differ from the code | the hub uses saved tuning values: copy them into the code, then reset |
| … button job took N ms: the whole robot stopped that long. … or a button job took N ms: … | a button job waited: see “A job took N ms” under Robot behavior |
| Lift update took N ms: update() must not wait or sleep | a part’s update() took more than 25 ms: no wait or sleep() in update(). It goes away 5 s after the last slow update |
| intake_color: not found: no color sensor called … (or distance sensor) | a piece sensor’s name is not in the robot configuration: it sees nothing, and Pieces counts nothing with it. Fix the name |
| huskylens: not answering: check the cable… | the HuskyLens does not answer on I2C (with a loose cable or its Protocol Type on UART). Check the cable (its green wire goes to the hub’s white wire on a home-made cable), and in its General Settings set Protocol Type to I2C or Auto Detect |
huskylens sees a tag but target(34) is null |
it says only the number you taught it. Add .tag(taughtNumber, 34), or teach that tag (how) |
| ready_color: no new reading for N s | a piece sensor (or its camera) stopped answering: a loose cable, or a camera that stopped streaming. It sees nothing until readings come back |
| Intake: held back by stopsWhen for N s (the count says full) | the piece count says full. If it is not full, hold the in-button (RT) 1 s to pull in anyway, or hold G2’s left stick button 1 s: count = 0 (Pieces) |
EasyTeleOp needs your robot settings
- or EasyAuto needs your robot settings
Add robotConfig() to the OpMode: return new RobotSettings(); (starter kit) or
return RobotSettings.config(); (tutorials). See RobotConfig.
Autonomous needs the IMU (turn sensor)
RobotSettings.imu() returned null. Return ImuSetup.get(...) there: every Control Hub has an IMU.
Robot behavior
Section titled “Robot behavior”A lift or arm runs past its stop, never stops, or does not move; the flywheel never gets to speed; the robot drives the wrong distance
The encoder count is wrong: its cable is missing, in another motor’s port, or counting backward. Run the Encoder Check (Tune and check) with the robot on a block. It names the fault for each motor:
| The Encoder Check says | Fix |
|---|---|
| NO COUNTS: encoder cable missing? | plug in the encoder cable, or replace it |
| counts on “X” instead: encoder cables swapped? | put each encoder cable in its own motor’s port |
| counts on “lift_right” instead: plug the encoder cable into “lift_left”’s port | a two-motor lift: the library reads only the first motor’s encoder. Move the cable |
| counts BACKWARD | the motor’s power wires are swapped (red and black), or an outside encoder is mounted the other way |
A route says Park: stopped: a drive stick moved, or it never seems to start
Any drive stick stops a TeleOp route at once. A route that a time starts waits 5 s for the driver to let go of the sticks, and the gamepad buzzes. If the Driver Station says Park: not started: …, the words say why: the table.
A route or routeTo says STALLED, or the robot touches a box on the way
The pose is wrong, the box is too small, or the margin is too small. Compare the Pose line with where the
robot is on the field. Then measure the box again, or make the margin bigger (what the margin is).
Another robot in the way also stops it: a route cannot see robots. A spot closer to a wall than half your
robot also ends this way: the robot presses the wall.
INIT stops: … is on “…” or … a robot cannot drive in from outside
The spot you gave routeTo or route is on a box, or other boxes close every way to it. Move the spot. For
the second one, a smaller margin in fieldMap(...) can also help.
A part does nothing on its buttons, and INIT says Intake: usual buttons not in Controls.java: …
Since v0.39.0 a part has no buttons until Controls.java has its lines. Copy the part’s lines from its
“buttons to add” in the reference (for example Intake)
into buttons(...). If a button that line wants is already in use, put the part’s job on a free one (INIT lists
them: G2 free: …).
A servo turns less than its seller says (a goBILDA 2000 servo: about 270 degrees, not 300)
The hub sends 600 to 2400 microseconds for positions 0 to 1 (the FTC SDK’s normal range). The servo’s
full turn needs 500 to 2500. Add .fullRange() to the part in Robot.java (ServoSetup...fullRange()
or PositionServo...fullRange() without the five files). Then measure its positions again: they move
when the range changes (Full range). INIT says cannot change its pulse range
for a servo that is not on a REV hub.
My servo positions are off after adding (or removing) .fullRange()
You measure positions for one pulse range. Find them again with the Servo Finder (Y while choosing the
servo = full range) or the Hood Finder, and copy the new numbers into Tunables.java.
Every shot is a little short (or long) today
The wheel is worn, the balls are softer, or the battery is lower than when you tuned. In the match: the
operator’s D-pad up/down trims every shot speed by 1% (Speed trim : +3% on the Driver Station). Held, it makes
4 steps a second. A double-tap on D-pad down sets it to 0. If it happens every match, the table is off. Multiply its
speeds by the trim (or tune it again with the Shot Tuner), and copy the new line into Tunables.java
(Add a launcher).
Battery compensation is off by default (nobody has proven it on a robot yet). To try it, read
Add a launcher: speed trim and a low battery.
In an autonomous move the robot turns and stops short (in the simulator or on the field)
A corner touched a wall or a field part, and the robot pivoted on it. move(...) drives straight and
does not turn by itself. Look at the start spot. On BIOBUZZ’s field, a FLOWER stands against your wall
about 20 to 27 in right of the center line. A spot at x 36 is only 0.3 in from it, so a move to the
left drives into it. Start farther away (the example robots use x 44 to 48), or drive forward first. In the
simulator, the robot box turns red on a bump, and a scenario can check expect bumped none
(having multiple autos).
The robot paused when I used the gamepad’s START + BACK (the debug lines, or the alliance switch) You pressed BACK first. BACK is the pause button, and it pauses the moment it goes down. Pressing START after it does not undo that, so you get a plain pause (and no debug lines or switch). Tap BACK to go on. Next time hold START first, then press BACK (Move the library’s buttons).
Y does nothing (no field-centric) in an EasyTeleOp
Field-centric needs mecanum wheels and the IMU. A tank drivetrain, or imu() returning null, keeps
it off on purpose.
Field-centric “forward” is wrong at the start of TeleOp
The robot did not start autonomous facing straight away from its driver. Set startHeadingDeg() in
the autonomous (written for BLUE), or press BACK after turning the robot to face away from you. In a
Controls.java TeleOp with field-centric on, hold BACK for 1 s: the press pauses the robot, and the hold
also resets “forward”. Tap BACK again to go on.
The robot drives diagonally, spins, or a wheel fights the others A motor direction or a motor name is wrong. Check motor directions.
Pushing the stick up drives backward
You forgot the minus: forward is -gamepad1.left_stick_y. (The gamepad reports stick up as a
negative number.) With the robot in five files, every direction is flipped: reverse the other side (Wiring checks).
Field-centric goes the wrong way
- The IMU orientation (logo/USB) does not match the hub on the robot (ImuSetup).
- The heading was not 0 while facing away from the driver. Point the robot away and press your reset button.
A button action runs over and over
- In
Controls.java: the job is ahold(...)(every loop while held) where you wantedpress(...)(once per press). - Old style (
ControllerBindings):bindHoldwhere you wantedbindPress.
A button does nothing
- In
Controls.java: check that it is on the right gamepad (g1= the driver,g2= the operator). - Check whether it is a hold where you pressed (or a press you hold).
heldFor(1.0, ...)needs 1 s. Atapwaits to know it is not a double-tap. - When you held it through ▶ (or while the tuning menu closed), let it go and press again.
- When the robot is paused (PAUSED on the screen), tap BACK.
- Old style (
ControllerBindings): check thatcontrols.update(gamepad1, gamepad2)is in the loop, and that it is the right pad (Pad.G1= gamepad1,Pad.G2= gamepad2). AfterignoreHeldButtons, let it go and press again.
A job took N ms: the whole robot stopped that long
A button job has a sleep() or a while loop that waits (the library reports a job over 20 ms). The program
does one thing at a time: while the job waits, nothing else runs, not even driving. Fix: make the
steps an Action and wait with waitSeconds(...) (the robot keeps running
while it waits). Without the five files: set a target or a state and let the loop do the work
(Non-blocking code).
The robot freezes when I press a button
An action has a sleep() or a waiting loop. Actions must be quick. Why: the program does one
thing at a time, so while it waits, nothing else runs (not even driving). Set a target or a state
variable instead and let the loop do the work (Non-blocking code).
A lift only goes down, and slowly, at the start It is not homed yet (it has not found where 0 is). Push it down until the lower switch is pressed. Then it works normally. See Homing.
A lift will not move
getAppliedPower()is 0 while you push the stick: a limit stopped it. CheckgetPosition()and your limits. It may think it is at the bottom or top.- You turned the motor on with the lift half up, so 0 is in the wrong place. Lower it and restart, or use a lower limit switch for homing.
- The motor direction is wrong (positive power must go up). Check with a low power.
The lift stops early or goes past the top
Re-measure the top position with lift.getPosition() on telemetry. A slipping belt or string
changes the count: add a lower limit switch so it re-zeroes each time it reaches the bottom.
AutoDrive moves the wrong distance
Tune wheelDiameterIn and strafeCorrection: Tune AutoDrive.
An autonomous move stops past its end (short moves most, or fast ones)
A robot slides a little when it brakes, and a faster one slides further. There are two fixes. Run the
Drive Tuner at the power your moves use
(D-pad left/right on its test list). Also set Tunables.Drive.slowDownIn = 6, so every move slows down over
its last 6 in (tunables). Then a short move reaches the end as slowly as a long
one. If it still goes past by the same amount every time, shorten that move by that amount.
AutoDrive turns overshoot or stop short
Overshoot: raise turnKd or lower turnKp. Stop short: raise turnKp a little or set turnMinPower.
The Move Tuner measures the turns and finds these numbers for you.
AutoDrive stops early with “robot stuck”
It was blocked, or it moved too slowly. If it was not blocked, raise moveMinPower or stallTimeSec.
The loop is slow (telemetry shows under ~30 Hz, that is, under 30 loops per second)
Turn on bulk reads, send fewer telemetry lines, and remove any sleep().
My JUnit tests time out or never fire, but only when run together
Section titled “My JUnit tests time out or never fire, but only when run together”A test used a pretend clock (PretendClock.use()) and did not give the real clock back. Time then stands still
for every later test. Fix: put PretendClock.stopUsing() in that test class’s @After method
(PretendClock).
Autonomous choice and git problems
Section titled “Autonomous choice and git problems”The robot ran the wrong autonomous plan, or started in the wrong place The first option of each INIT menu line runs when nobody changes it. The “Place robot” note says where the robot must stand. Read the menu and the note out loud before ▶: match day checklist.
An INIT menu option does nothing
The option is spelled differently in menuChoice(...) and in onlyIf(...) (capitals count). Test each
option in the simulator: Scenario files.
modified: ftc-helper-lib (new commits) in git status
Your library folder is at another version than the project expects. If you did not mean to update it, run
git submodule update in the project folder. See Keep it up to date.
The build broke after a library update Read the CHANGELOG’s Changed list, or go back to the old version: Go back to the old version.
‘git’ is not recognized (Windows)
- or git: command not found
The Terminal cannot find git. GitHub Desktop does not fix this: it keeps its own git, and only GitHub Desktop can use that one.
- Install Git for Windows from git-scm.com/downloads/win. On the page “Adjusting your PATH environment”, keep Git from the command line and also from 3rd-party software (the recommended choice). The other choices are fine as they are.
- Close Android Studio fully and open it again. A Terminal that was open before the install does not see git.
- Type
git --versionin the Terminal. It prints git version 2… when it works. - If it is still not recognized, add git to the PATH (the list of folders Windows looks in for commands)
by hand. You need no administrator for this.
- Find the folder that has
git.exein it:C:\Program Files\Git\cmd, orC:\Users\YOUR-NAME\AppData\Local\Programs\Git\cmdwhen you installed Git for one user only. - Press the Windows key, type
environment, and open Edit environment variables for your account. - Select Path, then Edit, then New. Paste the folder from step 1. Click OK, then OK.
- Close Android Studio fully, open it again, and do step 3 again.
- Find the folder that has
rejected, CONFLICT, divergent branches or another git message
Get more help
Section titled “Get more help”Write down what you did, what you expected and what happened, and ask the programming lead. If it is a library bug, add a failing test for it: Contributing.
Something wrong on this page? Tell us with a short GitHub form.