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

Add way to reset SwerveDriveKinematics internal module states #5167

Closed
calcmogul opened this issue Mar 7, 2023 · 0 comments · Fixed by #5398
Closed

Add way to reset SwerveDriveKinematics internal module states #5167

calcmogul opened this issue Mar 7, 2023 · 0 comments · Fixed by #5398
Labels
component: wpimath Math library good first issue Good for newcomers.

Comments

@calcmogul
Copy link
Member

calcmogul commented Mar 7, 2023

Is your feature request related to a problem? Please describe.
SwerveDriveKinematics maintains an internal copy of the module states so it can maintain module heading when the chassis velocity is zero. However, it initializes them to zero in the constructor, which may not reflect the true module starting orientation.

Also, it's possible for the user to disable the robot and move the modules, which makes them inconsistent with the internal module states. A reset() function should be provided to reinitialize them (specifically the module headings) when the robot is re-enabled to avoid excessive movement.

Describe the solution you'd like
Add a reset() function for the internal module states and an optional constructor argument for the initial module states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: wpimath Math library good first issue Good for newcomers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant