Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ sourceSets.main.java {

// When in doubt, use the latest version from
// https://dev.azure.com/Team488/Team%20488%20Builds/_artifacts/feed/XBot
def SeriouslyCommonLibVersion = '20261010.5'
def SeriouslyCommonLibVersion = '20261031.5'

def ROBOT_MAIN_CLASS = "competition.Main"

Expand Down
28 changes: 13 additions & 15 deletions src/main/java/competition/electrical_contract/Contract2023.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.wpilib.units.Units;
import org.wpilib.units.measure.Distance;
import org.wpilib.hardware.imu.OnboardIMU.MountOrientation;
import xbot.common.injection.electrical_contract.CANBusId;
import org.wpilib.hardware.bus.CANPort;
import xbot.common.injection.electrical_contract.CANMotorControllerInfo;
import xbot.common.injection.electrical_contract.CameraInfo;
import xbot.common.injection.electrical_contract.DeviceInfo;
Expand Down Expand Up @@ -51,28 +51,28 @@ public CANMotorControllerInfo getDriveMotor(SwerveInstance swerveInstance) {
case "FrontLeftDrive" -> new CANMotorControllerInfo(
getDriveControllerName(swerveInstance),
MotorControllerType.SparkMax,
CANBusId.RIO,
CANPort.CAN_S0,
31,
driveMotorControllerOutputConfig
);
case "FrontRightDrive" -> new CANMotorControllerInfo(
getDriveControllerName(swerveInstance),
MotorControllerType.SparkMax,
CANBusId.RIO,
CANPort.CAN_S0,
29,
driveMotorControllerOutputConfig
);
case "RearLeftDrive" -> new CANMotorControllerInfo(
getDriveControllerName(swerveInstance),
MotorControllerType.SparkMax,
CANBusId.RIO,
CANPort.CAN_S0,
38,
driveMotorControllerOutputConfig
);
case "RearRightDrive" -> new CANMotorControllerInfo(
getDriveControllerName(swerveInstance),
MotorControllerType.SparkMax,
CANBusId.RIO,
CANPort.CAN_S0,
21,
driveMotorControllerOutputConfig
);
Expand All @@ -90,31 +90,31 @@ public CANMotorControllerInfo getSteeringMotor(SwerveInstance swerveInstance) {
new CANMotorControllerInfo(
getDriveControllerName(swerveInstance),
MotorControllerType.SparkMax,
CANBusId.RIO,
CANPort.CAN_S0,
30,
steerMotorControllerOutputConfig
);
case "FrontRightDrive" ->
new CANMotorControllerInfo(
getDriveControllerName(swerveInstance),
MotorControllerType.SparkMax,
CANBusId.RIO,
CANPort.CAN_S0,
28,
steerMotorControllerOutputConfig
);
case "RearLeftDrive" ->
new CANMotorControllerInfo(
getDriveControllerName(swerveInstance),
MotorControllerType.SparkMax,
CANBusId.RIO,
CANPort.CAN_S0,
39,
steerMotorControllerOutputConfig
);
case "RearRightDrive" ->
new CANMotorControllerInfo(
getDriveControllerName(swerveInstance),
MotorControllerType.SparkMax,
CANBusId.RIO,
CANPort.CAN_S0,
20,
steerMotorControllerOutputConfig
);
Expand All @@ -124,17 +124,15 @@ public CANMotorControllerInfo getSteeringMotor(SwerveInstance swerveInstance) {

@Override
public DeviceInfo getSteeringEncoder(SwerveInstance swerveInstance) {
double simulationScalingValue = 1.0;

return switch (swerveInstance.label()) {
case "FrontLeftDrive" ->
new DeviceInfo(getSteeringEncoderControllerName(swerveInstance), 51, false, simulationScalingValue);
new DeviceInfo(getSteeringEncoderControllerName(swerveInstance), CANPort.CAN_S0, 51, false);
case "FrontRightDrive" ->
new DeviceInfo(getSteeringEncoderControllerName(swerveInstance), 52, false, simulationScalingValue);
new DeviceInfo(getSteeringEncoderControllerName(swerveInstance), CANPort.CAN_S0, 52, false);
case "RearLeftDrive" ->
new DeviceInfo(getSteeringEncoderControllerName(swerveInstance), 53, false, simulationScalingValue);
new DeviceInfo(getSteeringEncoderControllerName(swerveInstance), CANPort.CAN_S0, 53, false);
case "RearRightDrive" ->
new DeviceInfo(getSteeringEncoderControllerName(swerveInstance), 54, false, simulationScalingValue);
new DeviceInfo(getSteeringEncoderControllerName(swerveInstance), CANPort.CAN_S0, 54, false);
default -> null;
};
}
Expand Down