From 650e4b382ccedcf9ee0df2ba1aac0e5df49b28f5 Mon Sep 17 00:00:00 2001 From: ProgrammingSR Date: Fri, 19 Jan 2024 17:15:52 -0800 Subject: [PATCH] feat: Imported to 2024 --- src/main/java/frc/robot/Constants.java | 2 -- src/main/java/frc/robot/commands/AlignToTagCommand.java | 9 +++------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 4d16b93..72ee1dc 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -1,11 +1,9 @@ package frc.robot; -import edu.wpi.first.math.estimator.SwerveDrivePoseEstimator; 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.networktables.NetworkTableInstance; -import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.math.kinematics.SwerveDriveKinematics; /** diff --git a/src/main/java/frc/robot/commands/AlignToTagCommand.java b/src/main/java/frc/robot/commands/AlignToTagCommand.java index 1840679..cf02d5e 100644 --- a/src/main/java/frc/robot/commands/AlignToTagCommand.java +++ b/src/main/java/frc/robot/commands/AlignToTagCommand.java @@ -6,16 +6,13 @@ import edu.wpi.first.math.geometry.Rotation2d; import edu.wpi.first.math.geometry.Translation2d; import edu.wpi.first.wpilibj.DriverStation; -import edu.wpi.first.wpilibj.Timer; import edu.wpi.first.wpilibj.DriverStation.Alliance; -import edu.wpi.first.wpilibj2.command.CommandBase; -import edu.wpi.first.wpilibj2.command.Subsystem; -import frc.robot.Constants.DriveConstants; +import edu.wpi.first.wpilibj2.command.Command; import frc.robot.Constants.TagAlignConstants; import frc.robot.Constants.TagAlignConstants.AlignPosition; import frc.robot.subsystems.DriveSubsystem; -public class AlignToTagCommand extends CommandBase { +public class AlignToTagCommand extends Command { final DriveSubsystem m_subsystem; final Pose2d m_target; // Desired pose @@ -40,7 +37,7 @@ public AlignToTagCommand(DriveSubsystem subsystem, AlignPosition alignPos) { // (and faster). Indexing can be done by adding a constant to the ordinal when // indexing the array. This will allows accessing the blue positions which // should be put in the array after the red ones. - m_target = DriverStation.getAlliance().compareTo(Alliance.Red) == 0 ? redTarget + m_target = DriverStation.getAlliance().get().compareTo(Alliance.Red) == 0 ? redTarget : new Pose2d(new Translation2d( // Flip poses of alliance is blue TagAlignConstants.kFieldWidth - redTarget.getX(), redTarget.getY()),