mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 18:13:33 +08:00
Fix unit test, create matrix isfinite.
This commit is contained in:
@@ -13,14 +13,19 @@
|
||||
namespace matrix
|
||||
{
|
||||
|
||||
template<typename Type>
|
||||
bool isfinite(Type x) {
|
||||
#if defined (__PX4_NUTTX) || defined (__PX4_QURT)
|
||||
return PX4_ISFINITE(x);
|
||||
#else
|
||||
return std::isfinite(x);
|
||||
#endif
|
||||
}
|
||||
|
||||
template<typename Type>
|
||||
Type wrap_pi(Type x)
|
||||
{
|
||||
#if defined (__PX4_NUTTX) || defined (__PX4_QURT)
|
||||
if (!isfinite(x)) {
|
||||
#else
|
||||
if (!std::isfinite(x)) {
|
||||
#endif
|
||||
return x;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user