mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[wpilib] Fix initial heading behavior in HolonomicDriveController (#3290)
This commit is contained in:
committed by
GitHub
parent
659b37ef9d
commit
aaf24e2552
@@ -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