docs(commandbased): Add Python code examples and RobotPy API references (#2645) - #3338
Open
lukalyc wants to merge 2 commits into
Open
docs(commandbased): Add Python code examples and RobotPy API references (#2645)#3338lukalyc wants to merge 2 commits into
lukalyc wants to merge 2 commits into
Conversation
lukalyc
force-pushed
the
feature/issue-2645-python-command-docs
branch
from
August 2, 2026 21:22
98d9b61 to
514f254
Compare
auscompgeek
reviewed
Aug 3, 2026
|
|
||
| ## Composing Triggers | ||
|
|
||
| The ``Trigger`` class can be composed to create composite triggers through the ``and()``, ``or()``, and ``negate()`` methods (or, in C++, the ``&&``, ``||``, and ``!`` operators). For example: |
Member
There was a problem hiding this comment.
Should we document the Python bitwise operators (&, |, ~) here too?
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.
This PR completes the Python documentation additions for the Commands v2 section as tracked in issue #2645 (following up on PR #2648).
Summary of Changes:
onTrue,whileTrue,toggleOnTrue, chaining, composing withand_, debouncing) and Python API links (commands2.button.Trigger,commands2.button.CommandXboxController,commands2.button.JoystickButton).commands2.CommandSchedulermethods (schedule,run,onCommandInitialize, etc.) and Python code tab for event callbacks.Functions and Lambdas (Python)subsection under "Passing Functions As Parameters".Command, and subclassingSequentialCommandGroup.wpimath.controller.PIDControllerAPI reference and Python tab forRapidReactCommandBotshooter.wpimath.trajectory.TrapezoidProfileAPI reference and Python tab forDriveDistanceOffboard.wpimath.controller.ProfiledPIDControllerAPI reference and Python tab forRapidReactCommandBotdrive.robot.py,robotcontainer.py, andconstants.py.Closes #2645