VEX Push Back
Coding Tutorial
A complete guide to programming a competitive VEX robotโfrom hardware setup through odometry, PID tuning, and precision distance-sensor resetsโusing real code from a ranked skills run.
Start Learning โ Jump to Distance ResetsWhat You'll Learn
This tutorial walks through every layer of the Push Back robot's codebase, explaining why each decision was made alongside the code that implements it. By the end you'll understand:
Environment Setup
Install PROS CLI, create a project, and add the LemLib template.
Hardware Config
Wire motors, sensors, and pneumatics, then declare them in code.
Odometry
How dead-reckoning lets the robot know its X, Y position and heading.
PID Controllers
Tune lateral and angular PID so moves are fast and accurate.
Distance Resets โ
Correct odometry drift mid-run using wall-facing distance sensors.
Writing Autons
Build match autons and a full skills run from scratch.
Driver Control
Tank drive, intake logic, pneumatics, and button debouncing.
Tech Stack
| Tool / Library | Purpose | Version |
|---|---|---|
| PROS | Real-time operating system for V5 Brain | 3.x / 4.x |
| LemLib | Odometry, PID movement, path following | 0.4.x |
| VEX V5 Brain | Main compute unit | โ |
| VEX V5 Motors | Blue gearset drivetrain + intake | โ |
| Distance Sensors | Wall-relative position correction | V5 gen2 |
| Inertial Sensor (IMU) | Heading tracking | V5 |
| Optical Sensor | Block color detection (anti-jam / sorting) | V5 |
| GPS Sensor | Global position (backup / skills) | V5 |
Repository Structure
Vex-Push-Back/
โโโ include/
โ โโโ robot.hpp โ global hardware declarations
โ โโโ autons/autons.hpp โ auton function declarations
โ โโโ systems/
โ โโโ chassis.hpp โ custom Chassis class (distance resets live here)
โโโ src/
โ โโโ main.cpp โ initialize(), autonomous(), opcontrol()
โ โโโ robot.cpp โ hardware definitions & LemLib config
โ โโโ autons/
โ โโโ autons.cpp โ all auton routines (match + skills)
โโโ static/ โ this website