Skip to content

Commit

Permalink
exposed angle_error and pid_enabled parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHoltPP committed Jun 17, 2021
1 parent 4f4ea61 commit 1a79e7e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/pid/pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ PID::PID():
this->declare_parameter<double>("Kp", 1.0);
this->declare_parameter<double>("Ki", 0.0);
this->declare_parameter<double>("Kd", 0.0);
this->declare_parameter<double>("upper_limit", 1000.0);
this->declare_parameter<double>("lower_limit", -1000.0);
this->declare_parameter<double>("upper_limit", 1000.0);
this->declare_parameter<double>("windup_limit", -1000.0);
this->declare_parameter<double>("cutoff_frequency", -1.0);
this->declare_parameter<bool>("angle_error", false);
this->declare_parameter<bool>("pid_enabled", true);

printParameters();

Expand Down Expand Up @@ -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.) ||
Expand Down

0 comments on commit 1a79e7e

Please sign in to comment.