Skip to content
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

Make ProfiledPIDController support arbitrary profile types #5915

Open
calcmogul opened this issue Nov 11, 2023 · 2 comments
Open

Make ProfiledPIDController support arbitrary profile types #5915

calcmogul opened this issue Nov 11, 2023 · 2 comments
Labels
component: wpimath Math library effort: 5 type: fix Iterations on existing features or infrastructure.

Comments

@calcmogul
Copy link
Member

calcmogul commented Nov 11, 2023

Is your feature request related to a problem? Please describe.
WPILib now has trapezoid and exponential profiles, and it would be nice to have a more generic interface for them in ProfiledPIDController.

Describe the solution you'd like

Here's some options.

  1. Make an interface in Java and a concept in C++ for motion profiles. I slightly prefer this one, but I haven't thought about it much and could be persuaded otherwise.
  2. Add suppliers to the ProfiledPIDController interface.
  3. Remove ProfiledPIDController and have users plumb the profile they want into PIDController.calculate().
@calcmogul calcmogul added component: wpimath Math library type: fix Iterations on existing features or infrastructure. labels Nov 11, 2023
@auscompgeek
Copy link
Member

Add suppliers to the ProfiledPIDController interface.

This would be simpler for Python to wrap.

@Gold856
Copy link
Contributor

Gold856 commented Nov 12, 2023

If you use suppliers, how do you change the constraints? TrapezoidProfile and ExponentialProfile both use different constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: wpimath Math library effort: 5 type: fix Iterations on existing features or infrastructure.
Projects
None yet
Development

No branches or pull requests

3 participants