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.

Start from a blank slate

For your own robot design.

You start with the smallest robot that works: it drives. Then you add your parts one at a time, on the five files pages. Why: when only one part is new, a problem can only be in that part.

There are two ways to get the first files. Pick one:

Your robot Use
It is wired, and its configuration is on the Driver Hub (Set up 7) Way A: from your configuration (best)
It is not wired yet, or you only use the simulator, or you want to type each part in yourself Way B: copy the smallest files

The library reads your configuration and writes the five files for you, with a line for each part. Why: it copies the names for you, so they cannot have typos.

  1. Copy the configuration file off the Control Hub. It is /sdcard/FIRST/<name>.xml, where <name> is your configuration’s name (for MyRobot, it is MyRobot.xml). Use Android Studio’s Device Explorer (View > Tool Windows > Device Explorer) with the hub connected, or the REV Hardware Client. Save it in the project folder, next to TeamCode.

  2. Run the file maker. The first time, do the laptop setup.

    Where: Android Studio’s Terminal tab, in the ftc-helper-lib folder (type cd ftc-helper-lib first). (Which folder)

    Terminal window
    ./gradlew :sim:newRobot -Pconfig=../MyRobot.xml -PteamCode=../TeamCode

    Change MyRobot.xml to your file’s name. It writes Robot.java, Tunables.java, Controls.java, Actions.java and autos/LeaveStart.java into TeamCode. It never writes over your work: if one of the files is already there, it writes nothing and stops.

  3. Check each TODO line in Robot.java. A TODO is a guess the file maker was not sure of, for example which part a motor drives.

  4. Build: click Build > Make Project.

In Tunables.java, each number is DEFAULT (the library’s starting value) or MEASURE (a number only your robot can give). Leave them for now. The Tunables.java page says how to find each one.

The smallest files are in the library, in the firstrobot folder: ftc-helper-lib/examples/src/main/java/com/crossbotics/ftchelper/examples/firstrobot/. They are a mecanum drive and nothing else. They are the same files the five files pages show.

  1. Copy the folder into TeamCode: Copy example files into TeamCode. Then come back here.
  2. Change the drive line in Robot.java: your four motor names, your motor and wheels, and the IMU (the drive line, how your Control Hub is mounted). For a tank drive, read A tank drive instead.
  3. Build: click Build > Make Project.

Your other parts come later, one at a time, on the Robot.java page.

  • The five files are in TeamCode: Robot.java, Tunables.java, Controls.java, Actions.java, and the autos folder.
  • Build > Make Project ends with no red errors.
Problem Fix
... is already there: nothing written (move it away first) One of the five files is already in TeamCode. Move it to another folder, then run the command again.
./gradlew: No such file or directory You are not in the ftc-helper-lib folder. Type cd ftc-helper-lib.
A line is red: cannot find symbol A package or import line still names the example folder (Copy example files, step 3).

Next: The five files. They explain every line, and you make the robot drive.

Look it up: Robot.java, Tunables.java and Drive.

Something wrong on this page? Tell us with a short GitHub form.