From 1a79e7ec89800e1c6c42149593993c95b53d1953 Mon Sep 17 00:00:00 2001 From: Brian Holt Date: Thu, 17 Jun 2021 10:51:33 +0100 Subject: [PATCH] exposed angle_error and pid_enabled parameters --- src/pid/pid.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pid/pid.cpp b/src/pid/pid.cpp index 797fa9e..b329dd6 100644 --- a/src/pid/pid.cpp +++ b/src/pid/pid.cpp @@ -58,10 +58,12 @@ PID::PID(): this->declare_parameter("Kp", 1.0); this->declare_parameter("Ki", 0.0); this->declare_parameter("Kd", 0.0); - this->declare_parameter("upper_limit", 1000.0); this->declare_parameter("lower_limit", -1000.0); + this->declare_parameter("upper_limit", 1000.0); this->declare_parameter("windup_limit", -1000.0); this->declare_parameter("cutoff_frequency", -1.0); + this->declare_parameter("angle_error", false); + this->declare_parameter("pid_enabled", true); printParameters(); @@ -128,10 +130,12 @@ void PID::doCalcs() this->get_parameter("Kp", Kp_); this->get_parameter("Ki", Ki_); this->get_parameter("Kd", Kd_); - this->get_parameter("upper_limit", upper_limit_); this->get_parameter("lower_limit", lower_limit_); + this->get_parameter("upper_limit", upper_limit_); this->get_parameter("windup_limit", windup_limit_); this->get_parameter("cutoff_frequency", cutoff_frequency_); + this->get_parameter("angle_error", angle_error_); + this->get_parameter("pid_enabled", pid_enabled_); if (!((Kp_ <= 0. && Ki_ <= 0. && Kd_ <= 0.) ||