Skip to content
This repository has been archived by the owner on Jul 29, 2023. It is now read-only.

Commit

Permalink
Added the swerve pod ramp rates
Browse files Browse the repository at this point in the history
  • Loading branch information
devsamuelv committed May 6, 2022
1 parent bf609d0 commit ce350da
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 21 deletions.
2 changes: 1 addition & 1 deletion core
14 changes: 10 additions & 4 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,31 @@
*/
public final class Constants {

public static double GLOBAL_SWERVE_POD_RAMP_RATE = 0.13;

public static SwerveModuleConfig frontLeftConfig = new SwerveModuleConfig(
0,
1,
3
3,
GLOBAL_SWERVE_POD_RAMP_RATE
);
public static SwerveModuleConfig frontRightConfig = new SwerveModuleConfig(
4,
5,
6
6,
GLOBAL_SWERVE_POD_RAMP_RATE
);
public static SwerveModuleConfig backLeftConfig = new SwerveModuleConfig(
7,
8,
9
9,
GLOBAL_SWERVE_POD_RAMP_RATE
);
public static SwerveModuleConfig backRightConfig = new SwerveModuleConfig(
10,
11,
12
12,
GLOBAL_SWERVE_POD_RAMP_RATE
);

public static Mk4SwerveModuleHelper.GearRatio gearRatio =
Expand Down
50 changes: 34 additions & 16 deletions src/main/java/frc/robot/subsystems/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ public Base() {
.withSize(2, 4)
.withPosition(0, 0),
Constants.gearRatio,
Constants.frontLeftConfig.motorPowerPort,
Constants.frontLeftConfig.motorSteerPort,
Constants.frontLeftConfig.canIDPort,
Constants.frontLeftConfig.steerOffset
Constants.frontLeftConfig.getMotorDrivePort(),
Constants.frontLeftConfig.getMotorSteerPort(),
Constants.frontLeftConfig.getCanCoderPort(),
Constants.frontLeftConfig.getSteerOffset()
);

this.frontRightModule =
Expand All @@ -98,10 +98,10 @@ public Base() {
.withSize(2, 4)
.withPosition(0, 2),
Constants.gearRatio,
Constants.frontRightConfig.motorPowerPort,
Constants.frontRightConfig.motorSteerPort,
Constants.frontRightConfig.canIDPort,
Constants.frontRightConfig.steerOffset
Constants.frontRightConfig.getMotorDrivePort(),
Constants.frontRightConfig.getMotorSteerPort(),
Constants.frontRightConfig.getCanCoderPort(),
Constants.frontRightConfig.getSteerOffset()
);

this.backRightModule =
Expand All @@ -111,10 +111,10 @@ public Base() {
.withSize(2, 4)
.withPosition(0, 4),
Constants.gearRatio,
Constants.backRightConfig.motorPowerPort,
Constants.backRightConfig.motorSteerPort,
Constants.backRightConfig.canIDPort,
Constants.backRightConfig.steerOffset
Constants.backRightConfig.getMotorDrivePort(),
Constants.backRightConfig.getMotorSteerPort(),
Constants.backRightConfig.getCanCoderPort(),
Constants.backRightConfig.getSteerOffset()
);

this.backLeftModule =
Expand All @@ -124,10 +124,28 @@ public Base() {
.withSize(2, 4)
.withPosition(0, 6),
Constants.gearRatio,
Constants.backLeftConfig.motorPowerPort,
Constants.backLeftConfig.motorSteerPort,
Constants.backLeftConfig.canIDPort,
Constants.backLeftConfig.steerOffset
Constants.backLeftConfig.getMotorDrivePort(),
Constants.backLeftConfig.getMotorSteerPort(),
Constants.backLeftConfig.getCanCoderPort(),
Constants.backLeftConfig.getSteerOffset()
);

this.configurePods();
}

public void configurePods() {
this.frontLeftModule.configRampRate(
Constants.frontLeftConfig.getDriveRampRate()
);
this.frontRightModule.configRampRate(
Constants.frontRightConfig.getDriveRampRate()
);

this.backLeftModule.configRampRate(
Constants.backLeftConfig.getDriveRampRate()
);
this.backRightModule.configRampRate(
Constants.backRightConfig.getDriveRampRate()
);
}

Expand Down

0 comments on commit ce350da

Please sign in to comment.