Skip to content

Commit

Permalink
feat: Imported to 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammingSR committed Jan 20, 2024
1 parent be0864d commit 650e4b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
@@ -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;

/**
Expand Down
9 changes: 3 additions & 6 deletions src/main/java/frc/robot/commands/AlignToTagCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()),
Expand Down

0 comments on commit 650e4b3

Please sign in to comment.