00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef LIBSWIFTNAV_DGNSS_MANAGEMENT_H
00014 #define LIBSWIFTNAV_DGNSS_MANAGEMENT_H
00015
00016 #include "amb_kf.h"
00017 #include "sats_management.h"
00018
00019 #define DEFAULT_PHASE_VAR_TEST (9e-4 * 16)
00020 #define DEFAULT_CODE_VAR_TEST (100 * 400)
00021 #define DEFAULT_PHASE_VAR_KF (9e-4 * 16)
00022 #define DEFAULT_CODE_VAR_KF (100 * 400)
00023 #define DEFAULT_AMB_DRIFT_VAR 1e-8
00024 #define DEFAULT_AMB_INIT_VAR 1e8
00025 #define DEFAULT_NEW_INT_VAR 1e10
00026
00027 typedef struct {
00028 double phase_var_test;
00029 double code_var_test;
00030 double phase_var_kf;
00031 double code_var_kf;
00032 double pos_trans_var;
00033 double vel_trans_var;
00034 double int_trans_var;
00035 double amb_drift_var;
00036 double pos_init_var;
00037 double vel_init_var;
00038 double amb_init_var;
00039 double new_int_var;
00040 } dgnss_settings_t;
00041
00042 extern dgnss_settings_t dgnss_settings;
00043
00044 void dgnss_set_settings(double phase_var_test, double code_var_test,
00045 double phase_var_kf, double code_var_kf,
00046 double amb_drift_var, double amb_init_var,
00047 double new_int_var);
00048 void make_measurements(u8 num_diffs, sdiff_t *sdiffs, double *raw_measurements);
00049 void dgnss_init(u8 num_sats, sdiff_t *sdiffs, double reciever_ecef[3]);
00050 void dgnss_update(u8 num_sats, sdiff_t *sdiffs, double reciever_ecef[3]);
00051 void dgnss_rebase_ref(u8 num_sats, sdiff_t *sdiffs, double reciever_ecef[3],
00052 u8 old_prns[MAX_CHANNELS], sdiff_t *corrected_sdiffs);
00053 nkf_t * get_dgnss_nkf(void);
00054 s32 * get_stupid_filter_ints(void);
00055 sats_management_t * get_sats_management(void);
00056
00057 s8 dgnss_iar_resolved(void);
00058 u32 dgnss_iar_num_hyps(void);
00059 u32 dgnss_iar_num_sats(void);
00060 s8 dgnss_iar_get_single_hyp(double *hyp);
00061 void dgnss_reset_iar(void);
00062 void dgnss_init_known_baseline(u8 num_sats, sdiff_t *sdiffs, double receiver_ecef[3], double b[3]);
00063 void dgnss_float_baseline(u8 *num_used, double b[3]);
00064 void dgnss_new_float_baseline(u8 num_sats, sdiff_t *sdiffs, double ref_ecef[3], u8 *num_used, double b[3]);
00065 void dgnss_fixed_baseline(u8 n, sdiff_t *sdiffs, double ref_ecef[3],
00066 u8 *num_used, double b[3]);
00067 s8 dgnss_fixed_baseline2(u8 num_sdiffs, sdiff_t *sdiffs, double ref_ecef[3],
00068 u8 *num_used, double b[3]);
00069 s8 dgnss_low_latency_baseline(u8 num_sdiffs, sdiff_t *sdiffs,
00070 double ref_ecef[3], u8 *num_used, double b[3]);
00071 void measure_amb_kf_b(double reciever_ecef[3],
00072 u8 num_sdiffs, sdiff_t *sdiffs,
00073 double *b);
00074 void measure_b_with_external_ambs(double reciever_ecef[3],
00075 u8 num_sdiffs, sdiff_t *sdiffs,
00076 double *ambs,
00077 double *b);
00078 void measure_iar_b_with_external_ambs(double reciever_ecef[3],
00079 u8 num_sdiffs, sdiff_t *sdiffs,
00080 double *ambs,
00081 double *b);
00082 u8 get_amb_kf_de_and_phase(u8 num_sdiffs, sdiff_t *sdiffs,
00083 double ref_ecef[3],
00084 double *de, double *phase);
00085 u8 get_iar_de_and_phase(u8 num_sdiffs, sdiff_t *sdiffs,
00086 double ref_ecef[3],
00087 double *de, double *phase);
00088 u8 dgnss_iar_pool_contains(double *ambs);
00089 u8 get_amb_kf_mean(double *ambs);
00090 u8 get_amb_kf_cov(double *cov);
00091 u8 get_amb_kf_prns(u8 *prns);
00092 u8 get_amb_test_prns(u8 *prns);
00093 u8 dgnss_iar_MLE_ambs(s32 *ambs);
00094
00095
00096
00097
00098
00099 s8 _dgnss_low_latency_float_baseline(u8 num_sdiffs, sdiff_t *sdiffs,
00100 double ref_ecef[3], u8 *num_used, double b[3]);
00101 s8 _dgnss_low_latency_IAR_baseline(u8 num_sdiffs, sdiff_t *sdiffs,
00102 double ref_ecef[3], u8 *num_used, double b[3]);
00103
00104 #endif