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

[wpimath] Check LTV controller max velocity precondition #5142

Conversation

calcmogul
Copy link
Member

@calcmogul calcmogul commented Feb 26, 2023

Supersedes #5141.

@calcmogul calcmogul requested a review from a team as a code owner February 26, 2023 19:16
@calcmogul
Copy link
Member Author

The UB found in the other PR is a symptom of an implicit max velocity precondition being violated. If the max velocity is less than zero, the for loop does nothing and the interpolating map is empty. Accessing the empty map is UB.

@PeterJohnson PeterJohnson merged commit ce3686b into wpilibsuite:main Feb 26, 2023
@calcmogul calcmogul deleted the wpimath-check-ltv-controller-max-velocity-precondition branch February 26, 2023 23:06
Starlight220 pushed a commit to Starlight220/allwpilib that referenced this pull request Mar 2, 2023
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants