mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Remove percent tolerance from PID controller
It breaks the unit system badly; the tolerance member variable has different units depending on percent vs absolute. Absolute tolerance is a lot more natural than percent tolerance anyway.
This commit is contained in:
committed by
Peter Johnson
parent
0ca8d667d2
commit
ff8b8f0a8a
@@ -25,15 +25,6 @@ TEST_F(PIDInputOutputTest, OutputRangeTest) {
|
||||
EXPECT_DOUBLE_EQ(50, controller->Calculate(0, 100));
|
||||
}
|
||||
|
||||
TEST_F(PIDInputOutputTest, InputRangeTest) {
|
||||
controller->SetP(1);
|
||||
controller->SetOutputRange(-1000, 1000);
|
||||
controller->SetInputRange(-50, 50);
|
||||
|
||||
EXPECT_DOUBLE_EQ(-100, controller->Calculate(100, 0));
|
||||
EXPECT_DOUBLE_EQ(50, controller->Calculate(0, 100));
|
||||
}
|
||||
|
||||
TEST_F(PIDInputOutputTest, ContinuousInputTest) {
|
||||
controller->SetP(1);
|
||||
controller->EnableContinuousInput(-180, 180);
|
||||
|
||||
Reference in New Issue
Block a user