Skip to content

Commit df9faf0

Browse files
committed
Fix unit tests
1 parent 56fc783 commit df9faf0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/java/org/lasarobotics/drive/TractionControlController.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ private State(int value) {
3737
public abstract State toggle();
3838
}
3939

40+
public static final double VELOCITY_CORRECTION_SCALAR = 0.7;
41+
4042
private final double MIN_SLIP_RATIO = 0.01;
4143
private final double MAX_SLIP_RATIO = 0.40;
42-
private final double VELOCITY_CORRECTION_SCALAR = 0.7;
4344
private final int SIGMOID_K = 10;
4445
private final Measure<Velocity<Distance>> INERTIAL_VELOCITY_THRESHOLD = Units.MetersPerSecond.of(0.01);
4546
private final Measure<Time> MIN_SLIPPING_TIME = Units.Seconds.of(1.1);

src/test/java/org/lasarobotics/drive/TractionControlTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public void limitSlip() {
5252

5353
// Verify behavior
5454
assertTrue(m_tractionControlController.isSlipping());
55-
assertTrue(outputSpeed.lte(MAX_LINEAR_SPEED.times(SLIP_RATIO.in(Units.Value))));
55+
assertTrue(outputSpeed.lte(MAX_LINEAR_SPEED));
5656
}
5757

5858
@Test

0 commit comments

Comments
 (0)