05 / From Timed Steps to Actions
Timed and Encoder Autonomous
Compare simple time-based auto with encoder-based movement.
05 / From Timed Steps to Actions
Compare simple time-based auto with encoder-based movement.
You will
This lesson is about sequencing decisions without a human driver. Autonomous code must know where it starts, what it is trying to accomplish, how each step ends, and what safe behavior happens when a step fails.
Time-based autonomous is easy to start with, but battery voltage and friction change distance. It is best for learning sequencing, stops, and timeouts before moving to encoder and Road Runner control.
Encoder autonomous uses motor position feedback to stop closer to a target. It is still not full localization, but it teaches feedback and verification.
Teach autonomous as a progression from timed steps to encoder checks to state machines and actions. Each layer should preserve the same core habits: explicit state, telemetry for the active step, timeout or finish condition, and a final safe stop.
For this specific lesson, students should first restate the goal in robot terms, then identify the value or behavior they expect to observe, then run the smallest test that proves the idea. The lesson should feel like a guided lab: predict, run, observe, explain, and only then extend.
TimedStep.java · Java
runtime.reset();
while (opModeIsActive() && runtime.seconds() < 1.0) {
robot.frontLeft.setPower(0.25);
robot.frontRight.setPower(0.25);
telemetry.addLine("Driving forward");
telemetry.update();
}
robot.frontLeft.setPower(0);
robot.frontRight.setPower(0);Autonomous failures are easier to diagnose when the robot reports why it moved on or stopped. Print the selected branch, active state, elapsed time, target, measurement, and stop reason. If those values are missing, the team is debugging a story with half the pages torn out.
Check your understanding
Why should autonomous steps have timeouts?
0 of 1 answered
References
Finished reading?
You'll move on to “Autonomous State Machines” next.