66 lines
1.8 KiB
C
66 lines
1.8 KiB
C
#ifndef FUSION_MEASUREMENT_H
|
|
#define FUSION_MEASUREMENT_H
|
|
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
|
|
#include "imu/imu_sample.h"
|
|
|
|
/*
|
|
* Hardware- and solver-neutral messages shared at the GPS/ESKF boundary.
|
|
* timestamp_ticks always belongs to the common local monotonic timebase; GPS
|
|
* week/TOW is metadata and must not drive filter dt.
|
|
*/
|
|
typedef struct {
|
|
uint64_t timestamp_ticks;
|
|
double latitude_deg;
|
|
double longitude_deg;
|
|
double height_m;
|
|
double covariance_enu_m2[3][3];
|
|
double hacc_m;
|
|
double vacc_m;
|
|
double residual_rms_m;
|
|
double chi_square_ratio;
|
|
double velocity_ecef_mps[3];
|
|
double velocity_covariance_ecef_mps2[3][3];
|
|
double speed_mps;
|
|
double velocity_residual_rms_mps;
|
|
unsigned int used_satellites;
|
|
bool solution_valid;
|
|
bool velocity_valid;
|
|
} fusion_gps_measurement_t;
|
|
|
|
/* Timestamped IMU plus the independently supervised platform state consumed
|
|
* by fusion. Drivers publish imu_sample_t and do not decide `vehicle_at_rest`. */
|
|
typedef struct {
|
|
uint64_t timestamp_ticks;
|
|
double accel_mps2[3];
|
|
double gyro_rps[3];
|
|
double temperature_c;
|
|
uint32_t sequence;
|
|
bool vehicle_at_rest;
|
|
} fusion_imu_measurement_t;
|
|
|
|
/* Generic local-navigation measurement consumed by the ESKF coordinator. */
|
|
typedef struct {
|
|
uint64_t timestamp_ticks;
|
|
double position_enu_m[3];
|
|
double covariance_enu_m2[9];
|
|
double source_quality;
|
|
bool source_valid;
|
|
} fusion_position_measurement_t;
|
|
|
|
/*
|
|
* Position and Doppler velocity from one GNSS solve. Keeping them in one
|
|
* message makes the fixed-lag coordinator apply both observations at exactly
|
|
* the captured GPS epoch before replaying newer IMU samples.
|
|
*/
|
|
typedef struct {
|
|
fusion_position_measurement_t position;
|
|
double velocity_enu_mps[3];
|
|
double velocity_covariance_enu_mps2[9];
|
|
bool velocity_valid;
|
|
} fusion_navigation_measurement_t;
|
|
|
|
#endif
|