You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
First of all, thanks a lot for sharing the path planner code! It is a big help for the team I mentor!
We encountered an issue with the library, though. We trying to use PathPlannerTrajectory.transformStateForAlliance, looking at the PathPlannerTrajectory.java:124, it looks like translation happens by mirroring around axis with Y=FIELD_WIDTH_METERS/2: new Translation2d(state.poseMeters.getX(), FIELD_WIDTH_METERS - state.poseMeters.getY());
I think to transform to red alliance coordinates, we should actually mirror around axis with X=8, so the code should look like: new Translation2d(16 - state.poseMeters.getX(), state.poseMeters.getY());
What do you think?
The text was updated successfully, but these errors were encountered:
The origin is always assumed to be the right corner of your current alliance station. This years game makes that a little more difficult because the field is not symmetrical in that way, thus mirroring over the Y axis is correct
On Thu, Feb 9, 2023, 4:15 AM Nick Hadley ***@***.***> wrote:
The origin is always assumed to be the right corner of your *current
alliance station*. This years game makes that a little more difficult
because the field is not symmetrical in that way, thus mirroring over the Y
axis is correct.
Ok, that starts making sense. So April tags locations need to be
transformed for alliance as well? I wonder if it would be simpler to have
origin fixed in the blue alliance corner always and have transformation
only for PP trajectory? Wdyt?
Hello,
First of all, thanks a lot for sharing the path planner code! It is a big help for the team I mentor!
We encountered an issue with the library, though. We trying to use PathPlannerTrajectory.transformStateForAlliance, looking at the PathPlannerTrajectory.java:124, it looks like translation happens by mirroring around axis with Y=FIELD_WIDTH_METERS/2:
new Translation2d(state.poseMeters.getX(), FIELD_WIDTH_METERS - state.poseMeters.getY());
I think to transform to red alliance coordinates, we should actually mirror around axis with X=8, so the code should look like:
new Translation2d(16 - state.poseMeters.getX(), state.poseMeters.getY());
What do you think?
The text was updated successfully, but these errors were encountered: