Skip to content

Commit 0b73116

Browse files
authored
Merge pull request #92 from strykeforce/swerve-zero-fail
Log error but don't throw exception when azimuth zero data missing
2 parents dc5eff9 + 8e9330e commit 0b73116

File tree

3 files changed

+2
-17
lines changed

3 files changed

+2
-17
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ plugins {
1111
}
1212

1313
group = "org.strykeforce"
14-
version = "22.0.0"
14+
version = "22.0.1"
1515

1616
sourceCompatibility = JavaVersion.VERSION_11
1717
targetCompatibility = JavaVersion.VERSION_11
@@ -69,7 +69,7 @@ dependencies {
6969

7070
testImplementation wpi.java.deps.wpilibJniDebug(wpi.platforms.desktop)
7171

72-
implementation 'org.slf4j:slf4j-api:1.7.32'
72+
implementation 'org.slf4j:slf4j-api:1.7.33'
7373
implementation 'io.github.microutils:kotlin-logging:2.1.21'
7474
implementation 'com.squareup.okhttp3:okhttp:4.9.3'
7575
implementation "org.jetbrains.kotlinx:kotlinx-html-jvm:0.7.3"

src/main/java/org/strykeforce/swerve/TalonSwerveModule.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public void loadAndSetAzimuthZeroReference() {
127127
int reference = Preferences.getInt(key, Integer.MIN_VALUE);
128128
if (reference == Integer.MIN_VALUE) {
129129
logger.error("no saved azimuth zero reference for swerve module {}", index);
130-
throw new IllegalStateException();
131130
}
132131
logger.info("swerve module {}: loaded azimuth zero reference = {}", index, reference);
133132

src/test/java/org/strykeforce/swerve/TalonSwerveModuleTest.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -166,20 +166,6 @@ void shouldSetAzimuthZero(int absoluteEncoderPosition, int zeroReference, double
166166
verify(azimuthTalon).setSelectedSensorPosition(setpoint, 0, 10);
167167
}
168168

169-
@Test
170-
@DisplayName("should throw exception if no NetworkTables reference")
171-
void shouldThrowExceptionIfNoNetworkTablesReference() {
172-
int index = 0; // fixture wheel is LF
173-
String key = String.format("SwerveDrive/wheel.%d", index);
174-
Preferences.remove(key);
175-
int reference = Preferences.getInt(key, Integer.MIN_VALUE);
176-
assertEquals(Integer.MIN_VALUE, reference);
177-
178-
when(sensorCollection.getPulseWidthPosition()).thenReturn(0);
179-
when(azimuthTalon.setSelectedSensorPosition(anyDouble(), anyInt(), anyInt()))
180-
.thenReturn(ErrorCode.valueOf(0));
181-
assertThrows(IllegalStateException.class, module::loadAndSetAzimuthZeroReference);
182-
}
183169
}
184170

185171
/*

0 commit comments

Comments
 (0)