-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from frc5024/wpi2021
- Loading branch information
Showing
5 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"currentLanguage": "java", | ||
"enableCppIntellisense": false, | ||
"projectYear": "2021", | ||
"teamNumber": 5024 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
lib5k/src/main/java/io/github/frc5024/lib5k/utils/FRCFieldConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.github.frc5024.lib5k.utils; | ||
|
||
import edu.wpi.first.wpilibj.geometry.Rotation2d; | ||
import edu.wpi.first.wpilibj.geometry.Transform2d; | ||
import edu.wpi.first.wpilibj.geometry.Translation2d; | ||
import edu.wpi.first.wpilibj.util.Units; | ||
|
||
/** | ||
* Standard FRC field measurements. Anything year-specific should be added as | ||
* needed | ||
*/ | ||
public class FRCFieldConstants { | ||
|
||
public static final Translation2d FIELD_SIZE = new Translation2d(Units.inchesToMeters(629.25), | ||
Units.inchesToMeters(323.25)); | ||
public static final Translation2d HALF_FIELD_SIZE = FIELD_SIZE.div(2); | ||
public static final Translation2d HALF_FIELD_WIDTH = new Translation2d(0, HALF_FIELD_SIZE.getY()); | ||
public static final Translation2d HALF_FIELD_LENGTH = new Translation2d(HALF_FIELD_SIZE.getX(), 0); | ||
|
||
// Transformation that will convert a Lib5K coordinate to a WPILib coordinate | ||
public static final Transform2d LIB5K_TO_WPILIB_COORDINATE_TRANSFORM = new Transform2d(HALF_FIELD_WIDTH, new Rotation2d()); | ||
|
||
} |