-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from REVrobotics/2025-update
Update for 2025
- Loading branch information
Showing
19 changed files
with
148 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"enableCppIntellisense": false, | ||
"currentLanguage": "java", | ||
"projectYear": "2024", | ||
"projectYear": "2025beta", | ||
"teamNumber": 2714 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package frc.robot; | ||
|
||
import com.revrobotics.spark.config.SparkMaxConfig; | ||
import com.revrobotics.spark.config.ClosedLoopConfig.FeedbackSensor; | ||
import com.revrobotics.spark.config.SparkBaseConfig.IdleMode; | ||
|
||
import frc.robot.Constants.ModuleConstants; | ||
|
||
public final class Configs { | ||
public static final class MAXSwerveModule { | ||
public static final SparkMaxConfig drivingConfig = new SparkMaxConfig(); | ||
public static final SparkMaxConfig turningConfig = new SparkMaxConfig(); | ||
|
||
static { | ||
// Use module constants to calculate conversion factors and feed forward gain. | ||
double drivingFactor = ModuleConstants.kWheelDiameterMeters * Math.PI | ||
/ ModuleConstants.kDrivingMotorReduction; | ||
double turningFactor = 2 * Math.PI; | ||
double drivingVelocityFeedForward = 1 / ModuleConstants.kDriveWheelFreeSpeedRps; | ||
|
||
drivingConfig | ||
.idleMode(IdleMode.kBrake) | ||
.smartCurrentLimit(50); | ||
drivingConfig.encoder | ||
.positionConversionFactor(drivingFactor) // meters | ||
.velocityConversionFactor(drivingFactor / 60.0); // meters per second | ||
drivingConfig.closedLoop | ||
.feedbackSensor(FeedbackSensor.kPrimaryEncoder) | ||
// These are example gains you may need to them for your own robot! | ||
.pid(0.04, 0, 0) | ||
.velocityFF(drivingVelocityFeedForward) | ||
.outputRange(-1, 1); | ||
|
||
turningConfig | ||
.idleMode(IdleMode.kBrake) | ||
.smartCurrentLimit(20); | ||
turningConfig.absoluteEncoder | ||
// Invert the turning encoder, since the output shaft rotates in the opposite | ||
// direction of the steering motor in the MAXSwerve Module. | ||
.inverted(true) | ||
.positionConversionFactor(turningFactor) // radians | ||
.velocityConversionFactor(turningFactor / 60.0); // radians per second | ||
turningConfig.closedLoop | ||
.feedbackSensor(FeedbackSensor.kAbsoluteEncoder) | ||
// These are example gains you may need to them for your own robot! | ||
.pid(1, 0, 0) | ||
.outputRange(-1, 1) | ||
// Enable PID wrap around for the turning motor. This will allow the PID | ||
// controller to go through 0 to get to the setpoint i.e. going from 350 degrees | ||
// to 10 degrees will go through 0 rather than the other direction which is a | ||
// longer route. | ||
.positionWrappingEnabled(true) | ||
.positionWrappingInputRange(0, turningFactor); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.