From a280d67be830465b74fc757ed39ff08d09ad9550 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 26 Nov 2024 14:03:31 +0100 Subject: [PATCH] PID: Fix test to respect integral updates being applied in the next iteration Co-authored-by: chfriedrich98 <125505139+chfriedrich98@users.noreply.github.com> --- src/lib/pid/PIDTest.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/pid/PIDTest.cpp b/src/lib/pid/PIDTest.cpp index ed3c204e6ef8..ae7d847bde72 100644 --- a/src/lib/pid/PIDTest.cpp +++ b/src/lib/pid/PIDTest.cpp @@ -125,5 +125,6 @@ TEST(PIDTest, InteralOpenLoop) EXPECT_FLOAT_EQ(pid.update(0.f, 0.1f, true), -.05f); EXPECT_FLOAT_EQ(pid.update(0.f, 0.1f, true), -.05f); pid.resetIntegral(); + EXPECT_FLOAT_EQ(pid.update(0.f, 0.1f, true), 0.f); EXPECT_FLOAT_EQ(pid.update(0.f, 0.1f, true), -.01f); }