void measure_amb_kf_b(u8 num_sdiffs, sdiff_t *sdiffs, const double receiver_ecef[3], double *b) { DEBUG_ENTRY(); sdiff_t sdiffs_with_ref_first[num_sdiffs]; /* We require the sats updating has already been done with these sdiffs */ gnss_signal_t ref_sid = sats_management.sids[0]; copy_sdiffs_put_ref_first(ref_sid, num_sdiffs, sdiffs, sdiffs_with_ref_first); measure_b( nkf.state_dim, nkf.state_mean, num_sdiffs, sdiffs_with_ref_first, receiver_ecef, b); DEBUG_EXIT(); }
void measure_b_with_external_ambs(u8 state_dim, const double *state_mean, u8 num_sdiffs, sdiff_t *sdiffs, const double receiver_ecef[3], double *b) { DEBUG_ENTRY(); sdiff_t sdiffs_with_ref_first[num_sdiffs]; /* We require the sats updating has already been done with these sdiffs */ u8 ref_prn = sats_management.prns[0]; copy_sdiffs_put_ref_first(ref_prn, num_sdiffs, sdiffs, sdiffs_with_ref_first); measure_b(state_dim, state_mean, num_sdiffs, sdiffs_with_ref_first, receiver_ecef, b); DEBUG_EXIT(); }
void dgnss_rebase_ref(u8 num_sdiffs, sdiff_t *sdiffs, double receiver_ecef[3], gnss_signal_t old_sids[MAX_CHANNELS], sdiff_t *corrected_sdiffs) { (void)receiver_ecef; /* all the ref sat stuff */ s8 sats_management_code = rebase_sats_management(&sats_management, num_sdiffs, sdiffs, corrected_sdiffs); if (sats_management_code == NEW_REF_START_OVER) { log_info("Unable to rebase to new ref, resetting filters and starting over"); dgnss_init(num_sdiffs, sdiffs, receiver_ecef); memcpy(old_sids, sats_management.sids, sats_management.num_sats * sizeof(gnss_signal_t)); if (num_sdiffs >= 1) { copy_sdiffs_put_ref_first(old_sids[0], num_sdiffs, sdiffs, corrected_sdiffs); } /*dgnss_init(num_sdiffs, sdiffs, receiver_ecef); //TODO use current baseline state*/ return; } else if (sats_management_code == NEW_REF) { /* do everything related to changing the reference sat here */ rebase_nkf(&nkf, sats_management.num_sats, &old_sids[0], &sats_management.sids[0]); } }