ValleyLib is a modern, command-based robotics library for FTC, heavily inspired by WPILib. It provides a clean separation between core command logic and FTC-specific hardware integration.
valleyLib-core: Platform-agnostic scheduler, command, and subsystem abstractions.valleyLib-ftc: FTC-specific integration layers, input handling, and utilities.
To use ValleyLib in your project, 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.0)
- Getting started guide
- Pedro migration guide
- Custom command guide
- FTC trigger binding guide
- Pedro command-based guide
- Advanced controls, logging, and simulation
- Codebase review and recommendations
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, 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(). - Includes presets for
forLogitechF310(gamepad)andforDualShockLike(gamepad). - Configurable stick deadbands and custom shaping (exponents) via
withStickDeadband()andwithStickExponent().
ValleyLib provides powerful DSLs for building autonomous routines:
AutoDsl: A platform-agnostic builder API with alias methods likeadd,doInstant,waitFor, andifElsefor easy migration from other command DSLs.PedroAutoDsl: Specifically for Pedro Pathing, integrating path follows with command execution.FollowPathCommand: A command wrapper for individual path execution.PedroSubsystem: A subsystem abstraction for Pedro pathing.
FtcTelemetryBus: A centralized telemetry system that mirrors data to both the Driver Station and Panels dashboard.FtcCommandLogger: Optional listener that logs command lifecycle events (scheduled, finished, interrupted) to aid real-time debugging.
ValleyLib includes several building blocks to help teams get started quickly:
- Sample Hardware:
SampleDriveHardwareandSampleIntakeHardware. - Sample Autos:
SampleAutos.simpleTaxi(drive, taxiPath)andSampleAutos.taxiAndCycle(drive, intake, taxiPath, cyclePath). - RobotContainer: A template for centralizing robot subsystems and button bindings.
See valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/samples for copy-ready templates built around PedroAutoDsl and PedroCommands.