Skip to content
All weeks
05Week 5

Autonomous Programming

Teach your robot to drive itself for 30 seconds.

In the Autonomous period your robot runs only on code your team wrote before the match, with no drivers touching the controls. This week you will learn how a robot measures its own movement with encoders and the IMU, how feedback makes movement more accurate, and how to structure, test and debug an autonomous routine. By the end of the week your team will have a basic autonomous movement routine running reliably on your own robot.

5
Lessons
8 team hours
Estimated time
5
Learning objectives
Start lesson
Game of the week

30-second autonomous

Plan an autonomous route: collect as many yellow pieces as you can and park in the green zone before the 30 seconds run out.

How to play
  1. 01Click tiles to add waypoints — the robot drives straight between them.
  2. 02Driving and turning take time: watch the counter at the top.
  3. 03Each piece is 10 points, parking is 15. Press Run to test the plan.
Recommended video

Lessons by FoxSlide

Video tutorials from the FTC community. Watch them alongside this week's lessons.

Code

PRE-CA Coding Tour Guide #1: Tuning PID

YouTube

Video by FoxSlide

FoxSlide (FTC Team #29029) is not officially affiliated with or endorsing Rookie Academy or FIZMAT ROBOTICS #28061.

Original video: youtube.com/@FoxSlide29029

Code

PRE-CA Coding Tour Guide #2: RoadRunner

YouTube

Video by FoxSlide

FoxSlide (FTC Team #29029) is not officially affiliated with or endorsing Rookie Academy or FIZMAT ROBOTICS #28061.

Original video: youtube.com/@FoxSlide29029

Lessons235 min

  1. 01What Autonomous Is and How It RunsLearn what happens in the 30-second Autonomous period, which sensors help a robot find its way, and how an autonomous OpMode moves from INIT to STOP. 35 min
  2. 02Driving Precise Distances with EncodersTurn inches into encoder ticks with a worked example, learn the encoder run modes, and write a `driveInches()` helper that uses `RUN_TO_POSITION`. 50 min
  3. 03Knowing Which Way You Face: the IMUSet up the Control Hub's built-in IMU with `RevHubOrientationOnRobot`, read the robot's yaw, and write a simple turn to a target heading. 45 min
  4. 04Accuracy and Control LogicFind out why robots miss their targets, use a proportional controller for accurate turns, and compare sequential code with state machines. 50 min
  5. 05Building, Testing and Debugging a RoutinePlan a path, structure an `@Autonomous` OpMode with helper methods and timers, and use telemetry, repeatability tests and logs to make it dependable. 55 min
Team assignment

Create a basic autonomous movement routine

Write an `@Autonomous` OpMode that starts from a taped start position, drives forward a measured distance using encoders, turns 90 degrees using the IMU, drives a second distance and stops inside a taped parking zone. Run it at least 10 times, record how close it ends up each time, and make at least one improvement based on your data.

Deliverables

Tick items off as your team completes them.

0/5

Learning objectives

  • Explain what the Autonomous period is and why reliable autonomous points matter
  • Convert distances into encoder ticks and drive measured distances with `RUN_TO_POSITION`
  • Read the robot's heading from the IMU and turn to a target angle
  • Use proportional control and state machines to make autonomous code accurate and organised
  • Build, test and debug a repeatable autonomous routine

Required materials

  • A working robot drivetrain with encoder-capable drive motors (encoder cables connected)
  • REV Control Hub (with built-in IMU) and a Driver Station (REV Driver Hub or Android phone)
  • At least two fully charged robot batteries
  • Laptop with Android Studio or OnBot Java and the current FTC SDK
  • Some field tiles (or a clear floor area), a tape measure and painter's tape
  • Engineering notebook or a shared spreadsheet for test results
  • Safety glasses for everyone near the robot while it moves

Expected outcomes

  • Students can calculate ticks per inch for their own drivetrain and calibrate it with a tape measure
  • Students can configure the IMU with `RevHubOrientationOnRobot` and read yaw in degrees
  • Students can write helper methods such as `driveInches()` and `turnToHeading()` with timeouts
  • Students can explain the difference between sequential code and a state machine
  • Students can run repeatability tests and use telemetry and logs to find the cause of errors

Knowledge check

20 questions across this week's lessons. Your best score for each lesson is saved.

  • What Autonomous Is and How It Runs–/4
  • Driving Precise Distances with Encoders–/4
  • Knowing Which Way You Face: the IMU–/4
  • Accuracy and Control Logic–/4
  • Building, Testing and Debugging a Routine–/4

Completion checklist

Tick items off as your team completes them.

0/7