28 template <
typename Arithmetic1,
typename Arithmetic2>
29 typename std::enable_if<std::is_integral<typename std::common_type<Arithmetic1, Arithmetic2>::type>
::value ,
bool>::type
30 is_equal(
const Arithmetic1 v_1,
const Arithmetic2 v_2);
32 template <
typename Arithmetic1,
typename Arithmetic2>
33 typename std::enable_if<std::is_floating_point<typename std::common_type<Arithmetic1, Arithmetic2>::type>
::value,
bool>::type
34 is_equal(
const Arithmetic1 v_1,
const Arithmetic2 v_2);
42 "Template parameter not of type float");
43 return (fabsf(static_cast<float>(fVal1)) < FLT_EPSILON);
52 "Template parameter not of type float");
53 return (static_cast<float>(fVal1) >= FLT_EPSILON);
63 "Template parameter not of type float");
64 return (static_cast<float>(fVal1) <= (-1.0 * FLT_EPSILON));
91 float *
mat_mul(
float *
A,
float *
B, uint8_t n);
94 bool inverse(
float x[],
float y[], uint16_t dim);
101 template <
typename T>
102 float wrap_180(
const T angle,
float unit_mod = 1);
107 template <
typename T>
115 template <
typename T>
116 float wrap_360(
const T angle,
float unit_mod = 1);
121 template <
typename T>
127 template <
typename T>
133 template <
typename T>
139 template <
typename T>
147 inline int16_t
constrain_int16(
const int16_t amt,
const int16_t low,
const int16_t high)
152 inline int32_t
constrain_int32(
const int32_t amt,
const int32_t low,
const int32_t high)
170 float sq(
const T val)
172 return powf(static_cast<float>(val), 2);
179 template<
typename T,
typename... Params>
180 float sq(
const T first,
const Params... parameters)
182 return sq(first) +
sq(parameters...);
189 template<
typename T,
typename U,
typename... Params>
190 float norm(
const T first,
const U second,
const Params... parameters)
192 return sqrtf(
sq(first, second, parameters...));
195 template<
typename A,
typename B>
196 static inline auto MIN(
const A &one,
const B &two) -> decltype(one < two ? one : two)
198 return one < two ? one : two;
201 template<
typename A,
typename B>
202 static inline auto MAX(
const A &one,
const B &two) -> decltype(one > two ? one : two)
204 return one > two ? one : two;
242 float var_low,
float var_high);
float norm(const T first, const U second, const Params... parameters)
float linear_interpolate(float low_output, float high_output, float var_value, float var_low, float var_high)
Vector3f rand_vec3f(void)
bool inverse3x3(float m[], float invOut[])
int16_t constrain_int16(const int16_t amt, const int16_t low, const int16_t high)
float safe_asin(const T v)
uint32_t nsec_to_usec(uint32_t nsec)
float wrap_PI(const T radian)
static auto MIN(const A &one, const B &two) -> decltype(one< two ? one :two)
float wrap_180(const T angle, float unit_mod=1)
uint32_t hz_to_nsec(uint32_t freq)
std::enable_if< std::is_integral< typename std::common_type< Arithmetic1, Arithmetic2 >::type >::value,bool >::type is_equal(const Arithmetic1 v_1, const Arithmetic2 v_2)
bool inverse4x4(float m[], float invOut[])
bool is_positive(const T fVal1)
static constexpr float degrees(float rad)
auto wrap_180_cd(const T angle) -> decltype(wrap_180(angle, 100.f))
static auto MAX(const A &one, const B &two) -> decltype(one > two ? one :two)
auto wrap_360_cd(const T angle) -> decltype(wrap_360(angle, 100.f))
A system for managing and storing variables that are of general interest to the system.
uint32_t nsec_to_hz(uint32_t nsec)
bool is_valid_octal(uint16_t octal)
T constrain_value(const T amt, const T low, const T high)
bool is_zero(const T fVal1)
uint32_t usec_to_nsec(uint32_t usec)
int32_t constrain_int32(const int32_t amt, const int32_t low, const int32_t high)
float * mat_mul(float *A, float *B, uint8_t n)
float wrap_360(const T angle, float unit_mod=1)
uint16_t get_random16(void)
Common definitions and utility routines for the ArduPilot libraries.
float safe_sqrt(const T v)
float constrain_float(const float amt, const float low, const float high)
static constexpr float radians(float deg)
float wrap_2PI(const T radian)
bool inverse(float x[], float y[], uint16_t dim)
bool is_negative(const T fVal1)
uint32_t hz_to_usec(uint32_t freq)
AP_PARAMDEFV(Vector3f, Vector3f, AP_PARAM_VECTOR3F)
uint32_t usec_to_hz(uint32_t usec)