39 #include <gtest/gtest.h> 49 const float test_limit = 1.0;
50 const float innovations[9] = {0.0, 1.5, 2.5, -1.5, -2.5, 1.5, -1.5, -2.5, -2.5};
51 const float innovations_lpf[9] = {0.0, 0.9, 0.9, -0.9, -0.9, 1.1, -1.1, -1.1, 1.1};
52 const bool expected_result[9] = {
false,
false,
true,
false,
true,
true,
true,
true,
true};
54 for (
int i = 0; i < 9; i++) {
61 for (
int i = 1; i < 9; i++) {
66 for (
int i = 0; i < 9; i++) {
73 const float test_limit = 1.0;
74 Vector2f innovations[4] = {{0.0, 0.0}, {0.0, 0.0}, {0.0, -2.5}, {1.5, -1.5}};
75 Vector2f innovations_lpf[4] = {{0.0, 0.0}, {1.1, 0.0}, {0.5, 0.5}, {1.0, -1.0}};
76 const bool expected_result[4] = {
false,
true,
true,
true};
78 for (
int i = 0; i < 4; i++) {
85 for (
int i = 1; i < 4; i++) {
90 for (
int i = 0; i < 4; i++) {
static bool checkInnovFailed(float innov, float innov_lpf, float test_limit)
Vector2< float > Vector2f
TEST_F(PreFlightCheckerTest, testInnovFailed)
Class handling the EKF2 innovation pre flight checks.
static bool checkInnov2DFailed(const Vector2f &innov, const Vector2f &innov_lpf, float test_limit)
Test code for PreFlightChecker class Run this test only using make tests TESTFILTER=PreFlightChecker...