]> git.taranathan.com Git - FRC2027.git/commitdiff
more api
authoriefomit <108955303+iefomit@users.noreply.github.com>
Mon, 24 Aug 2026 05:40:31 +0000 (22:40 -0700)
committeriefomit <108955303+iefomit@users.noreply.github.com>
Mon, 24 Aug 2026 05:40:31 +0000 (22:40 -0700)
24 files changed:
build.gradle
src/main/java/frc/robot/Robot.java
src/main/java/frc/robot/RobotContainer.java
src/main/java/frc/robot/commands/auto_comm/ChoreoPathCommandBuilder.java
src/main/java/frc/robot/commands/auto_comm/DynamicAutoBuilder.java
src/main/java/frc/robot/commands/drive_comm/DefaultDriveCommand.java
src/main/java/frc/robot/commands/drive_comm/GoToPose.java
src/main/java/frc/robot/commands/drive_comm/SetFormationX.java
src/main/java/frc/robot/commands/drive_comm/TrajectoryPresetSteerAngles.java
src/main/java/frc/robot/constants/AutoConstants.java
src/main/java/frc/robot/controls/GameControllerDriverConfig.java
src/main/java/frc/robot/controls/PS5ControllerDriverConfig.java
src/main/java/frc/robot/controls/PS5XboxModeDriverConfig.java
src/main/java/frc/robot/subsystems/LED/LED.java
src/main/java/frc/robot/subsystems/drivetrain/Drivetrain.java
src/main/java/frc/robot/subsystems/drivetrain/Module.java
src/main/java/frc/robot/util/AngledElevatorSim.java
src/main/java/frc/robot/util/ClimbArmSim.java
src/main/java/frc/robot/util/ConversionUtils.java
src/main/java/frc/robot/util/Elastic.java
src/main/java/frc/robot/util/PathGroupLoader.java
src/main/java/frc/robot/util/SwerveStuff/SwerveSetpointGenerator.java
src/main/java/frc/robot/util/Vision/DetectedObject.java
src/main/java/frc/robot/util/Vision/Vision.java

index 55508d09dd75376adc7494f5cab29bd530e8d069..92b86a0d60e097a23d79b9892a01ac2325b3a543 100644 (file)
@@ -60,6 +60,7 @@ dependencies {
     annotationProcessor wpi.java.deps.wpilibAnnotations()
     implementation wpi.java.deps.wpilib()
     implementation wpi.java.vendor.java()
+    implementation "com.fasterxml.jackson.core:jackson-databind:2.17.2"
 
     systemcoreDebug wpi.java.deps.wpilibJniDebug(wpi.platforms.systemcore)
     systemcoreDebug wpi.java.vendor.jniDebug(wpi.platforms.systemcore)
index 4218cf7ae796ca251de76fb4bfbb055036f7c9e6..1627b8316131b340a69e785e50003074f5acff18 100644 (file)
@@ -12,11 +12,11 @@ import org.littletonrobotics.junction.Logger;
 import org.littletonrobotics.junction.networktables.NT4Publisher;
 import org.littletonrobotics.junction.wpilog.WPILOGReader;
 import org.littletonrobotics.junction.wpilog.WPILOGWriter;
-
-import au.grapplerobotics.CanBridge;
+// TODO: 2027-ALPHA-FIX - Re-enable grapplerobotics dep when updated
+// import au.grapplerobotics.CanBridge;
 import org.wpilib.net.PortForwarder;
 import org.wpilib.driverstation.DriverStation;
-import org.wpilib.driverstation.DriverStation.Alliance;
+import org.wpilib.driverstation.Alliance;
 import org.wpilib.system.RobotController;
 import org.wpilib.command2.Command;
 import org.wpilib.command2.CommandScheduler;
@@ -36,7 +36,7 @@ public class Robot extends LoggedRobot {
   private RobotContainer robotContainer;
 
   public Robot() {
-    CanBridge.runTCP();
+    // CanBridge.runTCP();
     PortForwarder.add(5800, Constants.VISION_CAMERA_HOST, 5800);
     PortForwarder.add(1182, Constants.VISION_CAMERA_HOST, 1182);
 
@@ -198,6 +198,6 @@ public class Robot extends LoggedRobot {
   public static Alliance getAlliance() {
     Optional<Alliance> dsAlliance = DriverStation.getAlliance();
     if (dsAlliance.isPresent()) return dsAlliance.get();
-    else return Alliance.Red; // default to Red alliance
+    else return Alliance.RED; // default to RED alliance
   }
 }
index 5d219392ffa4aa2b3c1bc4e449f869704adb623f..3105089ad068b5d671277067d29075b7f8842b71 100644 (file)
@@ -7,10 +7,10 @@ import org.littletonrobotics.junction.Logger;
 import com.pathplanner.lib.auto.AutoBuilder;
 import com.pathplanner.lib.auto.AutoBuilderException;
 import com.pathplanner.lib.commands.PathPlannerAuto;
-
-import choreo.auto.AutoChooser;
-import choreo.auto.AutoFactory;
-import choreo.auto.AutoRoutine;
+// TODO: 2027-ALPHA-FIX - Re-enable Choreo when updated
+// import choreo.auto.AutoChooser;
+// import choreo.auto.AutoFactory;
+// import choreo.auto.AutoRoutine;
 import org.wpilib.math.geometry.Pose3d;
 import org.wpilib.driverstation.DriverStation;
 import org.wpilib.system.RobotController;
@@ -21,7 +21,7 @@ import org.wpilib.command2.Command;
 import org.wpilib.command2.CommandScheduler;
 import frc.robot.commands.DoNothing;
 import frc.robot.commands.LogCommand;
-import frc.robot.commands.auto_comm.ChoreoPathCommandBuilder;
+// import frc.robot.commands.auto_comm.ChoreoPathCommandBuilder;
 import frc.robot.commands.auto_comm.DynamicAutoBuilder;
 import frc.robot.commands.drive_comm.SysIDDriveCommand;
 import frc.robot.constants.AutoConstants;
@@ -230,15 +230,15 @@ public class RobotContainer {
     String rightDynamicConservativeDoubleSwipe = "RightDynamicDoubleConservativeSwipe";
     // String leftDynamicShallowDoubleSwipe = "LeftDynamicShallowDoubleSwipe";
     // String rightDynamicShallowDoubleSwipe = "RightDynamicShallowDoubleSwipe";
-
-    ChoreoPathCommandBuilder choreo = new ChoreoPathCommandBuilder();
+    // TODO: 2027-ALPHA-FIX - Re-enable Choreo vendordep when JSON is updated
+    // ChoreoPathCommandBuilder choreo = new ChoreoPathCommandBuilder();
 
     // addAuto("testChoreo", ChoreoPathCommandBuilder.basicTrajectoryAuto("test.traj", true,
     // autoFactory));
 
     // put the Chooser on the SmartDashboard
     SmartDashboard.putData("Auto chooser", autoChooser);
-    SmartDashboard.putData("Choreo auto chooser", choreoAutoChooser);
+   // SmartDashboard.putData("Choreo auto chooser", choreoAutoChooser);
   }
 
   public static BooleanSupplier getAllianceColorBooleanSupplier() {
@@ -250,7 +250,7 @@ public class RobotContainer {
 
       var alliance = DriverStation.getAlliance();
       if (alliance.isPresent()) {
-        return alliance.get() == DriverStation.Alliance.Red;
+        return alliance.get() == DriverStation.Alliance.RED;
       }
       return false;
     };
index 393aec62db39027c732a6e7c13c4e092fe7108de..8279379b3176f9385d3377a55040524a82c126b6 100644 (file)
@@ -1,4 +1,4 @@
-// TODO: 2027-ALPHA-FIX - Re-enable Choreo vendordep when JSON is updated
+// TODO: 2027-ALPHA-FIX - Re-enable Choreo dep when updated
 // package frc.robot.commands.auto_comm;
 
 // import choreo.auto.AutoFactory;
index 517ea1663f73fb51f034e86dc853029b6e417ed5..cbd0985283341a55351efa2bbf5b14057dfd8939 100644 (file)
@@ -1,6 +1,5 @@
 package frc.robot.commands.auto_comm;
 
-import org.wpilib.command2.*;
 
 public class DynamicAutoBuilder {
 
index f955075fa4f668097c47b53da1cef39895918629..b1fa89731ddf5cbc5de7d176d62158a35b7724fa 100644 (file)
@@ -2,7 +2,7 @@ package frc.robot.commands.drive_comm;
 
 import org.wpilib.math.controller.PIDController;
 import org.wpilib.math.kinematics.ChassisVelocities;
-import org.wpilib.driverstation.DriverStation.Alliance;
+import org.wpilib.driverstation.Alliance;
 import org.wpilib.smartdashboard.SmartDashboard;
 import org.wpilib.command2.Command;
 import frc.robot.Robot;
@@ -49,7 +49,7 @@ public class DefaultDriveCommand extends Command {
     sideTranslation *= slowFactor;
     rotation *= driver.getIsSlowMode() ? DriveConstants.SLOW_ROT_FACTOR : 1;
 
-    int allianceReversal = Robot.getAlliance() == Alliance.Red ? 1 : -1;
+    int allianceReversal = Robot.getAlliance() == Alliance.RED ? 1 : -1;
     forwardTranslation *= allianceReversal;
     sideTranslation *= allianceReversal;
 
index 14e191bc4177e7ecc9cac5629911346e2f5a6e87..eb5884b5431509126f79c543cc196cea47ea6a06 100644 (file)
@@ -6,7 +6,7 @@ import com.pathplanner.lib.auto.AutoBuilder;
 import com.pathplanner.lib.path.PathConstraints;
 
 import org.wpilib.math.geometry.Pose2d;
-import org.wpilib.driverstation.DriverStation;
+import org.wpilib.driverstation.DriverStationErrors;
 import org.wpilib.command2.Command;
 import org.wpilib.command2.InstantCommand;
 import org.wpilib.command2.SequentialCommandGroup;
@@ -83,10 +83,10 @@ public class GoToPose extends SequentialCommandGroup {
     // makes weird paths.
     if (dist > 3) {
       command = new DoNothing();
-      DriverStation.reportWarning("Alignment Path too long, doing nothing, GoToPose.java", false);
+      DriverStationErrors.reportWarning("Alignment Path too long, doing nothing, GoToPose.java", false);
     } else if (dist < 0.02) {
       command = new DoNothing();
-      DriverStation.reportWarning("Alignment Path too short, doing nothing, GoToPose.java", false);
+      DriverStationErrors.reportWarning("Alignment Path too short, doing nothing, GoToPose.java", false);
     }
 
     return command;
index 7d6ba318ff7866b79b8dda67f3f53c0976eeff38..87c67768c06850bc3b2f2b494329616b755beead 100644 (file)
@@ -2,7 +2,6 @@ package frc.robot.commands.drive_comm;
 
 import org.wpilib.math.geometry.Rotation2d;
 import org.wpilib.math.kinematics.SwerveModuleVelocity;
-import org.wpilib.math.kinematics.SwerveModuleVelocity;
 import org.wpilib.math.util.Units;
 import org.wpilib.command2.InstantCommand;
 import org.wpilib.command2.RunCommand;
index 3ba8916e2b312f2f28e704764ca54a9e962fa3e5..443082442bf675e2cf3a792757e94e01e3fd4d9b 100644 (file)
@@ -27,7 +27,7 @@ public class TrajectoryPresetSteerAngles extends InstantCommand {
 
           Pose2d initialPose = trajectory.getInitialPose();
           State sample = trajectory.sample(time);
-          Pose2d nextPose = sample.poseMeters;
+          Pose2d nextPose = sample.pose;
 
           double xVelocity = sample.velocity * nextPose.getRotation().getCos();
           double yVelocity = sample.velocity * nextPose.getRotation().getSin();
@@ -39,7 +39,7 @@ public class TrajectoryPresetSteerAngles extends InstantCommand {
               ChassisVelocities.fromFieldRelativeSpeeds(chassisSpeeds, initialPose.getRotation());
 
           SwerveModuleVelocity[] SwerveModuleVelocitys =
-              DriveConstants.KINEMATICS.toSwerveModuleVelocitys(chassisSpeeds);
+              DriveConstants.KINEMATICS.toSwerveModuleVelocities(chassisSpeeds);
           for (SwerveModuleVelocity SwerveModuleVelocity : SwerveModuleVelocitys) {
             SwerveModuleVelocity.speedMetersPerSecond = 0;
           }
index 984f8b99d3168ff6a5845544cfe6b9485e48f774..7ea81e596eab0628e33314121f0f6d7a98ff05f8 100644 (file)
@@ -5,7 +5,7 @@ import com.pathplanner.lib.config.PIDConstants;
 import com.pathplanner.lib.config.RobotConfig;
 import com.pathplanner.lib.controllers.PPHolonomicDriveController;
 
-import org.wpilib.math.system.plant.DCMotor;
+import org.wpilib.math.system.DCMotor;
 import frc.robot.constants.swerve.DriveConstants;
 
 /** Container class for auto constants. */
index b59eed3b7cf99bf1bd50bdb3d5a06759b0be1680..d5f08347b20ccb64dd37468fe4b4519a11dc87ab 100644 (file)
@@ -3,7 +3,7 @@ package frc.robot.controls;
 import java.util.function.BooleanSupplier;
 
 import org.wpilib.math.geometry.Rotation2d;
-import org.wpilib.driverstation.DriverStation.Alliance;
+import org.wpilib.driverstation.Alliance;
 import org.wpilib.command2.CommandScheduler;
 import org.wpilib.command2.InstantCommand;
 import frc.robot.Robot;
@@ -32,7 +32,7 @@ public class GameControllerDriverConfig extends BaseDriverConfig {
                 () ->
                     super.getDrivetrain()
                         .setYaw(
-                            new Rotation2d(Robot.getAlliance() == Alliance.Blue ? 0 : Math.PI))));
+                            new Rotation2d(Robot.getAlliance() == Alliance.BLUE ? 0 : Math.PI))));
 
     // Cancel commands
     driver
index 7b8117de294f8cb4baabb355787b17c1399e15e4..f785ef415b69f67583a1fd83316684c03a7b67c8 100644 (file)
@@ -3,7 +3,7 @@ package frc.robot.controls;
 import java.util.function.BooleanSupplier;
 
 import org.wpilib.math.geometry.Rotation2d;
-import org.wpilib.driverstation.DriverStation.Alliance;
+import org.wpilib.driverstation.Alliance;
 import org.wpilib.command2.CommandScheduler;
 import org.wpilib.command2.InstantCommand;
 import frc.robot.Robot;
@@ -31,7 +31,7 @@ public class PS5ControllerDriverConfig extends BaseDriverConfig {
                 () ->
                     getDrivetrain()
                         .setYaw(
-                            new Rotation2d(Robot.getAlliance() == Alliance.Blue ? 0 : Math.PI))));
+                            new Rotation2d(Robot.getAlliance() == Alliance.BLUE ? 0 : Math.PI))));
 
     // Cancel commands
     controller
index fd48429c8f161b73e38139be2ca757a3ecd53320..57c51a9dcf025f698a68883d00c380ee4d362932 100644 (file)
@@ -3,7 +3,7 @@ package frc.robot.controls;
 import java.util.function.BooleanSupplier;
 
 import org.wpilib.math.geometry.Rotation2d;
-import org.wpilib.driverstation.DriverStation.Alliance;
+import org.wpilib.driverstation.Alliance;
 import org.wpilib.command2.Command;
 import org.wpilib.command2.CommandScheduler;
 import org.wpilib.command2.FunctionalCommand;
@@ -71,7 +71,7 @@ public class PS5XboxModeDriverConfig extends BaseDriverConfig {
                 () ->
                     getDrivetrain()
                         .setYaw(
-                            new Rotation2d(Robot.getAlliance() == Alliance.Blue ? 0 : Math.PI))));
+                            new Rotation2d(Robot.getAlliance() == Alliance.BLUE ? 0 : Math.PI))));
 
     // Cancel commands
     controller
index 73c77253867917ba564b9af5752cf77ab80b4cf3..ca91ff7c84589e51d42697cbe513e3b4c62a86fd 100644 (file)
@@ -19,7 +19,7 @@ import com.ctre.phoenix6.signals.StripTypeValue;
 import com.ctre.phoenix6.signals.VBatOutputModeValue;
 
 import org.wpilib.driverstation.DriverStation;
-import org.wpilib.driverstation.DriverStation.Alliance;
+import org.wpilib.driverstation.Alliance;
 import org.wpilib.util.Color;
 import org.wpilib.command2.SubsystemBase;
 import frc.robot.constants.Constants;
@@ -66,9 +66,9 @@ public class LED extends SubsystemBase {
     var alliance = DriverStation.getAlliance();
     if (alliance.isEmpty()) {
       color = Color.kOrangeRed;
-    } else if (alliance.get() == Alliance.Red) {
+    } else if (alliance.get() == Alliance.RED) {
       color = Color.kRed;
-    } else if (alliance.get() == Alliance.Blue) {
+    } else if (alliance.get() == Alliance.BLUE) {
       color = Color.kBlue;
     } else {
       color = Color.kOrangeRed;
index 1e2d12c08f069da553e89722c30b9a9ae77bb403..13d1801ff523524a1fd09f6145597cc833ccfec8 100644 (file)
@@ -37,6 +37,7 @@ import frc.robot.constants.GyroBiasConstants;
 import frc.robot.constants.VisionConstants;
 import frc.robot.constants.swerve.DriveConstants;
 import frc.robot.constants.swerve.ModuleConstants;
+import frc.robot.subsystems.drivetrain.GyroIO.GyroIOInputs;
 import frc.robot.util.EqualsUtil;
 import frc.robot.util.PhoenixOdometryThread;
 import frc.robot.util.SwerveModulePose;
@@ -467,7 +468,7 @@ public class Drivetrain extends SubsystemBase {
    */
   public void setModuleStates(SwerveModuleVelocity[] SwerveModuleVelocitys, boolean isOpenLoop) {
     // makes sure speeds of modules don't exceed maximum allowed
-    SwerveDriveKinematics.desaturateWheelSpeeds(SwerveModuleVelocitys, DriveConstants.MAX_SPEED);
+    SwerveDriveKinematics.desaturateWheelVelocities(SwerveModuleVelocitys, DriveConstants.MAX_SPEED);
 
     for (int i = 0; i < 4; i++) {
       modules[i].setDesiredState(SwerveModuleVelocitys[i], isOpenLoop);
index 1affc0d1ac70f16214a58682d13d2fccaeed9f88..f573523fe6c3f89038d4af724fffc44a0a2cf1c5 100644 (file)
@@ -33,8 +33,8 @@ import frc.robot.constants.Constants;
 import org.wpilib.units.measure.AngularVelocity;
 import org.wpilib.units.measure.Current;
 import org.wpilib.units.measure.Voltage;
-import org.wpilib.util.Alert;
-import org.wpilib.util.Alert.AlertType;
+import org.wpilib.driverstation.Alert;
+import org.wpilib.driverstation.Alert.AlertType;
 import frc.robot.constants.swerve.DriveConstants;
 import frc.robot.constants.swerve.ModuleConstants;
 import frc.robot.constants.swerve.ModuleType;
@@ -85,7 +85,6 @@ public class Module implements ModuleIO {
   private final Alert turnDisconnectedAlert;
   private final Alert turnEncoderDisconnectedAlert;
 
-  protected final ModuleIOInputsAutoLogged inputs = new ModuleIOInputsAutoLogged();
 
   private ModuleConstants moduleConstants;
   private final MotionMagicVelocityVoltage velocityRequest =
index e7f65ae064bfd7e2197427f02f2e2172a584043a..bd7897a98558c246eac3cf6e24eac28144dcc8db 100644 (file)
@@ -5,7 +5,7 @@ import org.wpilib.math.linalg.VecBuilder;
 import org.wpilib.math.numbers.N1;
 import org.wpilib.math.numbers.N2;
 import org.wpilib.math.system.NumericalIntegration;
-import org.wpilib.math.system.plant.DCMotor;
+import org.wpilib.math.system..DCMotor;
 import org.wpilib.simulation.ElevatorSim;
 
 /** Exactly the same as ElevatorSim, except it can be angled and have a constant force spring */
index bfbd9daa7a58087fde32f21add8d6901d608ae42..5c10dfc4a7e8f3f4639cf317d05739f3aeb5f13c 100644 (file)
@@ -6,8 +6,8 @@ import org.wpilib.math.numbers.N1;
 import org.wpilib.math.numbers.N2;
 import org.wpilib.math.system.LinearSystem;
 import org.wpilib.math.system.NumericalIntegration;
-import org.wpilib.math.system.plant.DCMotor;
-import org.wpilib.math.system.plant.LinearSystemId;
+import org.wpilib.math.system.DCMotor;
+import org.wpilib.math.system.Models;
 import org.wpilib.simulation.SingleJointedArmSim;
 
 /**
@@ -28,8 +28,7 @@ public class ClimbArmSim extends SingleJointedArmSim {
    * Creates a simulated arm mechanism.
    *
    * @param plant The linear system that represents the arm. This system can be created with {@link
-   *     org.wpilib.math.system.plant.LinearSystemId#createSingleJointedArmSystem(DCMotor,
-   *     double, double)}.
+   *     org.wpilib.math.system.Models#singleJointedArmFromPhysicalConstants(DCMotor, double, double)}.
    * @param gearbox The type of and number of motors in the arm gearbox.
    * @param gearing The gearing of the arm (numbers greater than 1 represent reductions).
    * @param armLengthMeters The length of the arm.
@@ -99,7 +98,7 @@ public class ClimbArmSim extends SingleJointedArmSim {
       double robotMassKilograms,
       double... measurementStdDevs) {
     this(
-        LinearSystemId.createSingleJointedArmSystem(gearbox, jKgMetersSquared, gearing),
+        Models.singleJointedArmFromPhysicalConstants(gearbox, jKgMetersSquared, gearing),
         gearbox,
         gearing,
         armLengthMeters,
index a89b3ae763e141f99945e5763a6d602ab6c44c7e..6a3a4b5a2a251ee6af650cf89316657fd98b2837 100644 (file)
@@ -2,7 +2,7 @@ package frc.robot.util;
 
 import org.wpilib.math.geometry.Pose2d;
 import org.wpilib.math.geometry.Rotation2d;
-import org.wpilib.driverstation.DriverStation.Alliance;
+import org.wpilib.driverstation.Alliance;
 import frc.robot.constants.FieldConstants;
 
 public class ConversionUtils {
@@ -140,7 +140,7 @@ public class ConversionUtils {
    * @return converted pose
    */
   public static Pose2d absolutePoseToPathPlannerPose(Pose2d pose, Alliance alliance) {
-    if (alliance == Alliance.Red) {
+    if (alliance == Alliance.RED) {
       return pose.relativeTo(
           new Pose2d(
               FieldConstants.field.getFieldLength(),
index 4e7d6a361e31cc07e67641ac8ca6e77a367531b8..110788b7e34283e4989cf4b06c6da42a51419577 100644 (file)
@@ -14,14 +14,18 @@ import org.wpilib.networktables.StringPublisher;
 import org.wpilib.networktables.StringTopic;
 
 public final class Elastic {
+  PubSubOption optionTrue = PubSubOption.SEND_ALL;
+  PubSubOption optionFalse = PubSubOption.SEND_CHANGES;
+  PubSubOption keepDuplicates = PubSubOption.KEEP_DUPLICATES;
+
   private static final StringTopic notificationTopic =
       NetworkTableInstance.getDefault().getStringTopic("/Elastic/RobotNotifications");
   private static final StringPublisher notificationPublisher =
-      notificationTopic.publish(PubSubOption.sendAll(true), PubSubOption.keepDuplicates(true));
+      notificationTopic.publish(PubSubOption.SEND_ALL, PubSubOption.KEEP_DUPLICATES);
   private static final StringTopic selectedTabTopic =
       NetworkTableInstance.getDefault().getStringTopic("/Elastic/SelectedTab");
   private static final StringPublisher selectedTabPublisher =
-      selectedTabTopic.publish(PubSubOption.keepDuplicates(true));
+      selectedTabTopic.publish(PubSubOption.KEEP_DUPLICATES);
   private static final ObjectMapper objectMapper = new ObjectMapper();
 
   /**
index 9650dff5e71ac30095128fbb9d3380f5f08c2e6a..b7a7a46e6123aba27dc30ba8673089ffb8231305 100644 (file)
@@ -1,6 +1,6 @@
 package frc.robot.util;
 
-import org.wpilib.driverstation.DriverStation;
+import org.wpilib.driverstation.DriverStationErrors;
 import org.wpilib.system.Filesystem;
 import frc.robot.constants.AutoConstants;
 
@@ -41,13 +41,13 @@ public class PathGroupLoader {
             System.out.println(
                 "Processed file: " + file.getName() + ", took " + time + " milliseconds.");
           } catch (Exception e) {
-            DriverStation.reportError(e.getMessage(), true);
+            DriverStationErrors.reportError(e.getMessage(), true);
           }
         }
       }
     } else {
       System.out.println("Error processing file");
-      DriverStation.reportWarning("Issue with finding path files. Paths will not be loaded.", true);
+      DriverStationErrors.reportWarning("Issue with finding path files. Paths will not be loaded.", true);
     }
     System.out.println("File processing took a total of " + totalTime + " milliseconds");
   }
index 0c8f7bcfba29740f0c502d23aff57f200c8c6e67..b414422a6c3d2b405d7555283de0fbe40041b3c4 100644 (file)
@@ -266,10 +266,10 @@ public class SwerveSetpointGenerator {
       double dt) {
     final Translation2d[] modules = moduleLocations;
 
-    SwerveModuleVelocity[] desiredModuleState = kinematics.toSwerveModuleVelocitys(desiredState);
+    SwerveModuleVelocity[] desiredModuleState = kinematics.toSwerveModuleVelocities(desiredState);
     // Make sure desiredState respects velocity limits.
     if (limits.maxDriveVelocity() > 0.0) {
-      SwerveDriveKinematics.desaturateWheelSpeeds(desiredModuleState, limits.maxDriveVelocity());
+      SwerveDriveKinematics.desaturateWheelVelocities(desiredModuleState, dt)(desiredModuleState, limits.maxDriveVelocity());
       desiredState = kinematics.toChassisVelocities(desiredModuleState);
     }
 
@@ -475,7 +475,7 @@ public class SwerveSetpointGenerator {
             prevSetpoint.chassisSpeeds().vx + min_s * dx,
             prevSetpoint.chassisSpeeds().vy + min_s * dy,
             prevSetpoint.chassisSpeeds().omega + min_s * dtheta);
-    var retStates = kinematics.toSwerveModuleVelocitys(retSpeeds);
+    var retStates = kinematics.toSwerveModuleVelocities(retSpeeds);
     for (int i = 0; i < modules.length; ++i) {
       final var maybeOverride = overrideSteering.get(i);
       if (maybeOverride.isPresent()) {
index b9f81d45f76306d2dadf2a583440c66efd76014c..bbe3368a304cbd712b0bab8d654615b9aafc4fbc 100644 (file)
@@ -8,7 +8,7 @@ import org.wpilib.math.geometry.Transform3d;
 import org.wpilib.math.geometry.Translation3d;
 import org.wpilib.math.kinematics.ChassisVelocities;
 import org.wpilib.math.util.Units;
-import org.wpilib.driverstation.DriverStation.Alliance;
+import org.wpilib.driverstation.Alliance;
 import frc.robot.Robot;
 import frc.robot.subsystems.drivetrain.Drivetrain;
 
@@ -321,7 +321,7 @@ public class DetectedObject {
    */
   public boolean isSameAllianceRobot() {
     return type
-        == (Robot.getAlliance() == Alliance.Red ? ObjectType.RED_ROBOT : ObjectType.BLUE_ROBOT);
+        == (Robot.getAlliance() == Alliance.RED ? ObjectType.RED_ROBOT : ObjectType.BLUE_ROBOT);
   }
 
   /**
@@ -331,7 +331,7 @@ public class DetectedObject {
    */
   public boolean isOtherAllianceRobot() {
     return type
-        == (Robot.getAlliance() == Alliance.Red ? ObjectType.BLUE_ROBOT : ObjectType.RED_ROBOT);
+        == (Robot.getAlliance() == Alliance.RED ? ObjectType.BLUE_ROBOT : ObjectType.RED_ROBOT);
   }
 
   /**
index 7c1a4441db7d37acf67de169e02a5d93cde9406d..92085a7ad04e6028f9b66794d9388528806a2617 100644 (file)
@@ -30,6 +30,7 @@ import org.wpilib.networktables.NetworkTable;
 import org.wpilib.networktables.NetworkTableEntry;
 import org.wpilib.networktables.NetworkTableInstance;
 import org.wpilib.driverstation.DriverStation;
+import org.wpilib.driverstation.DriverStationErrors;
 import org.wpilib.framework.RobotBase;
 import org.wpilib.system.Timer;
 import frc.robot.constants.Constants;
@@ -434,7 +435,7 @@ public class Vision {
     try {
       cameras.get(index).enable(enabled);
     } catch (IndexOutOfBoundsException e) {
-      DriverStation.reportWarning("Camera index " + index + " is out of bounds", false);
+      DriverStationErrors.reportWarning("Camera index " + index + " is out of bounds", false);
     }
   }