From b40a114a0a8d3d32e20d2041f12e238adf7500b1 Mon Sep 17 00:00:00 2001 From: Corvus Corax Date: Wed, 18 Jun 2014 21:29:55 +0200 Subject: [PATCH] OP-1371 treat hitl as nav capable fusion algorithm if positionstate is set by sim --- flight/libraries/sanitycheck.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/flight/libraries/sanitycheck.c b/flight/libraries/sanitycheck.c index 270543f24..665f167d3 100644 --- a/flight/libraries/sanitycheck.c +++ b/flight/libraries/sanitycheck.c @@ -38,6 +38,7 @@ #include #include #include +#include #include // a number of useful macros @@ -79,10 +80,17 @@ int32_t configuration_check() break; default: navCapableFusion = false; + // check for hitl. hitl allows to feed position and velocity state via + // telemetry, this makes nav possible even with an unsuited algorithm + if (PositionStateHandle()) { + if (PositionStateReadOnly()) { + navCapableFusion = true; + } + } } #else const bool navCapableFusion = false; -#endif +#endif /* ifdef REVOLUTION */ // Classify airframe type