Line data Source code
1 : /* 2 : NavEKF_core_common holds scratch data shared by EKF2 and EKF3 3 : 4 : This program is free software: you can redistribute it and/or modify 5 : it under the terms of the GNU General Public License as published by 6 : the Free Software Foundation, either version 3 of the License, or 7 : (at your option) any later version. 8 : 9 : This program is distributed in the hope that it will be useful, 10 : but WITHOUT ANY WARRANTY; without even the implied warranty of 11 : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 : GNU General Public License for more details. 13 : 14 : You should have received a copy of the GNU General Public License 15 : along with this program. If not, see <http://www.gnu.org/licenses/>. 16 : */ 17 : #include "AP_NavEKF_core_common.h" 18 : 19 : NavEKF_core_common::Matrix24 NavEKF_core_common::KHP; 20 : NavEKF_core_common::Vector28 NavEKF_core_common::Kfusion; 21 : 22 : /* 23 : fill common scratch variables, for detecting re-use of variables between loops in SITL 24 : */ 25 82531734 : void NavEKF_core_common::fill_scratch_variables(void) 26 : { 27 : #if CONFIG_HAL_BOARD == HAL_BOARD_SITL 28 : // fill the common variables with NaN, so we catch any cases in 29 : // SITL where they are used without initialisation. These are all 30 : // supposed to be scratch variables that are not used between 31 : // iterations 32 82531734 : fill_nanf(&KHP[0][0], sizeof(KHP)/sizeof(ftype)); 33 82531734 : fill_nanf(&Kfusion[0], sizeof(Kfusion)/sizeof(ftype)); 34 : #endif 35 82531734 : }