Skip to content

Add NextFTC-style command composition, AutoDsl, FTC triggers, controller shaping, and scheduler improvements#5

Merged
Jaettinger merged 1 commit into
masterfrom
codex/enhance-valleylib-ftc-documentation-and-features
Feb 27, 2026
Merged

Add NextFTC-style command composition, AutoDsl, FTC triggers, controller shaping, and scheduler improvements#5
Jaettinger merged 1 commit into
masterfrom
codex/enhance-valleylib-ftc-documentation-and-features

Conversation

@elluveride

Copy link
Copy Markdown
Collaborator

Motivation

  • Provide richer command composition and factories to reduce boilerplate and enable fluent command pipelines similar to NextFTC/WPILib.
  • Add a small autonomous DSL and Pedro pathing helpers to let teams express autos declaratively and compose pathing with commands.
  • Introduce an FTC-friendly trigger/binding model and controller input shaping for more expressive teleop bindings and safer button logic.
  • Improve scheduler observability and desktop simulation support to aid debugging and automated tests.

Description

  • Added fluent command decorators and helpers to Command (e.g. withTimeout, until, onlyWhile, andThen, alongWith) and implemented Commands static factories for common patterns.
  • Implemented command groups and decorators: SequentialCommandGroup, ParallelCommandGroup, RaceCommand, DeadlineCommand, InstantCommand, WaitUntilCommand, and supporting base logic and requirement aggregation.
  • Added AutoDsl for building sequential/autonomous timelines and Pedro-specific helpers PedroAutoDsl, PedroCommands, and PedroSubsystem command helpers for path following.
  • Extended CommandScheduler with listeners (CommandSchedulerListener), lifecycle callbacks (addListener, removeListener, isScheduled, reset), simulation support (setSimulationEnabled, runSimulationStep, simulationPeriodic on Subsystem), and emitted events for schedule/finish/cancel.
  • Introduced FTC input & binding stack: CommandXboxLike, CommandGamepad, GamepadEx, Trigger, and TriggerManager, including composition (and, or, negate) and temporal shaping (debounce), plus binding helpers (onTrue, whileTrue, toggleOnTrue, etc.).
  • Updated FTC runtime integration: CommandOpMode now polls triggers, wires TriggerManager in init/loop/stop, supports optional command logging via enableCommandLogging(), and added RobotContainer.getTeleOpInitCommand() placeholder.
  • Added telemetry-backed listener FtcCommandLogger, desktop simulation notes and new documentation files, and updated README.md to reference the new guides.

Testing

  • Added and ran unit tests AutoDslTest, CommandsFactoryTest, CommandSchedulerTest, and TriggerTest using JUnit; all tests executed successfully.
  • Exercised scheduler and trigger behaviors including listener callbacks, default command scheduling, simulation hook invocation, and trigger composition in automated tests, which passed without failures.

Codex Task

@elluveride elluveride added the codex ChatGPT made this label Feb 27, 2026 — with ChatGPT Codex Connector
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@elluveride elluveride requested a review from Copilot February 27, 2026 19:14
@Jaettinger Jaettinger merged commit c2ebf35 into master Feb 27, 2026
2 of 3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex ChatGPT made this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants