Angle minimum = (* min_)(t).get(Angle());
Angle maximum = (* max_)(t).get(Angle());
Angle link = (*link_)(t).get(Angle());
-
+// This code was removed because it didn't work with link < minimum
+// It is sane to completely delete it if the replacement code is fine.
+/* ***********************************************
// if link is between min and max, use it
if (Angle::deg((link-minimum).mod()).get() < Angle::deg((maximum-minimum).mod()).get())
return link;
return minimum;
else
return maximum;
+*********************************************** */
+ if(Angle::rad(maximum).get()>=Angle::rad(link).get() && Angle::rad(link).get()>=Angle::rad(minimum).get())
+ return link;
+ else if (Angle::rad(minimum).get()>Angle::rad(link).get())
+ return minimum;
+ else
+ return maximum;
}
case ValueBase::TYPE_INTEGER:
return std::max((*min_)(t).get(int()), std::min((*max_)(t).get(int()), (*link_)(t).get(int())));