Skip to content

Commit

Permalink
Fix templated class member variable types
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Dec 1, 2024
1 parent e68482c commit e578b0c
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions include/control_toolbox/rate_limiter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ class RateLimiter
* If min_first_derivative_pos/max_first_derivative_neg values are NAN, symmetric limits are used
*/
RateLimiter(
T min_value = std::numeric_limits<double>::quiet_NaN(),
T max_value = std::numeric_limits<double>::quiet_NaN(),
T min_first_derivative_neg = std::numeric_limits<double>::quiet_NaN(),
T max_first_derivative_pos = std::numeric_limits<double>::quiet_NaN(),
T min_first_derivative_pos = std::numeric_limits<double>::quiet_NaN(),
T max_first_derivative_neg = std::numeric_limits<double>::quiet_NaN(),
T min_second_derivative = std::numeric_limits<double>::quiet_NaN(),
T max_second_derivative = std::numeric_limits<double>::quiet_NaN());
T min_value = std::numeric_limits<T>::quiet_NaN(),
T max_value = std::numeric_limits<T>::quiet_NaN(),
T min_first_derivative_neg = std::numeric_limits<T>::quiet_NaN(),
T max_first_derivative_pos = std::numeric_limits<T>::quiet_NaN(),
T min_first_derivative_pos = std::numeric_limits<T>::quiet_NaN(),
T max_first_derivative_neg = std::numeric_limits<T>::quiet_NaN(),
T min_second_derivative = std::numeric_limits<T>::quiet_NaN(),
T max_second_derivative = std::numeric_limits<T>::quiet_NaN());

/**
* \brief Limit the value and first_derivative
Expand Down Expand Up @@ -114,14 +114,14 @@ class RateLimiter
* If min_first_derivative_pos/max_first_derivative_neg values are NAN, symmetric limits are used
*/
void set_params(
T min_value = std::numeric_limits<double>::quiet_NaN(),
T max_value = std::numeric_limits<double>::quiet_NaN(),
T min_first_derivative_neg = std::numeric_limits<double>::quiet_NaN(),
T max_first_derivative_pos = std::numeric_limits<double>::quiet_NaN(),
T min_first_derivative_pos = std::numeric_limits<double>::quiet_NaN(),
T max_first_derivative_neg = std::numeric_limits<double>::quiet_NaN(),
T min_second_derivative = std::numeric_limits<double>::quiet_NaN(),
T max_second_derivative = std::numeric_limits<double>::quiet_NaN());
T min_value = std::numeric_limits<T>::quiet_NaN(),
T max_value = std::numeric_limits<T>::quiet_NaN(),
T min_first_derivative_neg = std::numeric_limits<T>::quiet_NaN(),
T max_first_derivative_pos = std::numeric_limits<T>::quiet_NaN(),
T min_first_derivative_pos = std::numeric_limits<T>::quiet_NaN(),
T max_first_derivative_neg = std::numeric_limits<T>::quiet_NaN(),
T min_second_derivative = std::numeric_limits<T>::quiet_NaN(),
T max_second_derivative = std::numeric_limits<T>::quiet_NaN());

private:
// Enable/Disable value/first_derivative/second_derivative limits:
Expand All @@ -130,18 +130,18 @@ class RateLimiter
bool has_second_derivative_limits_ = true;

// value limits:
T min_value_ = std::numeric_limits<double>::quiet_NaN();
T max_value_ = std::numeric_limits<double>::quiet_NaN();
T min_value_ = std::numeric_limits<T>::quiet_NaN();
T max_value_ = std::numeric_limits<T>::quiet_NaN();

// first_derivative limits:
T min_first_derivative_neg_ = std::numeric_limits<double>::quiet_NaN();
T max_first_derivative_pos_ = std::numeric_limits<double>::quiet_NaN();
T min_first_derivative_pos_ = std::numeric_limits<double>::quiet_NaN();
T max_first_derivative_neg_ = std::numeric_limits<double>::quiet_NaN();
T min_first_derivative_neg_ = std::numeric_limits<T>::quiet_NaN();
T max_first_derivative_pos_ = std::numeric_limits<T>::quiet_NaN();
T min_first_derivative_pos_ = std::numeric_limits<T>::quiet_NaN();
T max_first_derivative_neg_ = std::numeric_limits<T>::quiet_NaN();

// second_derivative limits:
T min_second_derivative_ = std::numeric_limits<double>::quiet_NaN();
T max_second_derivative_ = std::numeric_limits<double>::quiet_NaN();
T min_second_derivative_ = std::numeric_limits<T>::quiet_NaN();
T max_second_derivative_ = std::numeric_limits<T>::quiet_NaN();
};

template <typename T>
Expand Down

0 comments on commit e578b0c

Please sign in to comment.