floatKH[24][24];// intermediate result used for covariance updates
floatKHP[24][24];// intermediate result used for covariance updates
floatP[24][24];// covariance matrix
floatstates[24];// state matrix
floatstates[24];// state matrix - 4 x quaternions, 3 x Vel, 3 x Pos, 3 x gyro bias, 3 x accel bias, 2 x wind vel, 3 x earth mag field, 3 x body mag field
floatstoredStates[24][50];// state vectors stored for the last 50 time steps
uint32_tstatetimeStamp[50];// time stamp for each state vector stored
Vector3fcorrectedDelAng;// delta angles about the xyz body axes corrected for errors (rad)
Vector3fcorrectedDelVel;// delta velocities along the XYZ body axes corrected for errors (m/s)
Vector3fsummedDelAng;// summed delta angles about the xyz body axes corrected for errors (rad)
Vector3fsummedDelVel;// summed delta velocities along the XYZ body axes corrected for errors (m/s)
floataccNavMag;// magnitude of navigation accel (- used to adjust GPS obs variance (m/s^2)
Vector3fsummedDelAng;// corrected & summed delta angles about the xyz body axes (rad)
Vector3fsummedDelVel;// corrected & summed delta velocities along the XYZ body axes (m/s)
Vector3fprevDelAng;// previous delta angle use for INS coning error compensation
Matrix3fprevTnb;// previous nav to body transformation used for INS earth rotation compensation
floataccNavMag;// magnitude of navigation accel - used to adjust GPS obs variance (m/s^2)
Vector3fearthRateNED;// earths angular rate vector in NED (rad/s)
Vector3fdVelIMU;// delta velocity vector in XYZ body axes measured by the IMU (m/s)
Vector3fdAngIMU;// delta angle vector in XYZ body axes measured by the IMU (rad)
floatdtIMU;// time lapsed since the last IMU measurement or covariance update (sec)
floatdt;// time lapsed since last covariance prediction
floatdtIMU;// time lapsed since the last IMU measurement (sec)
floatdt;// time lapsed since the last covariance prediction (sec)
boolonGround;// boolean true when the flight vehicle is on the ground (not flying)
constbooluseAirspeed;// boolean true if airspeed data is being used
constbooluseCompass;// boolean true if magnetometer data is being used
constuint8_tfusionModeGPS;// 0 = GPS outputs 3D velocity, 1 = GPS outputs 2D velocity, 2 = GPS outputs no velocity