Skip to content

Conversation

@bhall-ctre
Copy link
Contributor

@bhall-ctre bhall-ctre commented Oct 23, 2024

  1. The robot-relative feedforward Y components need to be inverted in kMirrored mode, as left and right are flipped.
  2. In kRotational mode, the field rotation needs to be rotated by 180 degrees, not subtracted from 180 degrees. For example, a 90 degree rotation should become -90 after rotating, but stay 90 degrees after mirroring.

I wasn't sure what the best way to implement 1 is API-wise, so for now I implemented two new functions flipFeedforwardXs and flipFeedforwardYs to handle the two components. Feel free to rename the functions or try to merge them into the existing flipFeedforwards function

In mirrored, the robot should face towards the same Y of the field
(180 - rotation), but in rotational the heading should just be rotated
180 degrees (rotation - 180), facing the opposite Y of the field.
The Y components of the robot relative forces also need to be inverted
when flipping according to kMirrored, as left and right are flipped.
@github-actions github-actions bot added the PathPlannerLib Changes to PathPlannerLib label Oct 23, 2024
@mjansen4857 mjansen4857 merged commit e749a1d into mjansen4857:main Oct 24, 2024
@bhall-ctre bhall-ctre deleted the flipping-util-fixes branch October 24, 2024 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PathPlannerLib Changes to PathPlannerLib

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants