Skip to content
CrocoDocs
Starter GuideProgrammingEngineeringDesignPortfolio
Documentation

Introduction

IntroductionBIOBUZZ game overview

Getting started

Getting startedBlocksOnBot JavaAndroid StudioYour first OpModeJava basicsMotors and servosNonblocking codeDebugging robot code

Control systems

Control systemsJoystick mappingField-centric mecanum drivePID controlFeedforwardFlywheel velocity controlSystem identificationMotion profilingKalman filterLow-pass filter

Autonomous

AutonomousTimed and encoder movementOdometryLocalization troubleshootingMotion planningReliable autonomous sequencesPure PursuitSensor fusionAuto to TeleOp handoff

Season topics

Season topicsProjectile mathematicsTurret aimingShooting on the move

Code practices

Code practicesNaming conventionsCode organizationLoop timing and bulk readsFormattingComments and documentationTeam collaboration

Libraries

LibrariesNextFTCFTCLibSolversLibPedro PathingRoad RunnerFTC DashboardMercurial v2Mercurial v1PanelsSloth

Community software

Community softwareBlaze FTCOpenLoopHive Vision

Sensors and vision

Vision overviewVision basicsLimelight 3A
Starter Guide
Engineering
Design
Portfolio
Appearance

Code practices

Write robot code that your teammates can read, test, and improve

Team code

code is read by more than the person who wrote it. A teammate may need to fix it between matches, change it for a new , or explain it to a new student. Clear code makes those jobs easier.

You do not need a large architecture to start. For your first , focus on three habits:

  1. Name things for what they do. leftDriveMotor tells more than motor1.
  2. Keep each step easy to find. Map hardware, wait for START, then run the control loop.
  3. Explain unusual decisions. A short comment can record why a is reversed or why a power limit exists.

Example

This fragment shows the idea. It belongs inside an OpMode after leftDriveMotor has been mapped and START has been pressed:

double forward = -gamepad1.left_stick_y;
double safePower = forward * 0.25;
leftDriveMotor.setPower(safePower);

The names say what the values mean. The 0.25 limit makes the first drive test slower. If that limit is temporary, explain when the team should change it.

Small changes

  • Change one behavior at a time when testing a new robot.
  • Build the project, then test the changed behavior on the real robot with a safe setup.
  • Review git diff before committing so unrelated changes do not slip in.
  • Record configuration names and important measurements where teammates can find them.

Topics

If you need to…Read…
Pick names for motors, values, and classesNaming conventions
Decide where code belongsCode organization
Diagnose slow updates or stale dataLoop timing and bulk reads
Make code easier to scanFormatting
Explain a choice in codeComments and documentation
Share and review changesTeam collaboration

Start with the guide that solves a problem your team has today. Return to the others as your robot project grows.

Shooting on the move

Account for robot velocity, launcher offsets, and release delay when aiming a moving FTC shooter.

Naming conventions

Pick names that tell a teammate what each part of the code means

On this page

Team codeExampleSmall changesTopics