Skip to content

Commit dc7d722

Browse files
committed
Revert "Fix issue with tracking time constant validation when no i-gain"
This reverts commit 8c0d18a.
1 parent 62f371b commit dc7d722

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

control_toolbox/include/control_toolbox/pid.hpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@
4545

4646
namespace control_toolbox
4747
{
48-
template <typename T>
49-
inline bool is_zero(T value, T tolerance = std::numeric_limits<T>::epsilon())
50-
{
51-
return std::abs(value) <= tolerance;
52-
}
53-
5448
/**
5549
* \brief Antiwindup strategy for PID controllers.
5650
*
@@ -113,14 +107,14 @@ struct AntiWindupStrategy
113107
}
114108
}
115109

116-
void validate(const double i_gain) const
110+
void validate() const
117111
{
118112
if (type == UNDEFINED)
119113
{
120114
throw std::invalid_argument("AntiWindupStrategy is UNDEFINED. Please set a valid type");
121115
}
122116
if (
123-
type == BACK_CALCULATION && !is_zero(i_gain) &&
117+
type == BACK_CALCULATION &&
124118
(tracking_time_constant < 0.0 || !std::isfinite(tracking_time_constant)))
125119
{
126120
throw std::invalid_argument(
@@ -174,6 +168,12 @@ struct AntiWindupStrategy
174168
std::numeric_limits<double>::epsilon(); /**< Error deadband to avoid integration. */
175169
};
176170

171+
template <typename T>
172+
inline bool is_zero(T value, T tolerance = std::numeric_limits<T>::epsilon())
173+
{
174+
return std::abs(value) <= tolerance;
175+
}
176+
177177
/***************************************************/
178178
/*!
179179
\class Pid
@@ -316,7 +316,7 @@ class Pid
316316
}
317317
try
318318
{
319-
antiwindup_strat_.validate(i_gain_);
319+
antiwindup_strat_.validate();
320320
}
321321
catch (const std::exception & e)
322322
{

control_toolbox/src/pid_ros.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ bool PidROS::initialize_from_ros_parameters()
207207

208208
try
209209
{
210-
antiwindup_strat.validate(i);
210+
antiwindup_strat.validate();
211211
}
212212
catch (const std::exception & e)
213213
{

0 commit comments

Comments
 (0)