Skip to content

Commit

Permalink
Merge branch 'compbot' of https://github.com/Coconuts2486-FRC/FRC-2025
Browse files Browse the repository at this point in the history
…into compbot
  • Loading branch information
ConnorJNorris committed Feb 21, 2025
2 parents 2b9d1d7 + f4d62c4 commit 1c61a56
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/main/java/frc/robot/subsystems/state_keeper/ReefTarget.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import frc.robot.Constants.ElevatorConstants;
import frc.robot.util.VirtualSubsystem;
import java.util.Optional;
import org.littletonrobotics.junction.AutoLogOutput;
import org.littletonrobotics.junction.Logger;

/**
Expand Down Expand Up @@ -64,18 +63,17 @@ public synchronized void periodic() {
Logger.recordOutput("ReefTarget/Post_LR", reefPostLR);
Logger.recordOutput("ReefTarget/Level", reefLevel);
Logger.recordOutput("ReefTarget/ElevatorHeight", getElevatorHeight());
Logger.recordOutput("ReefTarget/ScoringPose", getReefPose());
}

/** Index the desired scoring state up one */
public void indexUp() {
reefLevel = Math.min(++reefLevel, 4);
System.out.println(reefLevel);
}

/** Index the desired scoring state down one */
public void indexDown() {
reefLevel = Math.max(--reefLevel, 1);
System.out.println(reefLevel);
}

/**
Expand All @@ -84,11 +82,11 @@ public void indexDown() {
* <p>Following standard number line conventions, right is a larger integer.
*/
public void indexRight() {
reefPostLR = Math.min(++reefPostLR, 1);
// Continuously wrap the A-L designation
if (++reefPostAll >= 12) {
reefPostAll -= 12;
}
reefPostLR = reefPostAll % 2;
}

/**
Expand All @@ -97,11 +95,11 @@ public void indexRight() {
* <p>Following standard number line conventions, left is a smaller integer.
*/
public void indexLeft() {
reefPostLR = Math.max(--reefPostLR, 0);
// Continuously wrap the A-L designation
if (--reefPostAll < 0) {
reefPostAll += 12;
}
reefPostLR = reefPostAll % 2;
}

/**
Expand Down Expand Up @@ -159,7 +157,7 @@ public Distance getElevatorHeight() {
case 4:
return ElevatorConstants.kL4;
default:
return ElevatorConstants.kL2;
return ElevatorConstants.kElevatorZeroHeight;
}
}

Expand All @@ -185,7 +183,6 @@ public Pose2d getReefPose(Pose2d currentPose) {
}

/** Return the A-L pose needed to line up with the reef post */
@AutoLogOutput(key = "Odometry/ReefScoringPose")
public Pose2d getReefPose() {
switch (reefPostAll) {
case 0:
Expand Down Expand Up @@ -297,7 +294,7 @@ public Pose2d getReefPose() {
ScoringPosition.RIGHT);

default:
// Shouldn't run, but required case
// Shouldn't run, but required case and useful for testing
return new Pose2d();
}
}
Expand Down

0 comments on commit 1c61a56

Please sign in to comment.