FRCteam3952 / FRC2023

2022 - 2023 Season Robot Code
Other
11 stars 16 forks source link

Global Coordinate System #39

Open ebay-kid opened 1 year ago

ebay-kid commented 1 year ago

We need a standard system to base all coordinates off of, regardless of which team we are on to avoid any math errors.

ebay-kid commented 1 year ago

I'm taking this one as well.

ebay-kid commented 1 year ago

Since AprilTags has a coordinate system, I'll just be following theirs for the sake of simplicity.

Relative to origin at right corner from Blue Alliance perspective.
+Y is towards the left corner,
+X is towards the Red Alliance.

The AprilTags coordinates (pg 4): https://firstfrc.blob.core.windows.net/frc2023/FieldAssets/2023LayoutMarkingDiagram.pdf

ebay-kid commented 1 year ago

The field is 315.5 by 651.25 inches (short side is +Y side, long side is +X side)

ebay-kid commented 1 year ago

Most of the important stuff has been implemented in https://github.com/FRCteam3952/FRC2023/commit/88e05d0d5280d982af08130c618e8421b61d3276, though I realized last night that the field isn't symmetric to the origin (should be a quick fix to the mirror function to add another parameter so the coordinate is mirrored both ways).

ebay-kid commented 1 year ago

I've just realized that the function works as intended. Probably shouldn't trust my brain at 12am to give accurate code reviews