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

Flipped Choreo auto path doesn't flip angular velocity #565

Closed
vqxel opened this issue Jan 20, 2024 · 2 comments
Closed

Flipped Choreo auto path doesn't flip angular velocity #565

vqxel opened this issue Jan 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@vqxel
Copy link
Contributor

vqxel commented Jan 20, 2024

Take any Choreo generated path that has some rotation and use it in a PathPlanner auto. If you run it on blue (not mirrored) it runs fine. If you run it on red (mirrored) none of the rotation actually happens unless you use rotational feedback. Rotational feedforward doesn't work.

Video:
https://github.com/mjansen4857/pathplanner/assets/57022309/ff2c5c82-bd6c-47f3-a5ce-5159a5efad68

I cloned pplib and traced the bug to this line here:
mirrored.holonomicAngularVelocityRps.ifPresent(v -> mirrored.holonomicAngularVelocityRps = Optional.of(-v));

This checks if the mirrored path has the holonomicAngularVelocityRps field which it doesn't because it was just instantiated above. If you change this to state instead of mirrored for the check if it's present it works. I tested this in my own codebase.

This is what it looks like with the change:
https://github.com/mjansen4857/pathplanner/assets/57022309/766541e6-7fc1-41bc-8925-702a62f77ae0

@vqxel vqxel added the bug Something isn't working label Jan 20, 2024
@vqxel
Copy link
Contributor Author

vqxel commented Jan 20, 2024

#566 Sorry im new to making PRs and stuff on other people's repos. Probably shouldn't have created this issue and should have just posted all this to my PR, not this issue.

@vqxel vqxel closed this as completed Jan 20, 2024
@mjansen4857
Copy link
Owner

mjansen4857 commented Jan 20, 2024

2024.1.4 is currently being pushed with this fixed. Forgot to do it last night

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants