From d3aeed33ce704a690bbe3e965374c81233662d7c Mon Sep 17 00:00:00 2001 From: Andru Liu <90433630+WallabyLester@users.noreply.github.com> Date: Wed, 9 Oct 2024 20:09:52 -0700 Subject: [PATCH] Test init of the controller. --- TF_Implementation/test/test_aPID_tf.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/TF_Implementation/test/test_aPID_tf.py b/TF_Implementation/test/test_aPID_tf.py index 80c331f..6eba41a 100644 --- a/TF_Implementation/test/test_aPID_tf.py +++ b/TF_Implementation/test/test_aPID_tf.py @@ -13,7 +13,19 @@ class TestAdaptivePIDTf(unittest.TestCase): self.n_centers = 5 self.input_dim = 3 self.rbf_model = RBFAdaptiveModel(self.n_centers, self.input_dim) - self.pid_controller = AdaptivePIDTf(self.Kp, self.Ki, self.Kd, self.rbf_model) + self.apid = AdaptivePIDTf(self.Kp, self.Ki, self.Kd, self.rbf_model) + + def test_initialization(self): + """ Test initialization of the controller.""" + self.assertEqual(self.apid.Kp, self.Kp) + self.assertEqual(self.apid.Ki, self.Ki) + self.assertEqual(self.apid.Kd, self.Kd) + self.assertIsInstance(self.apid.rbf_model, RBFAdaptiveModel) + self.assertEqual(self.apid.prev_err, 0) + self.assertEqual(self.apid.error, 0) + self.assertEqual(self.apid.integral, 0) + self.assertEqual(self.apid.derivative, 0) + if __name__ == '__main__':