File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
main/java/org/strykeforce/thirdcoast/swerve
test/java/org/strykeforce/thirdcoast/swerve Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 2020@ SuppressWarnings ("unused" )
2121public class SwerveDrive {
2222
23+ public final static int DEFAULT_ABSOLUTE_AZIMUTH_OFFSET = 200 ;
2324 private static final Logger logger = LoggerFactory .getLogger (SwerveDrive .class );
2425 private static final int WHEEL_COUNT = 4 ;
2526 final AHRS gyro ;
@@ -201,7 +202,7 @@ public void zeroAzimuthEncoders() {
201202 void zeroAzimuthEncoders (Preferences prefs ) {
202203 Errors .setCount (0 );
203204 for (int i = 0 ; i < WHEEL_COUNT ; i ++) {
204- int position = prefs .getInt (getPreferenceKeyForWheel (i ), 0 );
205+ int position = prefs .getInt (getPreferenceKeyForWheel (i ), DEFAULT_ABSOLUTE_AZIMUTH_OFFSET );
205206 wheels [i ].setAzimuthZero (position );
206207 logger .info ("azimuth {}: loaded zero = {}" , i , position );
207208 }
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ void zeroAzimuthEncoders(@Mock Preferences prefs) {
8282 SwerveDrive swerve = new SwerveDrive (config );
8383 for (int i = 0 ; i < 4 ; i ++) {
8484 String key = SwerveDrive .getPreferenceKeyForWheel (i );
85- doReturn (i ).when (prefs ).getInt (key , 0 );
85+ doReturn (i ).when (prefs ).getInt (key , SwerveDrive . DEFAULT_ABSOLUTE_AZIMUTH_OFFSET );
8686 }
8787 swerve .zeroAzimuthEncoders (prefs );
8888
You can’t perform that action at this time.
0 commit comments