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.

Cookbook: "How do I...?"

Short answers to the questions students ask most, one page per topic. Each recipe has one question, a few lines of code to copy, one sentence on why, and links to the page that explains more.

To find your question: use the list below, or the site’s search with a word like lift, double-tap or park.

The code works. Every code block in the cookbook is a copy of real Java files in examples/.../cookbook. Each time the library changes, we build those files and run them in the simulator. A check (tools/check_docs.py) makes sure that the pages and the files say the same thing.

If you are new: do Pick your start and The five files first. They put the five files in your robot project, and these recipes go into those files. If you never coded before, read Words you will meet first.

Start here

Driving

Buttons and gestures

Mechanisms

Game pieces (what is in the robot, and what fires next)

Aiming and shooting (the robot helps the drivers)

Turrets and interlocks (any turret; parts that share space)

Actions (several steps or parts together)

Autonomous

Several autos and choosing one (more: Building autos 3: having multiple autos)

Odometry and driveTo (where is the robot on the field?)

Pedro paths (smooth curves, mecanum only)

Telemetry (lines on the Driver Station)

Lights (a color the drivers can see)

Tuning and finders (getting the numbers right)

Simulator (try your code with no robot)

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