From ad2b1126cd15bf061009779b6bb09ceeca032e11 Mon Sep 17 00:00:00 2001 From: "Team 3128: Controls" Date: Sun, 5 Nov 2023 11:16:11 -0800 Subject: [PATCH] Beach Blitz 11/5/23 Switching computers --- .../pathplanner/r_hp_1Cone+1.5Cube.path | 24 +++++++++---------- src/main/java/frc/team3128/Constants.java | 6 ++--- .../java/frc/team3128/PositionConstants.java | 7 +++--- .../frc/team3128/autonomous/AutoPrograms.java | 6 ++--- .../frc/team3128/autonomous/Trajectories.java | 4 ++-- .../frc/team3128/commands/CmdManager.java | 4 ++-- 6 files changed, 26 insertions(+), 25 deletions(-) diff --git a/src/main/deploy/pathplanner/r_hp_1Cone+1.5Cube.path b/src/main/deploy/pathplanner/r_hp_1Cone+1.5Cube.path index 67be288..0140a0f 100644 --- a/src/main/deploy/pathplanner/r_hp_1Cone+1.5Cube.path +++ b/src/main/deploy/pathplanner/r_hp_1Cone+1.5Cube.path @@ -27,15 +27,15 @@ { "anchorPoint": { "x": 12.83, - "y": 4.75 + "y": 4.9 }, "prevControl": { "x": 13.453074555425331, - "y": 4.75 + "y": 4.9 }, "nextControl": { "x": 12.438365244862162, - "y": 4.75 + "y": 4.9 }, "holonomicAngle": 180.0, "isReversal": false, @@ -51,16 +51,16 @@ }, { "anchorPoint": { - "x": 9.85, - "y": 4.65 + "x": 9.75, + "y": 4.75 }, "prevControl": { - "x": 10.801405343067072, - "y": 4.745130586685033 + "x": 10.701405343067073, + "y": 4.845130586685032 }, "nextControl": { - "x": 10.801405343067072, - "y": 4.745130586685033 + "x": 10.701405343067073, + "y": 4.845130586685032 }, "holonomicAngle": 180.0, "isReversal": true, @@ -102,15 +102,15 @@ { "anchorPoint": { "x": 14.71, - "y": 4.35 + "y": 4.3 }, "prevControl": { "x": 14.071726678100354, - "y": 4.786707687546719 + "y": 4.736707687546719 }, "nextControl": { "x": 14.071726678100354, - "y": 4.786707687546719 + "y": 4.736707687546719 }, "holonomicAngle": 0.0, "isReversal": true, diff --git a/src/main/java/frc/team3128/Constants.java b/src/main/java/frc/team3128/Constants.java index 0871387..6b1baf6 100644 --- a/src/main/java/frc/team3128/Constants.java +++ b/src/main/java/frc/team3128/Constants.java @@ -377,13 +377,13 @@ public static class ElevatorConstants { public static final int ELV1_ID = 11; public static final int ELV2_ID = 12; - public static final double kP = 1; + public static final double kP = 1.5; public static final double kI = 0; public static final double kD = 0; - public static final double kS = 0.975;//0.2375; //0.975; //1.05; + public static final double kS = 0.575;//0.2375; //0.975; //1.05; public static final double kV = 0; - public static final double kG = 0.975;//0.4125;//0.975; + public static final double kG = 0.725;//0.4125;//0.975; 1.35; public static final double MIN_DIST = 2; //Ask Charlie public static final double MAX_DIST = 55; //Ask Charlie diff --git a/src/main/java/frc/team3128/PositionConstants.java b/src/main/java/frc/team3128/PositionConstants.java index c50cb36..61b7d3c 100644 --- a/src/main/java/frc/team3128/PositionConstants.java +++ b/src/main/java/frc/team3128/PositionConstants.java @@ -2,7 +2,8 @@ public class PositionConstants { public static enum Position { - HIGH_CONE(47, 0, true), + HIGH_CONE_AUTO(46.5, 0, true), + HIGH_CONE(48, -10, true), HIGH_CUBE(48.5, 35, false), MID_CONE(41, -31, true), MID_CUBE(25, 30, false), @@ -13,8 +14,8 @@ public static enum Position { CHUTE_CONE(10, 55, true), CHUTE_CUBE(10, 45, false), - GROUND_CONE(11.5, -18, true), - GROUND_CUBE(1, 5, false), + GROUND_CONE(10.5, -18, true), + GROUND_CUBE(1, 10, false), NEUTRAL(3, 80, false); diff --git a/src/main/java/frc/team3128/autonomous/AutoPrograms.java b/src/main/java/frc/team3128/autonomous/AutoPrograms.java index 5eccb9c..157b3db 100644 --- a/src/main/java/frc/team3128/autonomous/AutoPrograms.java +++ b/src/main/java/frc/team3128/autonomous/AutoPrograms.java @@ -42,13 +42,13 @@ public Command getAutonomousCommand() { final Command autoCommand; if (selectedAutoName == null) { - autoCommand = score(Position.HIGH_CONE, true); - // autoCommand = none(); + // autoCommand = score(Position.HIGH_CONE_AUTO, true); + autoCommand = none(); } else if (selectedAutoName.equals("scuffedClimb")) { autoCommand = sequence( - score(Position.HIGH_CONE, true), + score(Position.HIGH_CONE_AUTO, true), new CmdAutoBalance(false) ); } diff --git a/src/main/java/frc/team3128/autonomous/Trajectories.java b/src/main/java/frc/team3128/autonomous/Trajectories.java index abbdfa7..96bf35b 100644 --- a/src/main/java/frc/team3128/autonomous/Trajectories.java +++ b/src/main/java/frc/team3128/autonomous/Trajectories.java @@ -60,7 +60,7 @@ public static void initTrajectories() { "r_hp_1Cone+1Cube", "r_hp_1Cone+1.5Cube" }; - CommandEventMap.put("ScoreConeHigh", sequence(score(Position.HIGH_CONE, true))); + CommandEventMap.put("ScoreConeHigh", sequence(score(Position.HIGH_CONE_AUTO, true))); CommandEventMap.put("ScoreCubeHigh", score(Position.HIGH_CUBE, true)); @@ -68,7 +68,7 @@ public static void initTrajectories() { CommandEventMap.put("PickupCube", pickup(Position.GROUND_CUBE, true)); - CommandEventMap.put("Neutral", sequence(retract(Position.NEUTRAL))); + CommandEventMap.put("Neutral", sequence(stopManip(), retract(Position.NEUTRAL))); CommandEventMap.put("Balance", new ScheduleCommand(new CmdAutoBalance(true))); diff --git a/src/main/java/frc/team3128/commands/CmdManager.java b/src/main/java/frc/team3128/commands/CmdManager.java index 011608b..5454c2f 100644 --- a/src/main/java/frc/team3128/commands/CmdManager.java +++ b/src/main/java/frc/team3128/commands/CmdManager.java @@ -66,9 +66,9 @@ public static CommandBase pickup(Position position, boolean runImmediately) { setLeds(position.cone ? Colors.CONE : Colors.CUBE), runOnce(()-> ENABLE = runImmediately), waitUntil(()-> ENABLE), - parallel( + either(sequence(extend(position), intake(position.cone)), parallel( extend(position), - intake(position.cone) + intake(position.cone)), ()-> DriverStation.isAutonomous() ), retract(Position.NEUTRAL), resetLeds()