From 367c611b6628f0d4b239b136a0817fb06379865e Mon Sep 17 00:00:00 2001 From: robo7660 Date: Sat, 6 Apr 2024 19:51:12 -0400 Subject: [PATCH 1/3] Power maagement tuning --- .../swerves/KrakenSwerve/modules/physicalproperties.json | 2 +- src/main/java/frc/robot/Constants.java | 4 ++-- src/main/java/frc/robot/RobotContainer.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/deploy/swerves/KrakenSwerve/modules/physicalproperties.json b/src/main/deploy/swerves/KrakenSwerve/modules/physicalproperties.json index d166ed2..89ca4d4 100644 --- a/src/main/deploy/swerves/KrakenSwerve/modules/physicalproperties.json +++ b/src/main/deploy/swerves/KrakenSwerve/modules/physicalproperties.json @@ -4,7 +4,7 @@ "angle": 16.8 }, "currentLimit": { - "drive": 120, + "drive": 105, "angle": 40 }, "rampRate": { diff --git a/src/main/java/frc/robot/Constants.java b/src/main/java/frc/robot/Constants.java index feca10e..067692a 100644 --- a/src/main/java/frc/robot/Constants.java +++ b/src/main/java/frc/robot/Constants.java @@ -23,8 +23,8 @@ public final class Constants { public static final boolean kLeftBackDriveInverted = false; public static final boolean kRightBackDriveInverted = false; public static final boolean kRightFrontDriveInverted = false; - public static final int driveStatorCurrentLimit = 120; - public static final int driveSupplyCurrentLimit = 120; + public static final int driveStatorCurrentLimit = 110; + public static final int driveSupplyCurrentLimit = 105; public static final double LOOP_TIME = 0.13; public static final double ROBOT_MASS = 115 * 0.453592; diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 94e55bc..e9e7506 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -135,7 +135,7 @@ public RobotContainer() { private void configureBindings() { JoystickButton leftBumper = new JoystickButton(driver, XboxController.Button.kLeftBumper.value); - leftBumper.toggleOnTrue(new IntakeAndIndex(m_intake, m_index, m_transfer)); + leftBumper.whileTrue(new IntakeAndIndex(m_intake, m_index, m_transfer)); JoystickButton rb = new JoystickButton(driver, XboxController.Button.kRightBumper.value); rb.whileTrue(new LaunchWithVelo(m_launch, m_index, -1400, false)); From 62043dd583e9e8aa82d97ac5ea2afcc11a81659b Mon Sep 17 00:00:00 2001 From: robo7660 Date: Sat, 6 Apr 2024 19:51:34 -0400 Subject: [PATCH 2/3] non-functional mid auto tuning --- src/main/deploy/pathplanner/autos/Middle 1 Note.auto | 4 ++-- src/main/deploy/pathplanner/paths/Middle 1 Note 0.path | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/deploy/pathplanner/autos/Middle 1 Note.auto b/src/main/deploy/pathplanner/autos/Middle 1 Note.auto index 7167915..8aa6d25 100644 --- a/src/main/deploy/pathplanner/autos/Middle 1 Note.auto +++ b/src/main/deploy/pathplanner/autos/Middle 1 Note.auto @@ -2,8 +2,8 @@ "version": 1.0, "startingPose": { "position": { - "x": 1.328428690111538, - "y": 5.52811290895741 + "x": 1.386927239412675, + "y": 5.5768617000416905 }, "rotation": 179.056944767529 }, diff --git a/src/main/deploy/pathplanner/paths/Middle 1 Note 0.path b/src/main/deploy/pathplanner/paths/Middle 1 Note 0.path index dbd2790..bc2f442 100644 --- a/src/main/deploy/pathplanner/paths/Middle 1 Note 0.path +++ b/src/main/deploy/pathplanner/paths/Middle 1 Note 0.path @@ -20,8 +20,8 @@ "y": 5.5768617000416905 }, "prevControl": { - "x": 1.386927239412675, - "y": 5.557362183607978 + "x": 1.4043673838437358, + "y": 5.5681397447923 }, "nextControl": null, "isLocked": false, From 325f024e29079e86bda5721b1aff7697e8258102 Mon Sep 17 00:00:00 2001 From: robo7660 Date: Sat, 6 Apr 2024 19:51:49 -0400 Subject: [PATCH 3/3] disable leading correction --- src/main/java/frc/robot/subsystems/SwerveSubsystem.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/SwerveSubsystem.java b/src/main/java/frc/robot/subsystems/SwerveSubsystem.java index 17c765f..8854bde 100644 --- a/src/main/java/frc/robot/subsystems/SwerveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/SwerveSubsystem.java @@ -94,7 +94,7 @@ public SwerveSubsystem(File directory) { throw new RuntimeException(e); } - swerveDrive.setHeadingCorrection(true); // Heading correction should only be used while controlling the robot via angle. + swerveDrive.setHeadingCorrection(false); // Heading correction should only be used while controlling the robot via angle. swerveDrive.setCosineCompensator(!SwerveDriveTelemetry.isSimulation); // Disables cosine compensation for simulations since it causes discrepancies not seen in real life. setupPathPlanner(); @@ -221,7 +221,7 @@ public Command driveToPose(Pose2d pose) public Command driveCommand(DoubleSupplier translationX, DoubleSupplier translationY, DoubleSupplier headingX, DoubleSupplier headingY) { - swerveDrive.setHeadingCorrection(true); // Normally you would want heading correction for this kind of control. + swerveDrive.setHeadingCorrection(false); // Normally you would want heading correction for this kind of control. return run(() -> { double xInput = Math.pow(translationX.getAsDouble(), 3); // Smooth controll out double yInput = Math.pow(translationY.getAsDouble(), 3); // Smooth controll out @@ -244,7 +244,7 @@ public Command driveCommand(DoubleSupplier translationX, DoubleSupplier translat */ public Command simDriveCommand(DoubleSupplier translationX, DoubleSupplier translationY, DoubleSupplier rotation) { - swerveDrive.setHeadingCorrection(true); // Normally you would want heading correction for this kind of control. + swerveDrive.setHeadingCorrection(false); // Normally you would want heading correction for this kind of control. return run(() -> { // Make the robot move driveFieldOriented(swerveDrive.swerveController.getTargetSpeeds(translationX.getAsDouble(),