From 9ba33a7c62109628473a5bf934d96d75812e1ae5 Mon Sep 17 00:00:00 2001 From: PGgit08 Date: Sun, 31 Mar 2024 23:27:52 -0400 Subject: [PATCH] fixed deadband values on swerve chassis speed --- .../java/frc/robot/subsystems/SwerveDriveSubsystem.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc/robot/subsystems/SwerveDriveSubsystem.java b/src/main/java/frc/robot/subsystems/SwerveDriveSubsystem.java index ebac324..0aabdab 100644 --- a/src/main/java/frc/robot/subsystems/SwerveDriveSubsystem.java +++ b/src/main/java/frc/robot/subsystems/SwerveDriveSubsystem.java @@ -288,9 +288,9 @@ public double getDriveCoeff() { * @see ChassisSpeeds (wpilib chassis speeds class) */ public void driveChassis(ChassisSpeeds chassisSpeeds) { - chassisSpeeds.vxMetersPerSecond = MathUtil.applyDeadband(chassisSpeeds.vxMetersPerSecond, .01); - chassisSpeeds.vyMetersPerSecond = MathUtil.applyDeadband(chassisSpeeds.vyMetersPerSecond, .01); - chassisSpeeds.omegaRadiansPerSecond = MathUtil.applyDeadband(chassisSpeeds.omegaRadiansPerSecond, Math.PI / 30); + chassisSpeeds.vxMetersPerSecond = MathUtil.applyDeadband(chassisSpeeds.vxMetersPerSecond, .01 * Speeds.SWERVE_DRIVE_MAX_SPEED); + chassisSpeeds.vyMetersPerSecond = MathUtil.applyDeadband(chassisSpeeds.vyMetersPerSecond, .01 * Speeds.SWERVE_DRIVE_MAX_SPEED); + chassisSpeeds.omegaRadiansPerSecond = MathUtil.applyDeadband(chassisSpeeds.omegaRadiansPerSecond, .01 * Speeds.SWERVE_DRIVE_MAX_ANGULAR_SPEED); // IMPORTANT: X-axis and Y-axis are flipped (based on wpilib coord system) if (fieldOriented) {