03 / TeleOp and Mecanum
Driver Ergonomics and Safe TeleOp
Design controls that are predictable, recoverable, and competition-ready.
03 / TeleOp and Mecanum
Design controls that are predictable, recoverable, and competition-ready.
You will
This lesson is about the interface between drivers and robot behavior. Good TeleOp code is not just mathematically correct; it is predictable under pressure, easy to recover, and readable enough that the drive team can describe what the robot is supposed to do.
A button held for half a second may be seen by dozens of loops. Edge detection compares current and previous gamepad states so one press schedules one action.
Competition code should include reset buttons, safe states, and telemetry for the driver coach. When something unexpected happens, the team needs a known way back.
Test driver code in movement primitives and mechanism primitives instead of full-match chaos. Add deadbands, slow modes, edge detection, and safe states only after students can explain the raw input and final output for each control.
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.
ButtonEdgeDetection.java · Java
Gamepad current = new Gamepad();
Gamepad previous = new Gamepad();
previous.copy(current);
current.copy(gamepad2);
if (current.a && !previous.a) {
robot.arm.goToPickup();
}
if (current.touchpad_finger_1 && !previous.touchpad_finger_1) {
robot.goToSafeState();
}When TeleOp feels wrong, translate driver feedback into small tests: forward, strafe, rotate, precision mode, button press, held button, and safe recovery. Print raw inputs and final commands so the team can separate driver feel from wiring, math, and mechanism bugs.
Check your understanding
Why compare current and previous gamepad states?
0 of 1 answered
References
Finished reading?
You'll move on to “Subsystem Lifecycle” next.