Skip to content

Commit

Permalink
Merge branch 'main' into 496-trap-score
Browse files Browse the repository at this point in the history
  • Loading branch information
Meh243 committed Mar 26, 2024
2 parents 5506f75 + 97ca3ec commit 045ac0d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
11 changes: 5 additions & 6 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,19 +324,18 @@ public class VisionConstants {
public static final double POINTATTAG_ALIGNMENT_TOLERANCE = 2d;
public static final PIDController TAG_AIM_CONTROLLER = new PIDController(0.2, 0, 0.015, 0.01);
public static final PIDController CHASE_CONTROLLER = new PIDController(0.05, 0, 0);
public static final int TAG_PIPELINE = 0;
public static final int SPEAKER_PIPELINE = 1;
public static final int NOTE_PIPELINE = 2;


public static final double HALF_FIELD_HEIGHT = Units.feetToMeters(13);

public static final Translation3d BLUE_SPEAKER_LOCATION = new Translation3d(0, 5.547593, 1.2);
public static final Translation3d RED_SPEAKER_LOCATION = new Translation3d(16.4592, 5.547593, 1.2);

public class Pipelines { // TODO get real
public static final int APRIL_TAG_3d = 0;
public static final int APRIL_TAG_2d = 1;
public static final int CHASE_PIECE = 2; // FOR the collector
public static final int TAG_PIPELINE = 0;
public static final int SPEAKER_PIPELINE = 1;
public static final int NOTE_PIPELINE = 2;

}
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ protected void initializeNamedCommands() {
NamedCommands.registerCommand("Has-Piece", new HasPieceAuto(indexer));
NamedCommands.registerCommand("Stop-Drive", new stopDrive(drivetrain));
NamedCommands.registerCommand("Stop-Flywheel", new FlywheelIN(flywheel));
NamedCommands.registerCommand("Stopme-Tag", new InstantCommand(() -> limelights.setStopMePipeline(VisionConstants.TAG_PIPELINE)));
NamedCommands.registerCommand("Stopme-Speaker", new InstantCommand(() -> limelights.setStopMePipeline(VisionConstants.SPEAKER_PIPELINE)));
NamedCommands.registerCommand("Stopme-Tag", new InstantCommand(() -> limelights.setStopMePipeline(VisionConstants.Pipelines.TAG_PIPELINE)));
NamedCommands.registerCommand("Stopme-Speaker", new InstantCommand(() -> limelights.setStopMePipeline(VisionConstants.Pipelines.SPEAKER_PIPELINE)));
NamedCommands.registerCommand("Point-At-Tag", new AutonPointAtTag(drivetrain, limelights, driver));

// make sure named commands are initialized before autobuilder!
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/command/PointAtTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public PointAtTag(Swerve drivetrain, Limelights limelights, XboxController drive

@Override
public void initialize() {
limelights.setStopMePipeline(VisionConstants.SPEAKER_PIPELINE);
limelights.setStopMePipeline(VisionConstants.Pipelines.SPEAKER_PIPELINE);

headingController.setTolerance(VisionConstants.ALIGNMENT_TOLERANCE);

Expand All @@ -68,7 +68,7 @@ public void execute() {

targetHeading = limelights.getStopMe().getTargetX();

if (limelights.getStopMePipeline() == VisionConstants.SPEAKER_PIPELINE) {
if (limelights.getStopMePipeline() == VisionConstants.Pipelines.SPEAKER_PIPELINE) {
pidOutput = headingController.calculate(0, targetHeading);
}

Expand All @@ -90,7 +90,7 @@ public void updateLogging() {

@Override
public void end(boolean interrupted) {
limelights.setStopMePipeline(VisionConstants.TAG_PIPELINE);
limelights.setStopMePipeline(VisionConstants.Pipelines.TAG_PIPELINE);
}

/**
Expand Down

0 comments on commit 045ac0d

Please sign in to comment.