-
Notifications
You must be signed in to change notification settings - Fork 666
Add ProfiledPIDController with feedforward snippets #8280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jasondaming
wants to merge
9
commits into
wpilibsuite:main
Choose a base branch
from
jasondaming:add-profiled-pid-feedforward-snippet
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add ProfiledPIDController with feedforward snippets #8280
jasondaming
wants to merge
9
commits into
wpilibsuite:main
from
jasondaming:add-profiled-pid-feedforward-snippet
+151
−0
Conversation
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
Adds snippets demonstrating ProfiledPIDController usage with SimpleMotorFeedforward using the two-parameter calculate() method (currentVelocity, nextVelocity). These snippets will be used in frc-docs to document the recommended feedforward pattern with ProfiledPIDController.
jasondaming
added a commit
to jasondaming/frc-docs
that referenced
this pull request
Oct 8, 2025
Replace inline code blocks with RLIs to snippets from allwpilib. Java and C++ examples now reference compilable snippet code that will be tested in every allwpilib build. Python remains as inline code block since Python snippets are maintained in robotpy repository. Related: wpilibsuite/allwpilib#8280
There's a list of valid tags here: allwpilib/shared/examplecheck.gradle Lines 45 to 85 in 2fb5271
|
How long is this expected to last? Last I checked, we're trying to axe ProfiledPIDController in favor of just using TrapezoidProfile and PIDController. |
… acceleration) Per the SimpleMotorFeedforward API, the two-parameter calculate method that takes velocity and acceleration is deprecated. This updates the snippet to use calculateWithVelocities(currentVelocity, nextVelocity) which is the recommended approach. Addresses wpilibsuite#8280
- Add Javadoc comment for goToPosition method - Split long line to stay under 100 character limit - Remove redundant field initializer for m_lastSpeed
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.
Adds snippets demonstrating
ProfiledPIDController
usage withSimpleMotorFeedforward
using the two-parametercalculate(currentVelocity, nextVelocity)
method.Changes
wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/snippets/profiledpidfeedforward/Robot.java
wpilibcExamples/src/main/cpp/snippets/ProfiledPIDFeedforward/cpp/Robot.cpp
Purpose
These snippets will be used in frc-docs (wpilibsuite/frc-docs#3117) to document the recommended feedforward pattern with ProfiledPIDController, replacing deprecated inline code examples.
The snippets demonstrate:
ProfiledPIDController
to control motor positionfeedforward.calculate(lastSpeed, controller.getSetpoint().velocity)
patternRelated