From 293aa25a0f29998b14fa967768c5a5013d12cee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=AEZach=20Wilke?= <90875734+76842@users.noreply.github.com> Date: Thu, 2 Dec 2021 17:36:28 -0700 Subject: [PATCH] Left Back --- src/main/java/frc4388/robot/Constants.java | 1 + src/main/java/frc4388/robot/subsystems/SwerveDrive.java | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc4388/robot/Constants.java b/src/main/java/frc4388/robot/Constants.java index d87bad9..0e0790a 100644 --- a/src/main/java/frc4388/robot/Constants.java +++ b/src/main/java/frc4388/robot/Constants.java @@ -31,6 +31,7 @@ public final class Constants { public static final class SwerveDriveConstants { public static final double ROTATION_SPEED = 0.1; + public static final double WHEEL_SPEED = 0.1; public static final double WIDTH = 0; public static final double HEIGHT = 0; public static final int LEFT_FRONT_STEER_CAN_ID = 0; diff --git a/src/main/java/frc4388/robot/subsystems/SwerveDrive.java b/src/main/java/frc4388/robot/subsystems/SwerveDrive.java index 0896ec2..a585084 100644 --- a/src/main/java/frc4388/robot/subsystems/SwerveDrive.java +++ b/src/main/java/frc4388/robot/subsystems/SwerveDrive.java @@ -79,7 +79,12 @@ public class SwerveDrive // Back right module state SwerveModuleState rightBack = SwerveModuleState.optimize(moduleStates[3], new Rotation2d(m_rightBackEncoder.getPosition())); - + + m_leftFrontWheelMotor.set(m_leftFrontSteerMotor.get() + leftFront.speedMetersPerSecond * SwerveDriveConstants.WHEEL_SPEED); + m_rightFrontWheelMotor.set(m_rightFrontSteerMotor.get() + rightFront.speedMetersPerSecond * SwerveDriveConstants.WHEEL_SPEED); + m_leftBackWheelMotor.set(m_leftBackSteerMotor.get() + lefBack.speedMetersPerSecond * SwerveDriveConstants.WHEEL_SPEED); + m_rightBackWheelMotor.set(m_rightBackSteerMotor.get() + rightBack.speedMetersPerSecond * SwerveDriveConstants.WHEEL_SPEED); + } // public void driveFieldRelative(double awayFromStation, double towardLeftBoundary, double rotate)