Replace SetOutputRange() with SetIntegratorRange()

If users are attempting to use the output range to limit the controller
action, they should use ProfiledPIDController instead. If they actually
intended to clamp the output, they should use std::clamp().
This commit is contained in:
Tyler Veness
2019-08-26 21:40:30 -07:00
committed by Peter Johnson
parent ff8b8f0a8a
commit 9b6ffc201c
11 changed files with 55 additions and 72 deletions

View File

@@ -17,14 +17,6 @@ class PIDInputOutputTest : public testing::Test {
void TearDown() override { delete controller; }
};
TEST_F(PIDInputOutputTest, OutputRangeTest) {
controller->SetP(1);
controller->SetOutputRange(-50, 50);
EXPECT_DOUBLE_EQ(-50, controller->Calculate(100, 0));
EXPECT_DOUBLE_EQ(50, controller->Calculate(0, 100));
}
TEST_F(PIDInputOutputTest, ContinuousInputTest) {
controller->SetP(1);
controller->EnableContinuousInput(-180, 180);