Ejemplo n.º 1
0
void dgnss_rebase_ref(u8 num_sdiffs, sdiff_t *sdiffs, double reciever_ecef[3], u8 old_prns[MAX_CHANNELS], sdiff_t *corrected_sdiffs)
{
  (void)reciever_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) {
    printf("====== START OVER =======\n"); // TODO WRITE WHAT GOTTA BE DONE, YO
    /*dgnss_init(num_sdiffs, sdiffs, reciever_ecef, dt); //TODO use current baseline state*/
    return;
  }
  else if (sats_management_code == NEW_REF) {
    // do everything related to changing the reference sat here
    rebase_kf(&kf, sats_management.num_sats, &old_prns[0], &sats_management.prns[0]);
    rebase_nkf(&nkf, sats_management.num_sats, &old_prns[0], &sats_management.prns[0]);
  }
}
Ejemplo n.º 2
0
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]);
  }
}