mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-01 15:00:34 +08:00
Resurrect controllib testing.
This commit is contained in:
@@ -54,6 +54,46 @@ bool __EXPORT equal(float a, float b, float epsilon)
|
||||
} else { return true; }
|
||||
}
|
||||
|
||||
bool __EXPORT greater_than(float a, float b)
|
||||
{
|
||||
if (a > b) {
|
||||
return true;
|
||||
} else {
|
||||
printf("not a > b ->\n\ta: %12.8f\n\tb: %12.8f\n", double(a), double(b));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool __EXPORT less_than(float a, float b)
|
||||
{
|
||||
if (a < b) {
|
||||
return true;
|
||||
} else {
|
||||
printf("not a < b ->\n\ta: %12.8f\n\tb: %12.8f\n", double(a), double(b));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool __EXPORT greater_than_or_equal(float a, float b)
|
||||
{
|
||||
if (a >= b) {
|
||||
return true;
|
||||
} else {
|
||||
printf("not a >= b ->\n\ta: %12.8f\n\tb: %12.8f\n", double(a), double(b));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool __EXPORT less_than_or_equal(float a, float b)
|
||||
{
|
||||
if (a <= b) {
|
||||
return true;
|
||||
} else {
|
||||
printf("not a <= b ->\n\ta: %12.8f\n\tb: %12.8f\n", double(a), double(b));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void __EXPORT float2SigExp(
|
||||
const float &num,
|
||||
float &sig,
|
||||
|
||||
Reference in New Issue
Block a user