This commit is contained in:
Michael Mikovsky
2025-02-24 17:59:44 -07:00
parent 761a56cf0f
commit 07841b303a
6 changed files with 71 additions and 39 deletions
@@ -63,14 +63,11 @@ public class ReefPositionHelper {
* Function to find closest tag location based on side
*/
public static Pose2d getNearestTag(Pose2d position) {
Optional<Alliance> ally = DriverStation.getAlliance();
if (!ally.isPresent())
return new Pose2d();
if (ally.get() == Alliance.Red)
if(TimesNegativeOne.isRed)
return getNearestTag(RED_TAGS, position);
if (ally.get() == Alliance.Blue)
return getNearestTag(BLUE_TAGS, position);
return new Pose2d();
else
return getNearestTag(BLUE_TAGS, position);
}
public static Pose2d getNearestPosition(Pose2d position, Side side, double xtrim, double ydistance) {