#ifndef FUSION_IMU_QUALITY_H #define FUSION_IMU_QUALITY_H #include #define FUSION_IMU_QUALITY_AXIS_COUNT 3u /* * Hardware-neutral IMU characteristics. The nominal noise fields describe * the sensor/board measurement stream. The process-noise fields are the * deliberately conservative values used by the ESKF and may include timing, * mounting, calibration and temperature uncertainty in addition to white * sensor noise. */ typedef struct { const char* name; double nominal_accel_noise_density_mps2_sqrt_hz[FUSION_IMU_QUALITY_AXIS_COUNT]; double nominal_gyro_noise_density_rps_sqrt_hz[FUSION_IMU_QUALITY_AXIS_COUNT]; double process_accel_noise_density_mps2_sqrt_hz[FUSION_IMU_QUALITY_AXIS_COUNT]; double process_gyro_noise_density_rps_sqrt_hz[FUSION_IMU_QUALITY_AXIS_COUNT]; double accel_bias_random_walk_mps2_sqrt_s[FUSION_IMU_QUALITY_AXIS_COUNT]; double gyro_bias_random_walk_rps_sqrt_s[FUSION_IMU_QUALITY_AXIS_COUNT]; double calibration_accel_std_limit_mps2; double calibration_gyro_std_limit_rps; /* * How far the stationary accelerometer magnitude may sit from gravity * purely because of the part's zero-g offset and sensitivity tolerance. * This is a fixed per-unit property, not motion headroom: * finish_calibration() estimates it as accel bias and hands it to the * ESKF, so admitting it here costs nothing. Sized from the datasheet * zero-g offset; a unit near this limit is worth characterizing. */ double calibration_accel_offset_allowance_mps2; double zero_gyro_measurement_std_rps[FUSION_IMU_QUALITY_AXIS_COUNT]; /* * Rest-detector thresholds. These separate genuine platform motion from * the sensor's own residual noise, so they scale with the part rather than * with the vehicle: a quieter IMU sits below a fixed quiescence limit more * of the time and therefore declares rest more readily. The speed and * dwell thresholds stay in fusion_motion_default_config() because they * describe the platform, not the sensor. */ double stationary_accel_limit_mps2; double stationary_gyro_limit_rps; double moving_accel_threshold_mps2; double moving_gyro_threshold_rps; double moving_jerk_threshold_mps3; } fusion_imu_quality_profile_t; void fusion_imu_quality_default(fusion_imu_quality_profile_t* profile); bool fusion_imu_quality_is_valid(const fusion_imu_quality_profile_t* profile); #endif