floatbeta_avg_ft_us{1000000.0f};// The average time between synthetic sideslip measurements (usec)
// range finder fusion
floatrange_noise;// observation noise for range finder measurements (m)
floatrange_innov_gate;// range finder fusion innovation consistency gate size (STD)
floatrng_gnd_clearance;// minimum valid value for range when on ground (m)
floatrng_sens_pitch;// Pitch offset of the range sensor (rad). Sensor points out along Z axis when offset is zero. Positive rotation is RH about Y axis.
floatrange_noise_scaler;// scaling from range measurement to noise (m/m)
floatrange_noise{0.1f};// observation noise for range finder measurements (m)
floatrange_innov_gate{5.0f};// range finder fusion innovation consistency gate size (STD)
floatrng_gnd_clearance{0.1f};// minimum valid value for range when on ground (m)
floatrng_sens_pitch{0.0f};// Pitch offset of the range sensor (rad). Sensor points out along Z axis when offset is zero. Positive rotation is RH about Y axis.
floatrange_noise_scaler{0.0f};// scaling from range measurement to noise (m/m)
floatflow_rate_max;// maximum valid optical flow rate (rad/sec)
floatflow_noise{0.15f};// observation noise for optical flow LOS rate measurements (rad/sec)
floatflow_noise_qual_min{0.5f};// observation noise for optical flow LOS rate measurements when flow sensor quality is at the minimum useable (rad/sec)
intflow_qual_min{1};// minimum acceptable quality integer from the flow sensor
Vector2fposNE_change;// North, East position change due to last reset (m)
floatposD_change;// Down position change due to last reset (m)
Quaternionquat_change;// quaternion delta due to last reset - multiply pre-reset quaternion by this to get post-reset quaternion
}_state_reset_status;
}_state_reset_status{};
float_dt_ekf_avg;// average update rate of the ekf
float_dt_update;// delta time since last ekf update. This time can be used for filters
// which run at the same rate as the Ekf::update() function
float_dt_ekf_avg{0.001f*FILTER_UPDATE_PERIOD_MS};// average update rate of the ekf
float_dt_update{0.01f};// delta time since last ekf update. This time can be used for filters
// which run at the same rate as the Ekf::update() function
stateSample_state;// state struct of the ekf running at the delayed time horizon
stateSample_state{};// state struct of the ekf running at the delayed time horizon
bool_filter_initialised;// true when the EKF sttes and covariances been initialised
bool_earth_rate_initialised;// true when we know the earth rotatin rate (requires GPS)
bool_filter_initialised{false};// true when the EKF sttes and covariances been initialised
bool_earth_rate_initialised{false};// true when we know the earth rotatin rate (requires GPS)
bool_fuse_height;// baro height data should be fused
bool_fuse_pos;// gps position data should be fused
bool_fuse_hor_vel;// gps horizontal velocity measurement should be fused
bool_fuse_vert_vel;// gps vertical velocity measurement should be fused
bool_fuse_height{false};// baro height data should be fused
bool_fuse_pos{false};// gps position data should be fused
bool_fuse_hor_vel{false};// gps horizontal velocity measurement should be fused
bool_fuse_vert_vel{false};// gps vertical velocity measurement should be fused
// booleans true when fresh sensor data is available at the fusion time horizon
bool_gps_data_ready;
bool_mag_data_ready;
bool_baro_data_ready;
bool_range_data_ready;
bool_flow_data_ready;
bool_ev_data_ready;
bool_tas_data_ready;
uint64_t_time_last_fake_gps;// last time in us at which we have faked gps measurement for static mode
uint64_t_time_last_pos_fuse;// time the last fusion of horizontal position measurements was performed (usec)
uint64_t_time_last_vel_fuse;// time the last fusion of velocity measurements was performed (usec)
uint64_t_time_last_hgt_fuse;// time the last fusion of height measurements was performed (usec)
uint64_t_time_last_of_fuse;// time the last fusion of optical flow measurements were performed (usec)
uint64_t_time_last_arsp_fuse;// time the last fusion of airspeed measurements were performed (usec)
uint64_t_time_last_beta_fuse;// time the last fusion of synthetic sideslip measurements were performed (usec)
bool_gps_data_ready{false};
bool_mag_data_ready{false};
bool_baro_data_ready{false};
bool_range_data_ready{false};
bool_flow_data_ready{false};
bool_ev_data_ready{false};
bool_tas_data_ready{false};
uint64_t_time_last_fake_gps{0};// last time in us at which we have faked gps measurement for static mode
uint64_t_time_last_pos_fuse{0};// time the last fusion of horizontal position measurements was performed (usec)
uint64_t_time_last_vel_fuse{0};// time the last fusion of velocity measurements was performed (usec)
uint64_t_time_last_hgt_fuse{0};// time the last fusion of height measurements was performed (usec)
uint64_t_time_last_of_fuse{0};// time the last fusion of optical flow measurements were performed (usec)
uint64_t_time_last_arsp_fuse{0};// time the last fusion of airspeed measurements were performed (usec)
uint64_t_time_last_beta_fuse{0};// time the last fusion of synthetic sideslip measurements were performed (usec)
Vector2f_last_known_posNE;// last known local NE position vector (m)
float_last_disarmed_posD;// vertical position recorded at arming (m)
float_imu_collection_time_adj;// the amount of time the IMU collection needs to be advanced to meet the target set by FILTER_UPDATE_PERIOD_MS (sec)
float_last_disarmed_posD{0.0f};// vertical position recorded at arming (m)
float_imu_collection_time_adj{0.0f};// the amount of time the IMU collection needs to be advanced to meet the target set by FILTER_UPDATE_PERIOD_MS (sec)
uint64_t_time_acc_bias_check;// last time the accel bias check passed (usec)
uint64_t_time_acc_bias_check{0};// last time the accel bias check passed (usec)
Vector3f_earth_rate_NED;// earth rotation vector (NED) in rad/s
matrix::Dcm<float>_R_to_earth;// transformation matrix from body frame to earth frame from last EKF predition
floatP[_k_num_states][_k_num_states]{};// state covariance matrix
floatP[_k_num_states][_k_num_states]{};// state covariance matrix
// NOTE: the EKF uses the reverse sign convention to the flow sensor. EKF assumes positive LOS rate is produced by a RH rotation of the image about the sensor axis.
// copy the optical and gyro measured delta angles
staticconstunsignedFILTER_UPDATE_PERIOD_MS=12;// ekf prediction period in milliseconds - this should ideally be an integer multiple of the IMU time delta
unsigned_min_obs_interval_us;// minimum time interval between observations that will guarantee data is not lost (usec)
unsigned_min_obs_interval_us{0};// minimum time interval between observations that will guarantee data is not lost (usec)
float_dt_imu_avg;// average imu update period in s
float_dt_imu_avg{0.0f};// average imu update period in s
imuSample_imu_sample_delayed;// captures the imu sample on the delayed time horizon
imuSample_imu_sample_delayed{};// captures the imu sample on the delayed time horizon
// measurement samples capturing measurements on the delayed time horizon
magSample_mag_sample_delayed;
baroSample_baro_sample_delayed;
gpsSample_gps_sample_delayed;
rangeSample_range_sample_delayed;
airspeedSample_airspeed_sample_delayed;
flowSample_flow_sample_delayed;
extVisionSample_ev_sample_delayed;
dragSample_drag_sample_delayed;
dragSample_drag_down_sampled;// down sampled drag specific force data (filter prediction rate -> observation rate)
magSample_mag_sample_delayed{};
baroSample_baro_sample_delayed{};
gpsSample_gps_sample_delayed{};
rangeSample_range_sample_delayed{};
airspeedSample_airspeed_sample_delayed{};
flowSample_flow_sample_delayed{};
extVisionSample_ev_sample_delayed{};
dragSample_drag_sample_delayed{};
dragSample_drag_down_sampled{};// down sampled drag specific force data (filter prediction rate -> observation rate)
// Used by the multi-rotor specific drag force fusion
uint8_t_drag_sample_count;// number of drag specific force samples assumulated at the filter prediction rate
float_drag_sample_time_dt;// time integral across all samples used to form _drag_down_sampled (sec)
float_air_density;// air density (kg/m**3)
uint8_t_drag_sample_count{0};// number of drag specific force samples assumulated at the filter prediction rate
float_drag_sample_time_dt{0.0f};// time integral across all samples used to form _drag_down_sampled (sec)
float_air_density{1.225f};// air density (kg/m**3)
outputSample_output_sample_delayed;// filter output on the delayed time horizon
outputSample_output_new;// filter output on the non-delayed time horizon
imuSample_imu_sample_new;// imu sample capturing the newest imu data
outputSample_output_sample_delayed{};// filter output on the delayed time horizon
outputSample_output_new{};// filter output on the non-delayed time horizon
imuSample_imu_sample_new{};// imu sample capturing the newest imu data
Matrix3f_R_to_earth_now;// rotation matrix from body to earth frame at current time
uint64_t_imu_ticks;// counter for imu updates
uint64_t_imu_ticks{0};// counter for imu updates
bool_imu_updated;// true if the ekf should update (completed downsampling process)
bool_initialised;// true if the ekf interface instance (data buffering) is initialized
bool_imu_updated{false};// true if the ekf should update (completed downsampling process)
bool_initialised{false};// true if the ekf interface instance (data buffering) is initialized
bool_NED_origin_initialised;
bool_gps_speed_valid;
float_gps_origin_eph;// horizontal position uncertainty of the GPS origin
float_gps_origin_epv;// vertical position uncertainty of the GPS origin
structmap_projection_reference_s_pos_ref;// Contains WGS-84 position latitude and longitude (radians) of the EKF origin
structmap_projection_reference_s_gps_pos_prev;// Contains WGS-84 position latitude and longitude (radians) of the previous GPS message
float_gps_alt_prev;// height from the previous GPS message (m)
bool_NED_origin_initialised{false};
bool_gps_speed_valid{false};
float_gps_origin_eph{0.0f};// horizontal position uncertainty of the GPS origin
float_gps_origin_epv{0.0f};// vertical position uncertainty of the GPS origin
structmap_projection_reference_s_pos_ref{};// Contains WGS-84 position latitude and longitude (radians) of the EKF origin
structmap_projection_reference_s_gps_pos_prev{};// Contains WGS-84 position latitude and longitude (radians) of the previous GPS message
float_gps_alt_prev{0.0f};// height from the previous GPS message (m)
// innovation consistency check monitoring ratios
float_yaw_test_ratio;// yaw innovation consistency check ratio