Add NextFTC-style command composition, AutoDsl, FTC triggers, controller shaping, and scheduler improvements#5
Merged
Jaettinger merged 1 commit intoFeb 27, 2026
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR adds NextFTC/WPILib-style command composition, an autonomous DSL, FTC trigger bindings, controller input shaping, and enhanced scheduler observability to ValleyLib. The changes transform the library into a comprehensive command-based robotics framework with fluent APIs for building complex robot behaviors.
Changes:
- Added fluent command decorators and static factories (Commands) for common patterns like sequence, parallel, race, timeout, and conditional execution
- Implemented FTC-friendly trigger/binding system with logical composition, debouncing, and event handlers (onTrue, whileTrue, toggleOnTrue, etc.)
- Extended CommandScheduler with listener callbacks, simulation hooks, and runtime introspection (isScheduled, reset)
- Added Pedro Pathing command-based helpers (PedroSubsystem, PedroCommands, PedroAutoDsl) for declarative path following
- Introduced AutoDsl for building sequential autonomous routines with markers, conditionals, and group composition
- Added CommandXboxLike/CommandGamepad with axis shaping (deadband/exponent) and Logitech F310 preset configuration
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| valleyLib-core/src/main/java/com/vcs/valleylib/core/command/Command.java | Added fluent decorator methods (withTimeout, until, andThen, alongWith, etc.) |
| valleyLib-core/src/main/java/com/vcs/valleylib/core/command/Commands.java | Static factory methods for common command patterns |
| valleyLib-core/src/main/java/com/vcs/valleylib/core/command/InstantCommand.java | Added initialize() to reset hasRun flag |
| valleyLib-core/src/main/java/com/vcs/valleylib/core/command/WaitUntilCommand.java | New command that finishes when condition becomes true |
| valleyLib-core/src/main/java/com/vcs/valleylib/core/command/decorators/*.java | Command group implementations (Sequential, Parallel, Race, Deadline) with requirement aggregation |
| valleyLib-core/src/main/java/com/vcs/valleylib/core/scheduler/CommandScheduler.java | Added listener support, simulation hooks, isScheduled, and reset methods |
| valleyLib-core/src/main/java/com/vcs/valleylib/core/scheduler/CommandSchedulerListener.java | Observer interface for command lifecycle events |
| valleyLib-core/src/main/java/com/vcs/valleylib/core/subsystem/Subsystem.java | Added simulationPeriodic() hook for desktop testing |
| valleyLib-core/src/main/java/com/vcs/valleylib/core/auto/AutoDsl.java | Declarative autonomous builder with markers, conditionals, and group support |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/input/Trigger.java | FTC trigger primitive with composition (and/or/negate), debouncing, and event bindings |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/input/TriggerManager.java | Registry for polling trigger bindings in CommandOpMode |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/input/CommandXboxLike.java | Xbox-layout controller with deadband/exponent axis shaping |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/input/CommandGamepad.java | FTC Gamepad wrapper with F310 preset configuration |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/input/GamepadEx.java | Backward-compatible alias for CommandGamepad |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/opmode/CommandOpMode.java | Integrated TriggerManager polling, configureBindings hook, and optional command logging |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/logging/FtcCommandLogger.java | Telemetry-backed command lifecycle logger |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/RobotContainer.java | Added getTeleOpInitCommand() placeholder and updated terminology |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/pedro/PedroSubsystem.java | Added command helpers (follow, waitUntilIdle, setMaxPower) |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/pedro/PedroCommands.java | Static factories for Pedro command workflows |
| valleyLib-ftc/src/main/java/com/vcs/valleylib/ftc/pedro/PedroAutoDsl.java | Path-first autonomous builder for Pedro integration |
| valleyLib-core/src/test/java/com/vcs/valleylib/core/scheduler/CommandSchedulerTest.java | Added tests for listeners and simulation hooks |
| valleyLib-core/src/test/java/com/vcs/valleylib/core/command/CommandsFactoryTest.java | Tests for Commands static factories |
| valleyLib-core/src/test/java/com/vcs/valleylib/core/auto/AutoDslTest.java | Tests for AutoDsl builder with markers and conditionals |
| valleyLib-ftc/src/test/java/com/vcs/valleylib/ftc/input/TriggerTest.java | Tests for trigger composition and event bindings |
| docs/*.md | Comprehensive documentation for new features (trigger bindings, Pedro integration, advanced controls, NextFTC upgrade notes) |
| README.md | Added links to new documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
Command(e.g.withTimeout,until,onlyWhile,andThen,alongWith) and implementedCommandsstatic factories for common patterns.SequentialCommandGroup,ParallelCommandGroup,RaceCommand,DeadlineCommand,InstantCommand,WaitUntilCommand, and supporting base logic and requirement aggregation.AutoDslfor building sequential/autonomous timelines and Pedro-specific helpersPedroAutoDsl,PedroCommands, andPedroSubsystemcommand helpers for path following.CommandSchedulerwith listeners (CommandSchedulerListener), lifecycle callbacks (addListener,removeListener,isScheduled,reset), simulation support (setSimulationEnabled,runSimulationStep,simulationPeriodiconSubsystem), and emitted events for schedule/finish/cancel.CommandXboxLike,CommandGamepad,GamepadEx,Trigger, andTriggerManager, including composition (and,or,negate) and temporal shaping (debounce), plus binding helpers (onTrue,whileTrue,toggleOnTrue, etc.).CommandOpModenow polls triggers, wiresTriggerManagerininit/loop/stop, supports optional command logging viaenableCommandLogging(), and addedRobotContainer.getTeleOpInitCommand()placeholder.FtcCommandLogger, desktop simulation notes and new documentation files, and updatedREADME.mdto reference the new guides.Testing
AutoDslTest,CommandsFactoryTest,CommandSchedulerTest, andTriggerTestusing JUnit; all tests executed successfully.Codex Task