mirror of
https://github.com/Team4388/2025RidgeScape.git
synced 2026-06-09 00:38:02 -06:00
Robot Reveal
This commit is contained in:
@@ -12,7 +12,8 @@ import frc4388.robot.Constants.FieldConstants;
|
||||
public class ReefPositionHelper {
|
||||
public enum Side {
|
||||
LEFT,
|
||||
RIGHT
|
||||
RIGHT,
|
||||
CENTER
|
||||
}
|
||||
|
||||
public static final Pose2d[] RED_TAGS = {
|
||||
@@ -74,10 +75,22 @@ public class ReefPositionHelper {
|
||||
|
||||
public static Pose2d getNearestPosition(Pose2d position, Side side, double xtrim, double ydistance) {
|
||||
return offset(getNearestTag(position),
|
||||
(side == Side.LEFT ? -(FieldConstants.HORISONTAL_SCORING_POSITION_OFFSET) : (FieldConstants.HORISONTAL_SCORING_POSITION_OFFSET)) + xtrim,
|
||||
getSide(side) + xtrim,
|
||||
ydistance);
|
||||
}
|
||||
|
||||
public static double getSide(Side side){
|
||||
switch(side) {
|
||||
case LEFT:
|
||||
return -(FieldConstants.HORISONTAL_SCORING_POSITION_OFFSET);
|
||||
case RIGHT:
|
||||
return (FieldConstants.HORISONTAL_SCORING_POSITION_OFFSET);
|
||||
case CENTER:
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public static Pose2d offset(Pose2d oldPose, double xoffset, double yoffset){
|
||||
Translation2d oldTranslation = oldPose.getTranslation();
|
||||
|
||||
Reference in New Issue
Block a user