CDALib
A FIRST Tech Challenge robot-code library. Build OpModes out of reusable parts — subsystems, devices, controllers, bindings, and a task system — with Lynx bulk caching and low loop times handled for you.
What CDALib gives you
ModularOpMode
A base OpMode that drives your registered subsystems and modules through their init / start / update lifecycles — and manages Lynx bulk caching so each loop does a single bulk read.
Subsystems & Devices
Structured wrappers for motors, servos, CR servos, and sensors (IMU, color, distance, touch, analog/digital input, REV Color Sensor V3).
Controllers
PID, feedforward, and composable controllers for closed-loop mechanisms.
Task system
Sequential, parallel, race, deadline, repeat, deferred, and path-following tasks that compose with a fluent builder API.
Bindings
Declarative, named gamepad button and analog bindings — including toggles — that decouple input wiring from behavior.
Modules
OpMode-shaped units of cross-cutting behavior, including a ready-made PedroPathing TeleOp drive module.
Quick start
Extend ModularOpMode, register your subsystems in preload(), and
CDALib runs the lifecycle for you:
import com.cdarobotics.cdalib.opmodes.ModularOpMode;
import com.outoftheboxrobotics.photoncore.Photon;
import com.qualcomm.robotcore.eventloop.opmode.TeleOp;
@Photon // optional: enable PhotonFTC for lower loop times
@TeleOp(name = "My TeleOp (CDALib)")
public class MyTeleOp extends ModularOpMode {
private MyDriveSubsystem drive;
@Override
protected void preload() {
drive = new MyDriveSubsystem(hardwareMap);
registerSubsystem(drive); // driven through init/start/update automatically
// installModule(...) to add modules, bindingManager for gamepad bindings
}
}