Work from build 2/28

This commit is contained in:
2026-02-28 17:42:37 -05:00
parent 7621cfd009
commit 3791333f56
12 changed files with 101 additions and 136 deletions

View File

@@ -20,15 +20,15 @@ public class DrivetrainConstants {
public static final double kRearLeftMagEncoderOffset = 3.761;
public static final double kRearRightMagEncoderOffset = 2.573;
public static final int kFrontLeftDrivingCANID = 0;
public static final int kFrontLeftDrivingCANID = 4;
public static final int kFrontRightDrivingCANID = 3;
public static final int kRearLeftDrivingCANID = 1;
public static final int kRearRightDrivingCANID = 2;
public static final int kFrontLeftTurningCANID = 8;
public static final int kFrontRightTurningCANID = 9;
public static final int kRearLeftTurningCANID = 7;
public static final int kRearRightTurningCANID = 6;
public static final int kFrontLeftTurningCANID = 7; // 8
public static final int kFrontRightTurningCANID = 21; //9
public static final int kRearLeftTurningCANID = 6; //7
public static final int kRearRightTurningCANID = 8; //6
public static final int kFrontLeftAnalogInPort = 3;
public static final int kFrontRightAnalogInPort = 2;

View File

@@ -15,7 +15,7 @@ import edu.wpi.first.wpilibj.Filesystem;
public class HoodConstants {
// TODO Real Values
public static final int kMotorCANID = 0;
public static final int kMotorCANID = 12;
public static final double kConversionFactor = 3.0*147.0/8.0;
@@ -26,7 +26,7 @@ public class HoodConstants {
public static final double kV = 0;
public static final double kA = 0;
public static final double kStartupAngle = 0;
public static final double kMaxManualSpeedMultiplier = .5;
public static final double kMaxManualSpeedMultiplier = 1;
public static final double kAmpsToTriggerPositionReset = 10;

View File

@@ -20,8 +20,8 @@ public class IntakePivotConstants {
}
}
public static final int kLeftMotorCANID = 0;
public static final int kRightMotorCANID = 0;
public static final int kLeftMotorCANID = 16;
public static final int kRightMotorCANID = 9;
public static final double kConversionFactor = 60.0/11.0*60.0/18.0*38.0/16.0;
@@ -40,7 +40,7 @@ public class IntakePivotConstants {
public static final int kCurrentLimit = 30;
public static final IdleMode kIdleMode = IdleMode.kBrake;
public static final IdleMode kIdleMode = IdleMode.kCoast;
// YOU SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS LINE UNLESS YOU'RE ADDING A CONFIGURATION ITEM

View File

@@ -5,30 +5,24 @@ import com.revrobotics.spark.config.SparkBaseConfig.IdleMode;
public class IntakeRollerConstants {
// TODO Real values
public static final int kLeftMotorCANID = 0;
public static final int kRightMotorCANID = 0;
public static final int kMotorCANID = 20;
public static final int kCurrentLimit = 40;
public static final boolean kInvertMotors = false;
public static final boolean kInvertMotors = true;
public static final double kSpeed = .6;
public static final IdleMode kIdleMode = IdleMode.kCoast;
// YOU SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS LINE UNLESS YOU'RE ADDING A CONFIGURATION ITEM
public static final SparkMaxConfig leftMotorConfig = new SparkMaxConfig();
public static final SparkMaxConfig rightMotorConfig = new SparkMaxConfig();
static {
leftMotorConfig
.idleMode(kIdleMode)
.smartCurrentLimit(kCurrentLimit)
.inverted(kInvertMotors);
rightMotorConfig
.idleMode(kIdleMode)
.smartCurrentLimit(kCurrentLimit)
.inverted(kInvertMotors)
.follow(kLeftMotorCANID);
}
}

View File

@@ -9,7 +9,7 @@ import edu.wpi.first.math.util.Units;
public class ShooterConstants {
public enum ShooterSpeeds {
kHubSpeed(0),
kFeedSpeed(0);
kFeedSpeed(0.35);
private double speedMPS;
@@ -27,30 +27,28 @@ public class ShooterConstants {
public static final double kWheelDiameter = Units.inchesToMeters(4);
// TODO Real values
public static final int kLeftShooterMotor1CANID = 0;
public static final int kLeftShooterMotor2CANID = 0;
public static final int kRightShooterMotor1CANID = 0;
public static final int kRightShooterMotor2CANID = 0;
public static final int kLeftShooterMotorCANID = 2;
public static final int kRightShooterMotorCANID = 5;
public static final boolean kLeftShooterMotor1Inverted = false;
public static final boolean kLeftShooterMotor2Inverted = false;
public static final boolean kRightShooterMotor1Inverted = false;
public static final boolean kRightShooterMotor2Inverted = false;
public static final boolean kLeftShooterMotorInverted = true;
public static final boolean kRightShooterMotorInverted = false;
public static final double kLeftP = 0;
public static final double kLeftP = 0.1;
public static final double kLeftI = 0;
public static final double kLeftD = 0;
public static final double kLeftS = 0;
public static final double kLeftV = 0.21;
public static final double kLeftA = 0;
public static final double kRightP = 0;
public static final double kRightP = 0.1;
public static final double kRightI = 0;
public static final double kRightD = 0;
public static final double kRightS = 0;
public static final double kRightV = 0.21;
public static final double kRightA = 0;
public static final double kMaxManualSpeedMultiplier = 1;
public static final double kShooterHeightMeters = 0;
// TODO Is this value sane?
@@ -60,51 +58,37 @@ public class ShooterConstants {
// YOU SHOULDN'T NEED TO CHANGE ANYTHING BELOW THIS LINE UNLESS YOU'RE ADDING A CONFIGURATION ITEM
public static final SparkMaxConfig kLeftMotor1Config = new SparkMaxConfig();
public static final SparkMaxConfig kLeftMotor2Config = new SparkMaxConfig();
public static final SparkMaxConfig kRightMotor1Config = new SparkMaxConfig();
public static final SparkMaxConfig kRightMotor2Config = new SparkMaxConfig();
public static final SparkMaxConfig kLeftMotorConfig = new SparkMaxConfig();
public static final SparkMaxConfig kRightMotorConfig = new SparkMaxConfig();
static {
kLeftMotor1Config
kLeftMotorConfig
.idleMode(kShooterIdleMode)
.smartCurrentLimit(kCurrentLimit)
.inverted(kLeftShooterMotor1Inverted);
kLeftMotor1Config.absoluteEncoder
.inverted(kLeftShooterMotorInverted);
kLeftMotorConfig.absoluteEncoder
.positionConversionFactor(kWheelDiameter * Math.PI)
.velocityConversionFactor(kWheelDiameter * Math.PI / 60);
kLeftMotor1Config.closedLoop
kLeftMotorConfig.closedLoop
.feedbackSensor(FeedbackSensor.kAbsoluteEncoder)
.pid(kLeftP, kLeftI, kLeftD)
.outputRange(-1, 1)
.feedForward
.sva(kLeftS, kLeftV, kLeftA);
kLeftMotor2Config
kRightMotorConfig
.idleMode(kShooterIdleMode)
.smartCurrentLimit(kCurrentLimit)
.inverted(kLeftShooterMotor2Inverted)
.follow(kLeftShooterMotor1CANID);
kRightMotor1Config
.idleMode(kShooterIdleMode)
.smartCurrentLimit(kCurrentLimit)
.inverted(kRightShooterMotor1Inverted);
kRightMotor1Config.absoluteEncoder
.inverted(kRightShooterMotorInverted);
kRightMotorConfig.absoluteEncoder
.positionConversionFactor(kWheelDiameter * Math.PI)
.velocityConversionFactor(kWheelDiameter * Math.PI / 60);
kRightMotor1Config.closedLoop
kRightMotorConfig.closedLoop
.feedbackSensor(FeedbackSensor.kAbsoluteEncoder)
.pid(kRightP, kRightI, kRightD)
.outputRange(-1, 1)
.feedForward
.sva(kRightS, kRightV, kRightA);
kRightMotor2Config
.idleMode(kShooterIdleMode)
.smartCurrentLimit(kCurrentLimit)
.inverted(kRightShooterMotor2Inverted)
.follow(kRightShooterMotor1CANID);
}
}

View File

@@ -10,16 +10,19 @@ import com.revrobotics.spark.config.SparkBaseConfig.IdleMode;
public class SpindexerConstants {
// TODO Real values
public static final int kSpindexerMotorCANID = 0;
public static final int kFeederMotorCANID = 0;
public static final int kFeederMotorCANID = 4;
public static final int kSpindexerStatorCurrentLimit = 90;
public static final int kSpindexerSupplyCurrentLimit = 50;
public static final int kSpindexerStatorCurrentLimit = 110;
public static final int kSpindexerSupplyCurrentLimit = 60;
public static final int kFeederCurrentLimit = 40;
public static final boolean kFeederMotorInverted = false;
public static final double kSpindexerSpeed = 1;
public static final double kFeederSpeed = 1;
public static final boolean kFeederMotorInverted = true;
public static final InvertedValue kSpindexerInversionState = InvertedValue.Clockwise_Positive;
public static final NeutralModeValue kSpindexerIdleMode = NeutralModeValue.Brake;
public static final NeutralModeValue kSpindexerIdleMode = NeutralModeValue.Coast;
public static final IdleMode kFeederIdleMode = IdleMode.kBrake;