From 6a0df5054c1025c748fa395514cc3095d24db860 Mon Sep 17 00:00:00 2001 From: Stu-PID Date: Sat, 30 Mar 2024 08:30:10 -0400 Subject: [PATCH] Tweaks for Trap from Practice Field --- .../java/frc/robot/subsystems/Launcher.java | 2 +- src/main/java/frc/robot/subsystems/Mast.java | 17 +++-------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/Launcher.java b/src/main/java/frc/robot/subsystems/Launcher.java index 17d722d..c5f114d 100644 --- a/src/main/java/frc/robot/subsystems/Launcher.java +++ b/src/main/java/frc/robot/subsystems/Launcher.java @@ -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), diff --git a/src/main/java/frc/robot/subsystems/Mast.java b/src/main/java/frc/robot/subsystems/Mast.java index 12b730b..c8e639f 100644 --- a/src/main/java/frc/robot/subsystems/Mast.java +++ b/src/main/java/frc/robot/subsystems/Mast.java @@ -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), @@ -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); }