import frc.robot.constants.Constants;
import frc.robot.constants.VisionConstants;
import frc.robot.constants.swerve.DriveConstants;
-import frc.robot.util.BuildData;
+// import frc.robot.util.BuildData;
/**
* The VM is configured to automatically run this class, and to call the functions corresponding to
// obtain this robot's identity
RobotId robotId = RobotId.getRobotId();
- // Record metadata
- Logger.recordMetadata("ProjectName", BuildData.MAVEN_NAME);
- Logger.recordMetadata("BuildDate", BuildData.BUILD_DATE);
- Logger.recordMetadata("GitSHA", BuildData.GIT_SHA);
- Logger.recordMetadata("GitDate", BuildData.GIT_DATE);
- Logger.recordMetadata("GitBranch", BuildData.GIT_BRANCH);
- switch (BuildData.DIRTY) {
- case 0:
- Logger.recordMetadata("GitDirty", "All changes committed");
- break;
- case 1:
- Logger.recordMetadata("GitDirty", "Uncomitted changes");
- break;
- default:
- Logger.recordMetadata("GitDirty", "Unknown");
- break;
- }
+ // RobotId.setRobotId(RobotId.CompBot);
+
+ // // Record metadata
+ // Logger.recordMetadata("ProjectName", BuildData.MAVEN_NAME);
+ // Logger.recordMetadata("BuildDate", BuildData.BUILD_DATE);
+ // Logger.recordMetadata("GitSHA", BuildData.GIT_SHA);
+ // Logger.recordMetadata("GitDate", BuildData.GIT_DATE);
+ // Logger.recordMetadata("GitBranch", BuildData.GIT_BRANCH);
+ // switch (BuildData.DIRTY) {
+ // case 0:
+ // Logger.recordMetadata("GitDirty", "All changes committed");
+ // break;
+ // case 1:
+ // Logger.recordMetadata("GitDirty", "Uncomitted changes");
+ // break;
+ // default:
+ // Logger.recordMetadata("GitDirty", "Unknown");
+ // break;
+ // }
robotContainer = new RobotContainer(robotId);
*/
public enum RobotId {
Default,
- WaffleHouse, SwerveCompetition, Vertigo, Vivace, Phil, BetaBot,
+ CompBot, WaffleHouse, SwerveCompetition, Vertigo, Vivace, Phil, BetaBot,
ClassBot1, ClassBot2, ClassBot3, ClassBot4,
TestBed1, TestBed2;
/* Motor inversions */
public static final InvertedValue INVERT_DRIVE_MOTOR = InvertedValue.CounterClockwise_Positive;
- public static final InvertedValue INVERT_STEER_MOTOR = InvertedValue.Clockwise_Positive;
+ public static InvertedValue INVERT_STEER_MOTOR = InvertedValue.Clockwise_Positive;
/* Neutral Modes */
public static final NeutralModeValue DRIVE_NEUTRAL_MODE = NeutralModeValue.Brake;
* Updates the constants if the RobotId is not the default SwerveCompetition robot.
*/
public static void update(RobotId robotId) {
- if(robotId == RobotId.WaffleHouse){
+ if (robotId == RobotId.CompBot) {
+ STEER_OFFSET_FRONT_LEFT = 0;
+ STEER_OFFSET_FRONT_RIGHT = 0;
+ STEER_OFFSET_BACK_LEFT = 0;
+ STEER_OFFSET_BACK_RIGHT = 0;
+
+ // MK5n
+ INVERT_STEER_MOTOR = InvertedValue.CounterClockwise_Positive;
+
+ DRIVE_GEAR_RATIO = (54.0 / 14.0) * (25.0 / 32.0) * (30.0 / 15.0);
+ STEER_GEAR_RATIO = 287.0 / 11.0;
+
+ MODULE_CONSTANTS = COTSFalconSwerveConstants.SDSMK5n(DRIVE_GEAR_RATIO);
+
+ } else if(robotId == RobotId.WaffleHouse){
STEER_OFFSET_FRONT_LEFT = 300.058594 - 350 + 180;
STEER_OFFSET_FRONT_RIGHT = 65.654297 + 180;
STEER_OFFSET_BACK_LEFT = 38.232422 + 180 + 180;
STEER_OFFSET_BACK_RIGHT = 116.279297 + 180;
-
+
+ // MK5n gear ratio
+ INVERT_STEER_MOTOR = InvertedValue.CounterClockwise_Positive;
+
DRIVE_GEAR_RATIO = (54.0 / 14.0) * (25.0 / 32.0) * (30.0 / 15.0);
STEER_GEAR_RATIO = 287.0 / 11.0;
import edu.wpi.first.units.measure.Voltage;
import edu.wpi.first.wpilibj.Alert;
import edu.wpi.first.wpilibj.Alert.AlertType;
+import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import frc.robot.constants.swerve.DriveConstants;
import frc.robot.constants.swerve.ModuleConstants;
import frc.robot.constants.swerve.ModuleType;
}
public void periodic() {
+ SmartDashboard.putNumber("Encoder offset for " + getModuleType(), Units.rotationsToDegrees(CANcoder.getAbsolutePosition().getValueAsDouble()));
+
updateInputs();
Logger.processInputs("Drive/Module" + Integer.toString(moduleConstants.ordinal()), inputs);