Skip to content

Commit

Permalink
Automatically applied spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinskycastle authored and github-actions[bot] committed Feb 27, 2025
1 parent aa60fce commit db55653
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 18 deletions.
3 changes: 0 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj2.command.*;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import edu.wpi.first.wpilibj2.command.button.Trigger;
import edu.wpi.first.wpilibj2.command.sysid.SysIdRoutine;
import frc.robot.commands.SetHopperIntake;
import frc.robot.commands.ToggleGamePiece;
Expand All @@ -36,7 +35,6 @@
import frc.robot.commands.endEffector.EndEffectorSetpoint;
import frc.robot.commands.endEffector.RunEndEffectorIntake;
import frc.robot.commands.swerve.ResetGyro;
import frc.robot.commands.swerve.SetTrackingState;
import frc.robot.commands.swerve.SwerveCharacterization;
import frc.robot.constants.ELEVATOR.ELEVATOR_SETPOINT;
import frc.robot.constants.ENDEFFECTOR.PIVOT.PIVOT_SETPOINT;
Expand All @@ -47,7 +45,6 @@
import frc.robot.constants.SWERVE;
import frc.robot.constants.SWERVE.ROUTINE_TYPE;
import frc.robot.constants.USB;
import frc.robot.constants.VISION.TRACKING_STATE;
import frc.robot.generated.AlphaBotConstants;
import frc.robot.generated.V2Constants;
import frc.robot.subsystems.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import java.io.IOException;
import java.util.function.Supplier;
import org.json.simple.parser.ParseException;
import org.team4201.codex.subsystems.SwerveSubsystem;
import org.team4201.codex.utils.ModuleMap;
import org.team4201.codex.utils.TrajectoryUtils;

Expand Down
27 changes: 13 additions & 14 deletions src/main/java/frc/robot/subsystems/Vision.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import edu.wpi.first.math.Matrix;
import edu.wpi.first.math.VecBuilder;
import edu.wpi.first.math.geometry.Pose2d;
import edu.wpi.first.math.geometry.Rotation2d;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.numbers.N1;
import edu.wpi.first.math.numbers.N3;
import edu.wpi.first.net.PortForwarder;
import edu.wpi.first.networktables.DoubleArrayPublisher;
import edu.wpi.first.networktables.DoubleArrayTopic;
import edu.wpi.first.networktables.DoublePublisher;
import edu.wpi.first.networktables.NetworkTable;
import edu.wpi.first.networktables.NetworkTableEntry;
Expand All @@ -21,7 +19,6 @@
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.LimelightHelpers;
import frc.robot.Robot;
import frc.robot.LimelightHelpers.LimelightTarget_Barcode;
import frc.robot.constants.FIELD;
import frc.robot.constants.ROBOT;
import frc.robot.constants.VISION;
Expand All @@ -48,7 +45,7 @@ public class Vision extends SubsystemBase {
private NetworkTableEntry tyOfLimelightA = limelightATable.getEntry("ty");
private NetworkTableEntry taOfLimelightA = limelightATable.getEntry("ta");

//read values periodically
// read values periodically
private double xOfLimelightA = txOfLimelightA.getDouble(0.0);
private double yOfLimelightA = tyOfLimelightA.getDouble(0.0);
private double areaOfLimelightA = taOfLimelightA.getDouble(0.0);
Expand All @@ -58,12 +55,12 @@ public class Vision extends SubsystemBase {
private NetworkTableEntry tyOfLimelightB = limelightBTable.getEntry("ty");
private NetworkTableEntry taOfLimelightB = limelightBTable.getEntry("ta");

//read values periodically
// read values periodically
private double xOfLimelightB = txOfLimelightB.getDouble(0.0);
private double yOfLimelightB = tyOfLimelightB.getDouble(0.0);
private double areaOfLimelightB = taOfLimelightB.getDouble(0.0);

//post to smart dashboard periodically
// post to smart dashboard periodically

// public static final PhotonCamera aprilTagLimelightCameraA = new PhotonCamera("LimelightA");
// PhotonPoseEstimator limelightPhotonPoseEstimatorA =
Expand Down Expand Up @@ -358,8 +355,8 @@ private void updateAngleToBranch() {
.getTranslation()
.minus(robotToBranch[1].getTranslation())
.getAngle()
// .minus(Rotation2d.k180deg)
);
// .minus(Rotation2d.k180deg)
);
});
}

Expand Down Expand Up @@ -437,7 +434,7 @@ public void periodic() {
LimelightHelpers.SetIMUMode("limelight-a", 2);
LimelightHelpers.PoseEstimate mt2_limelightA =
LimelightHelpers.getBotPoseEstimate_wpiBlue_MegaTag2("limelight-a");

// if our angular velocity is greater than 720 degrees per second, ignore vision updates
if (Math.abs(
m_swerveDriveTrain.getPigeon2().getAngularVelocityZDevice().getValueAsDouble())
Expand All @@ -457,9 +454,10 @@ public void periodic() {
}
}
} catch (NullPointerException e) {
DriverStation.reportWarning("LimelightA failed to get pose esstimation from NetworkTables", true);
DriverStation.reportWarning(
"LimelightA failed to get pose esstimation from NetworkTables", true);
}

try {
if (useMegaTag2 == false) {
LimelightHelpers.PoseEstimate mt1_limelightB =
Expand Down Expand Up @@ -493,7 +491,7 @@ public void periodic() {
LimelightHelpers.SetIMUMode("limelight-b", 2);
LimelightHelpers.PoseEstimate mt2_limelightB =
LimelightHelpers.getBotPoseEstimate_wpiBlue_MegaTag2("limelight-b");

// if our angular velocity is greater than 720 degrees per second, ignore vision updates
if (Math.abs(
m_swerveDriveTrain.getPigeon2().getAngularVelocityZDevice().getValueAsDouble())
Expand All @@ -513,9 +511,10 @@ public void periodic() {
}
}
} catch (NullPointerException e) {
DriverStation.reportWarning("LimelightB failed to get pose esstimation from NetworkTables", true);
DriverStation.reportWarning(
"LimelightB failed to get pose esstimation from NetworkTables", true);
}

// LimelightHelpers.SetRobotOrientation("limelight-b",
// m_swerveDriveTrain.getState().Pose.getRotation().getDegrees(), 0, 0, 0, 0, 0);
// LimelightHelpers.PoseEstimate mt2_limelightB =
Expand Down

0 comments on commit db55653

Please sign in to comment.