ValleyLib is a modern, command-based robotics library for FTC, heavily inspired by WPILib and FTCLib. It provides a clean separation between core command logic and FTC-specific hardware integration, with first-class Pedro Pathing support.
valleyLib-core: Platform-agnostic scheduler, command, and subsystem abstractions (pure Java — desktop-testable).valleyLib-ftc: FTC-specific integration: OpModes, input handling, motor wrappers, controllers, telemetry, and Pedro Pathing.
Full documentation site: the docs/ folder is an MkDocs Material site covering every feature. Build it locally with:
pip install -r docs/requirements.txt
mkdocs servethen open http://127.0.0.1:8000. (Read the Docs builds are configured via .readthedocs.yaml.)
Quick links into the source docs:
- Home / feature overview
- Installation
- Quickstart
- Command system: Commands · Decorators · Groups & Factories · Scheduler · Subsystems · AutoDsl
- FTC integration: CommandOpMode · Gamepads · Triggers · Hardware · PID & Feedforward · Telemetry · RobotContainer
- Pedro Pathing: Overview · PedroAutoDsl · Migration guide
- Guides: Custom commands · Simulation & testing · Samples
- Reference: API summary · Design notes
Add the JitPack repository to your settings.gradle or build.gradle:
repositories {
maven { url 'https://jitpack.io' }
}Then add the dependencies:
dependencies {
implementation 'com.github.ValleyX.valleyLib:core:Tag'
implementation 'com.github.ValleyX.valleyLib:ftc:Tag'
}(Replace Tag with a release tag like 1.0.7)
| Version | Usable? |
|---|---|
| 1.0.0 | No |
| 1.0.1 | No |
| 1.0.2 | Yes (deprecated) |
| 1.0.3 | No |
| 1.0.4 | No |
| 1.0.5 | No |
| 1.0.6 | Yes |
| 1.0.7 | Yes (recommended) |
Compose complex robot behavior using functional decorators:
driveCommand
.until(robot::atTarget)
.andThen(intakeCommand.withTimeout(1.0))
.finallyDo(() -> drive.stop());Common decorators include withTimeout, until, onlyWhile, unless, beforeStarting, finallyDo, repeatedly, andThen, alongWith, raceWith, and deadlineWith.
CommandGamepad provides easy trigger binding with support for both Xbox and PlayStation naming conventions:
- Xbox:
a(),b(),x(),y(),leftBumper(),rightBumper(),dpadUp(), etc. - PlayStation:
cross(),circle(),square(),triangle(),l1(),r1(). - Full button coverage including
start(),back(),guide(), and stick clicks (l3()/r3()). - Presets for
forLogitechF310(gamepad)andforDualShockLike(gamepad). - Configurable stick deadbands and response curves via
withStickDeadband()andwithStickExponent(). - WPILib-style
Triggerbindings:onTrue,onFalse,onChange,whileTrue,whileFalse,toggleOnTrue, plusand/or/negate/debouncecomposition. - Bindings auto-register with the polled
TriggerManager—driver.a().onTrue(cmd)just works inside aCommandOpMode.
Build requirement-carrying commands inline, WPILib-style — no command classes needed:
drive.setDefaultCommand(drive.run(() -> drive.tankDrive(driver.leftY(), driver.rightY())));
driver.a().whileTrue(intake.startEnd(intake::in, intake::stop));runOnce, run, startEnd, and runEnd all require their subsystem, so the scheduler resolves conflicts correctly.
- FTCLib-style
Motor,MotorEx, andMotorGroupwrappers with GoBILDA presets, a smart encoder (overflow-corrected velocity, acceleration estimation), and velocity/position control modes. - A full controller stack:
PIDFController,PIDController,PDController,PController, and WPILib'sSimpleMotorFeedforward.
AutoDsl: platform-agnostic builder with alias methods (add,doInstant,waitFor,ifElse) for easy migration from other command DSLs.PedroAutoDsl: path-first builder for Pedro Pathing autos.FollowPathCommand/PedroCommands/PedroSubsystem: full command-based Pedro Pathing integration — no state machines, no manualfollower.update().
FtcTelemetryBus: oneput(...)mirrors data to the Driver Station and the Panels dashboard; supportsclear()for discarding stale queued data.FtcCommandLogger: optional listener that logs command lifecycle events (scheduled, finished, canceled) — enable with one override inCommandOpMode.
valleyLib-core has no Android dependencies: unit-test your commands and autos on your laptop, with simulationPeriodic() hooks and a scheduler simulation mode for physics models.
See valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/samples for copy-ready templates:
SampleTeleOp+SimpleRobot: a complete TeleOp with a RobotContainer, default drive command, and button bindings.SampleDriveHardware/SampleIntakeHardware: subsystem templates.SampleAutos:simpleTaxi(...)andtaxiAndCycle(...)Pedro autonomous factories.PedroMigrationSample: line-by-line migration from a traditional Pedro state machine.
./gradlew :valleyLib-core:test :valleyLib-ftc:assembleRelease