mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Merge branch 'main' into 2022
This commit is contained in:
@@ -72,4 +72,19 @@ class HolonomicDriveControllerTest {
|
||||
MathUtil.angleModulus(finalRobotPose.getRotation().getRadians()),
|
||||
kAngularTolerance));
|
||||
}
|
||||
|
||||
@Test
|
||||
void testDoesNotRotateUnnecessarily() {
|
||||
var controller =
|
||||
new HolonomicDriveController(
|
||||
new PIDController(1, 0, 0),
|
||||
new PIDController(1, 0, 0),
|
||||
new ProfiledPIDController(1, 0, 0, new TrapezoidProfile.Constraints(4, 2)));
|
||||
|
||||
ChassisSpeeds speeds =
|
||||
controller.calculate(
|
||||
new Pose2d(0, 0, new Rotation2d(1.57)), new Pose2d(), 0, new Rotation2d(1.57));
|
||||
|
||||
assertEquals(0.0, speeds.omegaRadiansPerSecond);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user