Skip to content

[cmd3] Add example and template projects for commands v3 and make hatchbot example idiomatic#8887

Open
SamCarlberg wants to merge 9 commits into
wpilibsuite:mainfrom
SamCarlberg:commandsv3/rebuilt-example-bot
Open

[cmd3] Add example and template projects for commands v3 and make hatchbot example idiomatic#8887
SamCarlberg wants to merge 9 commits into
wpilibsuite:mainfrom
SamCarlberg:commandsv3/rebuilt-example-bot

Conversation

@SamCarlberg
Copy link
Copy Markdown
Member

The command3 example project contains a program that could plausibly play in the 2026 rebuilt game. It includes nested mechanisms (Intake has an inner IntakeWrist and IntakeRoller and is similar to the v2 superstructure concept), swerve drive with localization and path following (albeit stubbed for sake of example), opmodes and opmode-scoped commands, and command-scoped triggers.

The template projects are basic skeletons. The larger template includes a basic command that just increments and prints a counter variable every time it runs.

The hatchbot v3 example has been refactored to be more idiomatic:

  • RobotContainer removed
  • "Subsystem" names in packages, comments, and classes has been replaced with "Mechanism"
  • Some v2-specific comments and structures have been reworded or deleted
  • The Drive mechanism now provides commands for arcade drive and driving a distance, instead of exposing public methods that write directly to hardware (which broke encapsulation and made it possible to issue conflicting hardware requests)

@SamCarlberg SamCarlberg requested a review from sciencewhiz May 10, 2026 18:21
@SamCarlberg SamCarlberg added component: examples component: commands v3 WPILib Commands library version 3 labels May 10, 2026
@SamCarlberg SamCarlberg requested review from a team as code owners May 10, 2026 18:21
@github-actions github-actions Bot removed the component: commands v3 WPILib Commands library version 3 label May 10, 2026
@github-actions github-actions Bot added the build Monorepo organization, Gradle/CMake/Bazel, upstream_utils, etc label May 10, 2026
@SamCarlberg
Copy link
Copy Markdown
Member Author

Note that the epilogue errors need to be resolved by #8886

Comment thread wpilibjExamples/src/main/java/org/wpilib/examples/command3/mechanisms/Intake.java Outdated
Comment thread wpilibjExamples/src/main/java/org/wpilib/templates/commandv3/Robot.java Outdated
Comment thread wpilibjExamples/src/main/java/org/wpilib/examples/examples.json Outdated
Comment thread wpilibjExamples/src/main/java/org/wpilib/examples/examples.json Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Monorepo organization, Gradle/CMake/Bazel, upstream_utils, etc component: examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants