FIRST Tech Challenge · Team 2845 · 2023–26
Concurrent Subsystem Control
Thirty seconds of autonomous is not much time, and a robot that drives, stops, intakes, stops, then scores spends most of it waiting on itself. I rebuilt the team’s robot code around four module types so subsystems could run side by side, then rebuilt it again when four concurrent threads started fighting over the same hardware.
2023–2026 · Tampa, FL
Java · Android Studio · Multithreading · FTC Dashboard
The Problem
Thirty seconds is not much time. A robot that drives, stops, runs its intake, stops, and then scores spends most of autonomous waiting on itself. The team had a small command library from earlier seasons that could run a task in the background on its own thread, but almost no robot code was built on it, and there was no clear place for a new teammate to add a feature.
What I Built
In 2023–24 I rebuilt the robot code around four kinds of modules. Subsystems own the hardware and expose simple methods. Commands drive subsystems and know when they are done. OpModes, the programs a driver picks on the phone, choose which commands to run based on Utilities like odometry and vision. Commands can run one after another or side by side, so the robot can drive to a spot while the intake gets ready.
Utilities
Know where things are
Odometry · PID · AprilTags · prop locator
OpModes
Decide what to do
Autonomous · TeleOp
Commands
Do one job, then finish
PID drive · approach tag · intake · deposit
Subsystems
Own the hardware
Drivetrain · intake · conveyor · outtake
Scaling to Four Threads
By 2025–26, the robot had to aim a turret, hold a flywheel at speed, sort balls, and run its intake, all while driving. With that many commands on their own threads, they were all reading and writing the same motors and sensors, and every extra hardware call slowed down every loop.
So I separated deciding from doing. Commands on background threads only set targets in shared variables. A single I/O loop does all the talking to hardware: one bulk read from the control hub per cycle, then motor outputs written once. The autonomous path talks to the background aiming, launching, and intake commands through a few shared flags. It sets “start launching,” then waits for the launch command to clear it.
Result
Autonomous reads as a plain list of moves while the turret, launcher, and intake work in the background. The same structure carried the code through three seasons and three different robots.