mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[wpimath] Prevent CoordinateSystem from accepting left-handed systems (#8750)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
package org.wpilib.math.geometry;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.wpilib.math.util.Units;
|
||||
@@ -232,4 +233,17 @@ class CoordinateSystemTest {
|
||||
CoordinateSystem.EDN(),
|
||||
CoordinateSystem.NED());
|
||||
}
|
||||
|
||||
@Test
|
||||
void testLeftHandedSystemThrowsException() {
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> new CoordinateSystem(CoordinateAxis.N(), CoordinateAxis.E(), CoordinateAxis.U()));
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> new CoordinateSystem(CoordinateAxis.E(), CoordinateAxis.U(), CoordinateAxis.N()));
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> new CoordinateSystem(CoordinateAxis.N(), CoordinateAxis.W(), CoordinateAxis.D()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user