14 #define sgn(x) (((x)>0)?1:-1) 15 #define deg2rad(x) ((x)*M_PI/180) 16 #define rad2deg(x) ((x)*180/M_PI) 17 #define sqr(x) ((x)*(x)) 18 #define LPF(dT, omega, x, y) ((y) = (((dT)*(omega)/(1+(dT)*(omega)))*(x)+1/(1+(dT)*(omega))*(y))) 21 void LIMITER(T &org,
const T &min_,
const T &max_)
23 for (
unsigned int i=0;
i<org.size();
i++){
24 if (org(
i) > max_(
i)){
26 }
else if (org(
i) < min_(
i)){
33 void DEADZONE(T &org,
const T &min_,
const T &max_)
35 for (
unsigned int i=0;
i<org.size();
i++){
36 if (org(
i) > max_(
i)){
38 }
else if (org(
i) < min_(
i)){
46 inline void LIMIT(
double &org,
const double max_)
50 }
else if (org < -max_){
55 inline void LIMITER(
double &org,
const double min_,
const double max_)
59 }
else if (org < min_){
64 inline void LIMITER(
int &org,
const int min_,
const int max_)
68 }
else if (org < min_){
73 inline void DEADZONE(
double &org,
const double min_,
const double max_)
77 }
else if (org < min_){
85 const double min_,
const double max_)
87 if (old >= newv-min_){
89 }
else if (old <= newv - max_){
void HYSTERESIS(double &newv, const double old, const double min_, const double max_)
void LIMIT(double &org, const double max_)
void LIMITER(T &org, const T &min_, const T &max_)
void DEADZONE(T &org, const T &min_, const T &max_)