Skip to content

Commit

Permalink
Tweaks for Trap from Practice Field
Browse files Browse the repository at this point in the history
  • Loading branch information
Java4First committed Mar 30, 2024
1 parent 0c47c9d commit 6a0df50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public enum Task {
LAUNCHPASS("Launch Pass", 1.00, 5000),
LAUNCHAUTO("Launch Auto", 0.0, 0.0),
PUTAMP("Note->Amp", 0.0, 0.0),
LAUNCHTRAP("Launch Tap", 0.35, 1000),
LAUNCHTRAP("Launch Tap", 0.55, 1000), // .60
CLEARJAM("Clear", 0.25, 1000.0),
IDLE("Idle", 0.0, 0.0),
LAUCNHNOTE1("Launch Note 1", .67, 55.0),
Expand Down
17 changes: 3 additions & 14 deletions src/main/java/frc/robot/subsystems/Mast.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public enum Task {
LAUCNHPASS("Launch Pass", 61.0),
LAUNCHAUTO("Launch Auto", 6.0),
PUTAMP("PutAmp", -26.0), // tested
PUTTRAP("PutTrap", 2.5),
PUTTRAP("PutTrap", 37.5), // was 40
CLEARJAM("Clear", 40.0),
CLIMBING("Climbing", -7.0),
TESTING("Testing", 0.0),
Expand Down Expand Up @@ -187,25 +187,14 @@ public void periodic() {
double absEncoderDeg = getAbsoluteEncoderDegrees();
double error = relEncoderDeg - absEncoderDeg;

// Remove backlash from Launcher by syncing constantly
// if (++counts == 30 && Math.abs(error) > .4) {
// // double AbsToRel = getAbsoluteEncoderDegrees() * gearRatio / 360;
// double AbsToRel = new BigDecimal(absEncoderDeg * gearRatio / 360)
// .setScale(3, RoundingMode.DOWN)
// .doubleValue();
// relMastLeftEncoder.setPosition(AbsToRel);
// counts = 0;
// }

if (++counts >= 30) {
if (Math.abs(error) > .4) {
// System.out.println("*** fixing at " + counts);
// double AbsToRel = getAbsoluteEncoderDegrees() * gearRatio / 360;
double AbsToRel =
double absToRel =
new BigDecimal(absEncoderDeg * gearRatio / 360)
.setScale(3, RoundingMode.DOWN)
.doubleValue();
relMastLeftEncoder.setPosition(AbsToRel);
relMastLeftEncoder.setPosition(absToRel);
} else {
// System.out.println("*** not fixing at " + counts);
}
Expand Down

0 comments on commit 6a0df50

Please sign in to comment.