mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-12 05:57:35 +08:00
Expand auto-format coverage and tiny style changes
This commit is contained in:
committed by
Mathieu Bresciani
parent
fbdd75da2e
commit
f20726d47f
+7
-23
@@ -42,34 +42,18 @@
|
||||
|
||||
#ifdef ECL_STANDALONE
|
||||
|
||||
namespace math
|
||||
{
|
||||
namespace math {
|
||||
|
||||
float min(float val1, float val2)
|
||||
{
|
||||
return (val1 < val2) ? val1 : val2;
|
||||
}
|
||||
float min(float val1, float val2) { return (val1 < val2) ? val1 : val2; }
|
||||
|
||||
float max(float val1, float val2)
|
||||
{
|
||||
return (val1 > val2) ? val1 : val2;
|
||||
}
|
||||
float max(float val1, float val2) { return (val1 > val2) ? val1 : val2; }
|
||||
|
||||
float constrain(float val, float min, float max)
|
||||
{
|
||||
return (val < min) ? min : ((val > max) ? max : val);
|
||||
}
|
||||
float constrain(float val, float min, float max) { return (val < min) ? min : ((val > max) ? max : val); }
|
||||
|
||||
float radians(float degrees)
|
||||
{
|
||||
return (degrees / 180.0f) * M_PI_F;
|
||||
}
|
||||
float radians(float degrees) { return (degrees / 180.0f) * M_PI_F; }
|
||||
|
||||
float degrees(float radians)
|
||||
{
|
||||
return (radians * 180.0f) / M_PI_F;
|
||||
}
|
||||
float degrees(float radians) { return (radians * 180.0f) / M_PI_F; }
|
||||
|
||||
} // namespace math
|
||||
} // namespace math
|
||||
|
||||
#endif /* ECL_STANDALONE */
|
||||
|
||||
+4
-5
@@ -51,8 +51,7 @@
|
||||
#define M_PI_2_F (M_PI / 2.0f)
|
||||
#endif
|
||||
|
||||
namespace math
|
||||
{
|
||||
namespace math {
|
||||
// using namespace Eigen;
|
||||
|
||||
float min(float val1, float val2);
|
||||
@@ -61,10 +60,10 @@ float constrain(float val, float min, float max);
|
||||
float radians(float degrees);
|
||||
float degrees(float radians);
|
||||
|
||||
}
|
||||
} // namespace math
|
||||
#else
|
||||
|
||||
#include <mathlib/mathlib.h>
|
||||
|
||||
#endif //ECL_STANDALONE
|
||||
#endif //MATHLIB_H
|
||||
#endif // ECL_STANDALONE
|
||||
#endif // MATHLIB_H
|
||||
|
||||
Reference in New Issue
Block a user