Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion control_toolbox/include/control_toolbox/pid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ struct AntiWindupStrategy
"{})",
i_min, i_max));
}
if (std::isfinite(i_min) || std::isfinite(i_max))
if (type != LEGACY && (std::isfinite(i_min) || std::isfinite(i_max)))
{
std::cout << "Warning: The i_min and i_max are only valid for the deprecated LEGACY "
"antiwindup strategy. Please use the AntiWindupStrategy::set_type() method to "
Expand Down
7 changes: 6 additions & 1 deletion control_toolbox/src/pid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ bool Pid::set_gains(const Gains & gains_in)
std::string error_msg = "";
if (!gains_in.validate(error_msg))
{
std::cerr << "PID: Invalid gains: " << error_msg << ". SKipping new gains." << std::endl;
std::cerr << "PID: Invalid gains: " << error_msg << ". Skipping new gains." << std::endl;
return false;
}
else
Expand Down Expand Up @@ -417,6 +417,11 @@ double Pid::compute_command(double error, double error_dot, const double & dt_s)
i_term_ += dt_s * gains_.i_gain_ * error;
}
}
else if (gains_.antiwindup_strat_.type == AntiWindupStrategy::NONE)
{
// No anti-windup strategy, so just integrate the error
i_term_ += dt_s * gains_.i_gain_ * error;
}
}

return cmd_;
Expand Down
Loading