From e7cc04d277a6c0ab303bfba8e3aa92391d54b1d5 Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 26 Mar 2024 19:03:54 -0400 Subject: [PATCH] cycle and auton tests --- .../pathplanner/autos/3 Piece Auton Line.auto | 6 +++--- .../pathplanner/autos/4 Piece Auton Line.auto | 6 +++--- src/main/deploy/pathplanner/paths/l get top.path | 14 +++++++------- .../deploy/pathplanner/paths/l get topcen.path | 12 ++++++------ .../deploy/pathplanner/paths/l shoot topcen.path | 12 ++++++------ src/main/java/frc/robot/Constants.java | 6 +++--- src/main/java/frc/robot/Robot.java | 2 +- .../java/frc/robot/commands/auto/AutonShoot.java | 2 +- .../frc/robot/subsystems/ShooterSubsystem.java | 2 +- .../frc/robot/subsystems/SwerveDriveSubsystem.java | 2 +- src/main/java/frc/robot/utils/SwerveModule.java | 4 ++-- 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/main/deploy/pathplanner/autos/3 Piece Auton Line.auto b/src/main/deploy/pathplanner/autos/3 Piece Auton Line.auto index 934d953..ec67338 100644 --- a/src/main/deploy/pathplanner/autos/3 Piece Auton Line.auto +++ b/src/main/deploy/pathplanner/autos/3 Piece Auton Line.auto @@ -26,7 +26,7 @@ { "type": "named", "data": { - "name": "actuateIn" + "name": "actuateInFast" } }, { @@ -42,9 +42,9 @@ } }, { - "type": "path", + "type": "named", "data": { - "pathName": "l shoot top" + "name": "actuateInFast" } }, { diff --git a/src/main/deploy/pathplanner/autos/4 Piece Auton Line.auto b/src/main/deploy/pathplanner/autos/4 Piece Auton Line.auto index 6b039c7..9ef8d22 100644 --- a/src/main/deploy/pathplanner/autos/4 Piece Auton Line.auto +++ b/src/main/deploy/pathplanner/autos/4 Piece Auton Line.auto @@ -26,7 +26,7 @@ { "type": "named", "data": { - "name": "actuateIn" + "name": "actuateInFast" } }, { @@ -42,9 +42,9 @@ } }, { - "type": "path", + "type": "named", "data": { - "pathName": "l shoot top" + "name": "actuateInFast" } }, { diff --git a/src/main/deploy/pathplanner/paths/l get top.path b/src/main/deploy/pathplanner/paths/l get top.path index 80805c5..0f72495 100644 --- a/src/main/deploy/pathplanner/paths/l get top.path +++ b/src/main/deploy/pathplanner/paths/l get top.path @@ -8,20 +8,20 @@ }, "prevControl": null, "nextControl": { - "x": 1.8922966222509021, - "y": 6.05543748727137 + "x": 1.585543742516057, + "y": 5.89310207191843 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 2.45, - "y": 7.02 + "x": 2.2598788054718972, + "y": 6.963242497913567 }, "prevControl": { - "x": 2.17799714878709, - "y": 6.776367426608728 + "x": 1.5420171268913974, + "y": 6.715912043252659 }, "nextControl": null, "isLocked": false, @@ -33,7 +33,7 @@ "eventMarkers": [ { "name": "New Event Marker", - "waypointRelativePos": 0.2, + "waypointRelativePos": 0.0, "command": { "type": "sequential", "data": { diff --git a/src/main/deploy/pathplanner/paths/l get topcen.path b/src/main/deploy/pathplanner/paths/l get topcen.path index 39469dc..7cc0f11 100644 --- a/src/main/deploy/pathplanner/paths/l get topcen.path +++ b/src/main/deploy/pathplanner/paths/l get topcen.path @@ -3,13 +3,13 @@ "waypoints": [ { "anchor": { - "x": 2.41, - "y": 5.51 + "x": 2.26, + "y": 6.96 }, "prevControl": null, "nextControl": { - "x": 2.3074229932249173, - "y": 7.220113178969543 + "x": 3.989694836537385, + "y": 7.183134366264898 }, "isLocked": false, "linkedName": null @@ -20,8 +20,8 @@ "y": 7.432741351973637 }, "prevControl": { - "x": 6.62469937552543, - "y": 7.441986055147727 + "x": 6.525781051566957, + "y": 7.315069487277998 }, "nextControl": null, "isLocked": false, diff --git a/src/main/deploy/pathplanner/paths/l shoot topcen.path b/src/main/deploy/pathplanner/paths/l shoot topcen.path index 9161352..2af5fe4 100644 --- a/src/main/deploy/pathplanner/paths/l shoot topcen.path +++ b/src/main/deploy/pathplanner/paths/l shoot topcen.path @@ -8,20 +8,20 @@ }, "prevControl": null, "nextControl": { - "x": 6.343113382623161, - "y": 7.3837764841295455 + "x": 6.305889183206938, + "y": 7.3443884030625215 }, "isLocked": false, "linkedName": null }, { "anchor": { - "x": 2.41, - "y": 5.51 + "x": 2.421132842265685, + "y": 6.933923582132878 }, "prevControl": { - "x": 2.2981782900502736, - "y": 7.506698977361919 + "x": 4.019013752313219, + "y": 7.1391559925977 }, "nextControl": null, "isLocked": false, diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index 319b303..e7ab6cb 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -73,7 +73,7 @@ public static class Speeds { public static final double INTAKE_FEED_SPEED = 0.6; // TODO: Get this public static final double OUTTAKE_FEED_SPEED = -0.4; - public static final double INTAKE_ACTUATE_MAX_SPEED = 0.6; + public static final double INTAKE_ACTUATE_MAX_SPEED = 0.4; } public static class Physical { @@ -152,7 +152,7 @@ public static class Presets { public static final InterpolatingDoubleTreeMap SHOOTER_DISTANCE_ANGLE = new InterpolatingDoubleTreeMap(); static { - SHOOTER_DISTANCE_ANGLE.put(1.359, 48.75); + SHOOTER_DISTANCE_ANGLE.put(0.735, 57.50); SHOOTER_DISTANCE_ANGLE.put(1.755, 43.78); SHOOTER_DISTANCE_ANGLE.put(1.823, 43.44); SHOOTER_DISTANCE_ANGLE.put(2.543, 38.15); @@ -164,7 +164,7 @@ public static class Presets { public static final InterpolatingDoubleTreeMap ELEVATOR_DISTANCE_HEIGHT = new InterpolatingDoubleTreeMap(); static { - ELEVATOR_DISTANCE_HEIGHT.put(1.359, 0.078); + ELEVATOR_DISTANCE_HEIGHT.put(0.735, 0.078); ELEVATOR_DISTANCE_HEIGHT.put(1.755, 0.061); ELEVATOR_DISTANCE_HEIGHT.put(1.823, 0.031); ELEVATOR_DISTANCE_HEIGHT.put(2.543, 0.024); diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index f795e4c..973c9a4 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -44,7 +44,7 @@ public void robotInit() { PortForwarder.add(5801, "limelight.local", 5801); PortForwarder.add(5805, "limelight.local", 5805); - CameraServer.startAutomaticCapture(0); + // CameraServer.startAutomaticCapture(0); UtilFuncs.LoadField(); // Instantiate our RobotContainer. This will perform all our button bindings, diff --git a/src/main/java/frc/robot/commands/auto/AutonShoot.java b/src/main/java/frc/robot/commands/auto/AutonShoot.java index 6caa243..7276946 100644 --- a/src/main/java/frc/robot/commands/auto/AutonShoot.java +++ b/src/main/java/frc/robot/commands/auto/AutonShoot.java @@ -53,7 +53,7 @@ public AutonShoot( new ParallelCommandGroup( new SpinShooter(shooter, ShooterState.SHOOT, true).andThen(new WaitCommand(2)), new FeedActuate(intake, FeedMode.INTAKE).withTimeout(1) - ).onlyIf(() -> !canShoot), + ).onlyIf(() -> !canShoot).andThen(() -> canShoot = true), new AutoAim(swerve, shooter, elevator, leds) ), diff --git a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java index 1eda758..76d11e9 100644 --- a/src/main/java/frc/robot/subsystems/ShooterSubsystem.java +++ b/src/main/java/frc/robot/subsystems/ShooterSubsystem.java @@ -47,7 +47,7 @@ public class ShooterSubsystem extends SubsystemBase { private final Debouncer _beamDebouncer = new Debouncer(0.3, DebounceType.kRising); - private double _shooterTrim = 1.55; + private double _shooterTrim = 3; private boolean _holdNote = false; diff --git a/src/main/java/frc/robot/subsystems/SwerveDriveSubsystem.java b/src/main/java/frc/robot/subsystems/SwerveDriveSubsystem.java index e1e8c49..af093c7 100644 --- a/src/main/java/frc/robot/subsystems/SwerveDriveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/SwerveDriveSubsystem.java @@ -85,7 +85,7 @@ public class SwerveDriveSubsystem extends SubsystemBase { /** A boolean for whether the swerve is field oriented or not. */ public boolean fieldOriented = false; - private double _swerveTrim = 0; + private double _swerveTrim = 8; StructArrayPublisher publisher = NetworkTableInstance.getDefault() .getStructArrayTopic("MyStates", SwerveModuleState.struct).publish(); diff --git a/src/main/java/frc/robot/utils/SwerveModule.java b/src/main/java/frc/robot/utils/SwerveModule.java index 54f63bd..4d11a0a 100644 --- a/src/main/java/frc/robot/utils/SwerveModule.java +++ b/src/main/java/frc/robot/utils/SwerveModule.java @@ -70,8 +70,8 @@ public SwerveModule(String name, int driveMotorId, int rotationMotorId, int enco currentConfig.StatorCurrentLimit = 120; - currentConfig.SupplyCurrentLimitEnable = false; - currentConfig.StatorCurrentLimitEnable = false; + currentConfig.SupplyCurrentLimitEnable = true; + currentConfig.StatorCurrentLimitEnable = true; _driveMotor.getConfigurator().apply(currentConfig); }