Skip to content
Snippets Groups Projects
Commit 7b399cc5 authored by armar4-demo's avatar armar4-demo
Browse files

Added limitTo function

parent a4196fdf
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,12 @@ namespace armarx
return Eigen::Vector3f(LimitMinMax(min(0), max(0), value(0)), LimitMinMax(min(1), max(1), value(1)), LimitMinMax(min(2), max(2), value(2)));
}
static double LimitTo(double value, double absThreshold)
{
int sign = value >= 0 ? 1 : -1;
return sign * std::min<double>(fabs(value), absThreshold);
}
static bool CheckMinMax(int min, int max, int value)
{
return value >= min && value <= max;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment