From c26a26c577f7471d445d0732805899008c0fe27b Mon Sep 17 00:00:00 2001 From: Antoine PerreaultE Date: Thu, 30 Nov 2023 20:33:43 -0500 Subject: [PATCH] changement --- src/main/deploy/swerve/controllerproperties.json | 2 +- src/main/deploy/swerve/modules/backleft.json | 2 +- src/main/deploy/swerve/modules/backright.json | 2 +- src/main/deploy/swerve/modules/frontleft.json | 4 ++-- src/main/deploy/swerve/modules/frontright.json | 4 ++-- src/main/deploy/swerve/modules/pidfproperties.json | 2 +- src/main/java/frc/robot/RobotContainer.java | 3 ++- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/deploy/swerve/controllerproperties.json b/src/main/deploy/swerve/controllerproperties.json index 669097e..1c115ca 100644 --- a/src/main/deploy/swerve/controllerproperties.json +++ b/src/main/deploy/swerve/controllerproperties.json @@ -1,5 +1,5 @@ { - "angleJoystickRadiusDeadband": 0.5, + "angleJoystickRadiusDeadband": 0.6, "heading": { "p": 0.4, "i": 0, diff --git a/src/main/deploy/swerve/modules/backleft.json b/src/main/deploy/swerve/modules/backleft.json index 71952f7..40325ab 100644 --- a/src/main/deploy/swerve/modules/backleft.json +++ b/src/main/deploy/swerve/modules/backleft.json @@ -21,6 +21,6 @@ }, "inverted": { "drive": false, - "angle": false + "angle": true } } \ No newline at end of file diff --git a/src/main/deploy/swerve/modules/backright.json b/src/main/deploy/swerve/modules/backright.json index 4ebf07e..d1526d4 100644 --- a/src/main/deploy/swerve/modules/backright.json +++ b/src/main/deploy/swerve/modules/backright.json @@ -21,6 +21,6 @@ }, "inverted": { "drive": false, - "angle": false + "angle": true } } \ No newline at end of file diff --git a/src/main/deploy/swerve/modules/frontleft.json b/src/main/deploy/swerve/modules/frontleft.json index 2cc4e7a..8c8ecd3 100644 --- a/src/main/deploy/swerve/modules/frontleft.json +++ b/src/main/deploy/swerve/modules/frontleft.json @@ -16,11 +16,11 @@ }, "encoder": { "type": "cancoder", - "id": 5, + "id": 4, "canbus": null }, "inverted": { "drive": false, - "angle": false + "angle": true } } \ No newline at end of file diff --git a/src/main/deploy/swerve/modules/frontright.json b/src/main/deploy/swerve/modules/frontright.json index 96d3040..7a257d2 100644 --- a/src/main/deploy/swerve/modules/frontright.json +++ b/src/main/deploy/swerve/modules/frontright.json @@ -16,11 +16,11 @@ }, "encoder": { "type": "cancoder", - "id": 4, + "id": 5, "canbus": null }, "inverted": { "drive": false, - "angle": false + "angle": true } } \ No newline at end of file diff --git a/src/main/deploy/swerve/modules/pidfproperties.json b/src/main/deploy/swerve/modules/pidfproperties.json index 3834a36..f2faf26 100644 --- a/src/main/deploy/swerve/modules/pidfproperties.json +++ b/src/main/deploy/swerve/modules/pidfproperties.json @@ -7,7 +7,7 @@ "iz": 0 }, "angle": { - "p": 0.0020645, + "p": 0.005, "i": 0, "d": 0, "f": 0, diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index edcb98d..10d4801 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -3,6 +3,7 @@ // the WPILib BSD license file in the root directory of this project. package frc.robot; +import edu.wpi.first.math.MathUtil; import edu.wpi.first.networktables.GenericEntry; import edu.wpi.first.wpilibj.shuffleboard.BuiltInLayouts; import edu.wpi.first.wpilibj.shuffleboard.Shuffleboard; @@ -51,7 +52,7 @@ public class RobotContainer { configureBindings(); drive.setDefaultCommand(new RunCommand(()->{ - drive.drive(-joystick1.getY(), -joystick1.getX(), -joystick1.getZ()); + drive.drive(-joystick1.getY(), -joystick1.getX(), MathUtil.applyDeadband(-joystick1.getZ(), 0.2)); },drive)); }