-
Notifications
You must be signed in to change notification settings - Fork 665
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
Add ProfiledPIDController with feedforward snippets #8280
Conversation
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.
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
Per @calcmogul since there's been no action on #5914, this should move forward so frc-docs is correct |
Adds snippets demonstrating
ProfiledPIDControllerusage withSimpleMotorFeedforwardusing the two-parametercalculate(currentVelocity, nextVelocity)method.Changes
wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/snippets/profiledpidfeedforward/Robot.javawpilibcExamples/src/main/cpp/snippets/ProfiledPIDFeedforward/cpp/Robot.cppPurpose
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:
ProfiledPIDControllerto control motor positionfeedforward.calculate(lastSpeed, controller.getSetpoint().velocity)patternRelated