Build Session 1/24, swerve work, need to revalidate individual module CAN IDs
This commit is contained in:
@@ -9,9 +9,8 @@ public class DrivetrainConstants {
|
||||
public static final double kMaxSpeedMetersPerSecond = 4.125;
|
||||
public static final double kMaxAngularSpeed = 2 * Math.PI;
|
||||
|
||||
// TODO Replace zeros with real numbers
|
||||
public static final double kTrackWidth = Units.inchesToMeters(0);
|
||||
public static final double kWheelBase = Units.inchesToMeters(0);
|
||||
public static final double kTrackWidth = Units.inchesToMeters(23.75);
|
||||
public static final double kWheelBase = Units.inchesToMeters(18.75);
|
||||
|
||||
// TODO Replace zeros with real numbers
|
||||
// These values should be determinable by writing the magnetic encoder output
|
||||
@@ -24,26 +23,24 @@ public class DrivetrainConstants {
|
||||
public static final double kRearLeftMagEncoderOffset = 0;
|
||||
public static final double kRearRightMagEncoderOffset = 0;
|
||||
|
||||
// Kraken CAN IDs
|
||||
// TODO Real CAN IDs
|
||||
// Kraken CAN IDs
|
||||
public static final int kFrontLeftDrivingCANID = 0;
|
||||
public static final int kFrontRightDrivingCANID = 0;
|
||||
public static final int kRearLeftDrivingCANID = 0;
|
||||
public static final int kRearRightDrivingCANID = 0;
|
||||
public static final int kFrontRightDrivingCANID = 1;//3;
|
||||
public static final int kRearLeftDrivingCANID = 3;//1;
|
||||
public static final int kRearRightDrivingCANID = 2;
|
||||
|
||||
// SparkMAX CAN IDs
|
||||
// TODO Real CAN IDs
|
||||
public static final int kFrontLeftTurningCANID = 0;
|
||||
public static final int kFrontRightTurningCANID = 0;
|
||||
public static final int kRearLeftTurningCANID = 0;
|
||||
public static final int kRearRightTurningCANID = 0;
|
||||
public static final int kFrontLeftTurningCANID = 8;
|
||||
public static final int kFrontRightTurningCANID = 7;//9;
|
||||
public static final int kRearLeftTurningCANID = 9;//7;
|
||||
public static final int kRearRightTurningCANID = 6;
|
||||
|
||||
// Analog Encoder Input Ports
|
||||
// TODO Real Port IDs
|
||||
public static final int kFrontLeftAnalogInPort = 0;
|
||||
public static final int kFrontRightAnalogInPort = 0;
|
||||
public static final int kRearLeftAnalogInPort = 0;
|
||||
public static final int kRearRightAnalogInPort = 0;
|
||||
public static final int kFrontRightAnalogInPort = 1;
|
||||
public static final int kRearLeftAnalogInPort = 2;
|
||||
public static final int kRearRightAnalogInPort = 3;
|
||||
|
||||
public static final boolean kGyroReversed = true;
|
||||
|
||||
|
||||
@@ -11,13 +11,11 @@ import com.revrobotics.spark.FeedbackSensor;
|
||||
import com.revrobotics.spark.config.SparkMaxConfig;
|
||||
import com.revrobotics.spark.config.SparkBaseConfig.IdleMode;
|
||||
|
||||
import edu.wpi.first.math.MathUtil;
|
||||
import edu.wpi.first.math.util.Units;
|
||||
|
||||
public class ModuleConstants {
|
||||
// DRIVING MOTOR CONFIG (Kraken)
|
||||
// TODO Replace with something other than 0
|
||||
public static final double kDrivingMotorReduction = 0;
|
||||
public static final double kDrivingMotorReduction = (14.0 * 28.0 * 15.0) / (50 * 16 * 45);
|
||||
|
||||
public static final double kDrivingMotorFeedSpeedRPS = KrakenMotorConstants.kFreeSpeedRPM / 60;
|
||||
public static final double kWheelDiameterMeters = Units.inchesToMeters(4);
|
||||
@@ -44,14 +42,15 @@ public class ModuleConstants {
|
||||
public static final NeutralModeValue kDriveIdleMode = NeutralModeValue.Brake;
|
||||
|
||||
// TURNING MOTOR CONFIG (NEO)
|
||||
|
||||
// TODO Hold over from 2025, adjust?
|
||||
public static final double kTurningMotorReduction = 0;
|
||||
public static final double kTurningMotorReduction = 150.0/7.0;
|
||||
public static final double kTurningFactor = 2 * Math.PI / kTurningMotorReduction;
|
||||
// TODO Adjust? Let over from 2025
|
||||
public static final double kTurnP = 1;
|
||||
public static final double kTurnI = 0;
|
||||
public static final double kTurnD = 0;
|
||||
|
||||
public static final boolean kIsEncoderInverted = false;
|
||||
|
||||
// TODO How sensitive is too sensitive?
|
||||
public static final double kAutoResetPositionDeadband = Units.degreesToRadians(.25);
|
||||
|
||||
@@ -93,7 +92,7 @@ public class ModuleConstants {
|
||||
.idleMode(kTurnIdleMode)
|
||||
.smartCurrentLimit(kTurnMotorCurrentLimit);
|
||||
turningConfig.encoder
|
||||
.inverted(true)
|
||||
//.inverted(true)
|
||||
.positionConversionFactor(kTurningFactor)
|
||||
.velocityConversionFactor(kTurningFactor / 60.0);
|
||||
turningConfig.closedLoop
|
||||
|
||||
Reference in New Issue
Block a user