manage storage + alliance (needs testing)

This commit is contained in:
aarav18
2022-03-16 13:59:10 -06:00
parent 83c9369aa7
commit 7ae7591951
7 changed files with 114 additions and 20 deletions
+8
View File
@@ -19,6 +19,7 @@ import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.Filesystem;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.DriverStation.Alliance;
import edu.wpi.first.wpilibj.smartdashboard.SendableChooser;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.Command;
@@ -49,6 +50,8 @@ public class Robot extends TimedRobot {
private static DesmosServer desmosServer = new DesmosServer(8000);
public static Alliance alliance;
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
@@ -231,6 +234,8 @@ public class Robot extends TimedRobot {
public void autonomousInit() {
LOGGER.fine("autonomousInit()");
Robot.alliance = DriverStation.getAlliance();
selectedOdo = odoChooser.getSelected();
if (selectedOdo == null) {
selectedOdo = m_robotContainer.getOdometry();
@@ -256,6 +261,9 @@ public class Robot extends TimedRobot {
@Override
public void teleopInit() {
LOGGER.fine("teleopInit()");
Robot.alliance = DriverStation.getAlliance();
m_robotContainer.m_robotSwerveDrive.m_gyro.addYaw(-1 * m_robotContainer.m_robotSwerveDrive.m_gyro.getYaw());
selectedOdo = odoChooser.getSelected();