Defines | Functions | Variables
dgnss_management.c File Reference
#include <string.h>
#include <stdio.h>
#include "amb_kf.h"
#include "stupid_filter.h"
#include "single_diff.h"
#include "dgnss_management.h"
#include "linear_algebra.h"
#include "ambiguity_test.h"
Include dependency graph for dgnss_management.c:

Go to the source code of this file.

Defines

#define DEBUG_DGNSS_MANAGEMENT   0

Functions

s8 _dgnss_low_latency_float_baseline (u8 num_sdiffs, sdiff_t *sdiffs, double ref_ecef[3], u8 *num_used, double b[3])
s8 _dgnss_low_latency_IAR_baseline (u8 num_sdiffs, sdiff_t *sdiffs, double ref_ecef[3], u8 *num_used, double b[3])
void dgnss_fixed_baseline (u8 n, sdiff_t *sdiffs, double ref_ecef[3], u8 *num_used, double b[3])
s8 dgnss_fixed_baseline2 (u8 num_sdiffs, sdiff_t *sdiffs, double ref_ecef[3], u8 *num_used, double b[3])
s8 dgnss_iar_get_single_hyp (double *dhyp)
u8 dgnss_iar_MLE_ambs (s32 *ambs)
u32 dgnss_iar_num_hyps (void)
u32 dgnss_iar_num_sats (void)
u8 dgnss_iar_pool_contains (double *ambs)
s8 dgnss_iar_resolved ()
void dgnss_incorporate_observation (sdiff_t *sdiffs, double *dd_measurements, double *reciever_ecef)
void dgnss_init (u8 num_sats, sdiff_t *sdiffs, double reciever_ecef[3])
void dgnss_init_known_baseline (u8 num_sats, sdiff_t *sdiffs, double receiver_ecef[3], double b[3])
void dgnss_init_known_baseline2 (u8 num_sats, sdiff_t *sdiffs, double receiver_ecef[3], double b[3])
u8 dgnss_intersect_sats (u8 num_old_prns, u8 *old_prns, u8 num_sdiffs, sdiff_t *sdiffs, u8 *ndx_of_intersection_in_old, u8 *ndx_of_intersection_in_new)
s8 dgnss_low_latency_baseline (u8 num_sdiffs, sdiff_t *sdiffs, double ref_ecef[3], u8 *num_used, double b[3])
void dgnss_new_float_baseline (u8 num_sats, sdiff_t *sdiffs, double receiver_ecef[3], u8 *num_used, double b[3])
void dgnss_rebase_ref (u8 num_sdiffs, sdiff_t *sdiffs, double reciever_ecef[3], u8 old_prns[MAX_CHANNELS], sdiff_t *corrected_sdiffs)
void dgnss_reset_iar ()
void dgnss_set_settings (double phase_var_test, double code_var_test, double phase_var_kf, double code_var_kf, double amb_drift_var, double amb_init_var, double new_int_var)
void dgnss_start_over (u8 num_sats, sdiff_t *sdiffs, double reciever_ecef[3])
void dgnss_update (u8 num_sats, sdiff_t *sdiffs, double reciever_ecef[3])
void dgnss_update_sats (u8 num_sdiffs, double reciever_ecef[3], sdiff_t *sdiffs_with_ref_first, double *dd_measurements)
void dvec_printf (double *v, u32 n)
u8 get_amb_kf_cov (double *cov)
u8 get_amb_kf_de_and_phase (u8 num_sdiffs, sdiff_t *sdiffs, double ref_ecef[3], double *de, double *phase)
u8 get_amb_kf_mean (double *ambs)
u8 get_amb_kf_prns (u8 *prns)
u8 get_amb_test_prns (u8 *prns)
u8 get_de_and_phase (sats_management_t *sats_man, u8 num_sdiffs, sdiff_t *sdiffs, double ref_ecef[3], double *de, double *phase)
nkf_tget_dgnss_nkf ()
u8 get_iar_de_and_phase (u8 num_sdiffs, sdiff_t *sdiffs, double ref_ecef[3], double *de, double *phase)
sats_management_tget_sats_management ()
s32get_stupid_filter_ints ()
double l2_dist (double x1[3], double x2[3])
s8 make_float_dd_measurements_and_sdiffs (u8 num_sdiffs, sdiff_t *sdiffs, double *float_dd_measurements, sdiff_t *float_sdiffs)
void make_measurements (u8 num_double_diffs, sdiff_t *sdiffs, double *raw_measurements)
void measure_amb_kf_b (double reciever_ecef[3], u8 num_sdiffs, sdiff_t *sdiffs, double *b)
void measure_b_with_external_ambs (double reciever_ecef[3], u8 num_sdiffs, sdiff_t *sdiffs, double *ambs, double *b)
void measure_iar_b_with_external_ambs (double reciever_ecef[3], u8 num_sdiffs, sdiff_t *sdiffs, double *ambs, double *b)
void normalize (double x[3])
bool prns_match (u8 *old_non_ref_prns, u8 num_non_ref_sdiffs, sdiff_t *non_ref_sdiffs)
void sdiffs_to_prns (u8 n, sdiff_t *sdiffs, u8 *prns)

Variables

ambiguity_test_t ambiguity_test
dgnss_settings_t dgnss_settings
nkf_t nkf
sats_management_t sats_management
stupid_filter_state_t stupid_state

Define Documentation

#define DEBUG_DGNSS_MANAGEMENT   0

Definition at line 22 of file dgnss_management.c.


Function Documentation

s8 _dgnss_low_latency_float_baseline ( u8  num_sdiffs,
sdiff_t sdiffs,
double  ref_ecef[3],
u8 num_used,
double  b[3] 
)

Constructs a low latency float baseline measurement. The sdiffs have no particular reason (other than a general tendency brought by hysteresis) to match up with the float filter's sats, so we have to check if we can solve. For now, unless the sdiffs are a superset of the float sats, we don't solve.

solve whenever the information is there.

since we're now using make_dd_measurements_and_sdiffs outside of the amb_test context, pull it into another file.

pull this function into the KF, once we pull the sats_management struct into the KF too. When we do, do the same for the IAR low lat solution.

Parameters:
num_sdiffsThe number of sdiffs input.
sdiffsThe sdiffs used to measure. (These should be a superset of the float sats).
ref_ecefThe reference position used for solving, and making observation matrices.
num_usedThe number of sats actually used to compute the baseline.
bThe baseline computed.
Returns:
-1 if it can't solve. 0 If it can solve.

Definition at line 532 of file dgnss_management.c.

s8 _dgnss_low_latency_IAR_baseline ( u8  num_sdiffs,
sdiff_t sdiffs,
double  ref_ecef[3],
u8 num_used,
double  b[3] 
)

Constructs a low latency IAR resolved baseline measurement. The sdiffs have no particular reason (other than a general tendency brought by hysteresis) to match up with the IAR sats, so we have to check if we can solve. For now, unless the sdiffs are a superset of the IAR sats, we don't solve.

, solve whenever we can

since we're now using make_dd_measurements_and_sdiffs outside of the amb_test context, pull it into another file.

pull this into the IAR file when we do the same for the float low lat solution.

Parameters:
num_sdiffsThe number of sdiffs input.
sdiffsThe sdiffs used to measure. (These should be a superset of the float sats).
ref_ecefThe reference position used for solving, and making observation matrices.
num_usedThe number of sats actually used to compute the baseline.
bThe baseline computed.
Returns:
-1 if it can't solve. 0 If it can solve.

Definition at line 589 of file dgnss_management.c.

void dgnss_fixed_baseline ( u8  n,
sdiff_t sdiffs,
double  ref_ecef[3],
u8 num_used,
double  b[3] 
)

Definition at line 428 of file dgnss_management.c.

s8 dgnss_fixed_baseline2 ( u8  num_sdiffs,
sdiff_t sdiffs,
double  ref_ecef[3],
u8 num_used,
double  b[3] 
)

Definition at line 450 of file dgnss_management.c.

s8 dgnss_iar_get_single_hyp ( double *  dhyp)

Definition at line 394 of file dgnss_management.c.

u8 dgnss_iar_MLE_ambs ( s32 ambs)

Definition at line 1013 of file dgnss_management.c.

u32 dgnss_iar_num_hyps ( void  )

Definition at line 380 of file dgnss_management.c.

u32 dgnss_iar_num_sats ( void  )

Definition at line 389 of file dgnss_management.c.

u8 dgnss_iar_pool_contains ( double *  ambs)

Definition at line 1008 of file dgnss_management.c.

s8 dgnss_iar_resolved ( void  )

Definition at line 1003 of file dgnss_management.c.

void dgnss_incorporate_observation ( sdiff_t sdiffs,
double *  dd_measurements,
double *  reciever_ecef 
)

Definition at line 261 of file dgnss_management.c.

void dgnss_init ( u8  num_sats,
sdiff_t sdiffs,
double  reciever_ecef[3] 
)

Definition at line 108 of file dgnss_management.c.

void dgnss_init_known_baseline ( u8  num_sats,
sdiff_t sdiffs,
double  receiver_ecef[3],
double  b[3] 
)

Definition at line 679 of file dgnss_management.c.

void dgnss_init_known_baseline2 ( u8  num_sats,
sdiff_t sdiffs,
double  receiver_ecef[3],
double  b[3] 
)

Definition at line 733 of file dgnss_management.c.

u8 dgnss_intersect_sats ( u8  num_old_prns,
u8 old_prns,
u8  num_sdiffs,
sdiff_t sdiffs,
u8 ndx_of_intersection_in_old,
u8 ndx_of_intersection_in_new 
)

Finds the prns of the intersection between old prns and new measurements. It returns the length of the intersection

Definition at line 87 of file dgnss_management.c.

s8 dgnss_low_latency_baseline ( u8  num_sdiffs,
sdiff_t sdiffs,
double  ref_ecef[3],
u8 num_used,
double  b[3] 
)

Finds the baseline using low latency sdiffs. The low latency sdiffs are not guaranteed to match up with either the amb_test's or the float sdiffs, and thus care must be taken to transform them accordingly and check their availability in those sat sets.

Parameters:
num_sdiffsThe number of low-latency sdiffs provided.
sdiffsThe low-latency sdiffs.
ref_ecefThe referece position for the baseline. (TODO is this the local or remote receiver position?)
num_usedOutput number of sdiffs actually used in the baseline estimate.
bOutput baseline.
Returns:
1 if we are using an IAR resolved baseline. 2 if we are using a float baseline. -1 if we can't give a baseline.

Definition at line 643 of file dgnss_management.c.

void dgnss_new_float_baseline ( u8  num_sats,
sdiff_t sdiffs,
double  receiver_ecef[3],
u8 num_used,
double  b[3] 
)

Definition at line 405 of file dgnss_management.c.

void dgnss_rebase_ref ( u8  num_sdiffs,
sdiff_t sdiffs,
double  reciever_ecef[3],
u8  old_prns[MAX_CHANNELS],
sdiff_t corrected_sdiffs 
)

Definition at line 174 of file dgnss_management.c.

void dgnss_reset_iar ( void  )

Definition at line 673 of file dgnss_management.c.

void dgnss_set_settings ( double  phase_var_test,
double  code_var_test,
double  phase_var_kf,
double  code_var_kf,
double  amb_drift_var,
double  amb_init_var,
double  new_int_var 
)

Definition at line 39 of file dgnss_management.c.

void dgnss_start_over ( u8  num_sats,
sdiff_t sdiffs,
double  reciever_ecef[3] 
)

Definition at line 141 of file dgnss_management.c.

void dgnss_update ( u8  num_sats,
sdiff_t sdiffs,
double  reciever_ecef[3] 
)

Definition at line 295 of file dgnss_management.c.

void dgnss_update_sats ( u8  num_sdiffs,
double  reciever_ecef[3],
sdiff_t sdiffs_with_ref_first,
double *  dd_measurements 
)

Definition at line 203 of file dgnss_management.c.

void dvec_printf ( double *  v,
u32  n 
)

Definition at line 289 of file dgnss_management.c.

u8 get_amb_kf_cov ( double *  cov)

Definition at line 984 of file dgnss_management.c.

u8 get_amb_kf_de_and_phase ( u8  num_sdiffs,
sdiff_t sdiffs,
double  ref_ecef[3],
double *  de,
double *  phase 
)

Definition at line 957 of file dgnss_management.c.

u8 get_amb_kf_mean ( double *  ambs)

Definition at line 977 of file dgnss_management.c.

u8 get_amb_kf_prns ( u8 prns)

Definition at line 991 of file dgnss_management.c.

u8 get_amb_test_prns ( u8 prns)

Definition at line 997 of file dgnss_management.c.

u8 get_de_and_phase ( sats_management_t sats_man,
u8  num_sdiffs,
sdiff_t sdiffs,
double  ref_ecef[3],
double *  de,
double *  phase 
)

Definition at line 909 of file dgnss_management.c.

nkf_t* get_dgnss_nkf ( void  )

Definition at line 1019 of file dgnss_management.c.

u8 get_iar_de_and_phase ( u8  num_sdiffs,
sdiff_t sdiffs,
double  ref_ecef[3],
double *  de,
double *  phase 
)

Definition at line 967 of file dgnss_management.c.

Definition at line 1029 of file dgnss_management.c.

Definition at line 1024 of file dgnss_management.c.

double l2_dist ( double  x1[3],
double  x2[3] 
)

Definition at line 792 of file dgnss_management.c.

s8 make_float_dd_measurements_and_sdiffs ( u8  num_sdiffs,
sdiff_t sdiffs,
double *  float_dd_measurements,
sdiff_t float_sdiffs 
)

Makes DD measurement vector and sdiffs to match KF If given a set of sdiffs which is a superset of the KF's sdiffs, this function finds the subset of sdiffs matching the KF sats, and outputs it with the reference first.

since we're now using make_dd_measurements_and_sdiffs outside of the amb_test context, pull it into another file.

Returns:
0 if input sdiffs are superset of KF sats. -1 otherwise.

Definition at line 493 of file dgnss_management.c.

void make_measurements ( u8  num_double_diffs,
sdiff_t sdiffs,
double *  raw_measurements 
)

Definition at line 53 of file dgnss_management.c.

void measure_amb_kf_b ( double  reciever_ecef[3],
u8  num_sdiffs,
sdiff_t sdiffs,
double *  b 
)

Definition at line 810 of file dgnss_management.c.

void measure_b_with_external_ambs ( double  reciever_ecef[3],
u8  num_sdiffs,
sdiff_t sdiffs,
double *  ambs,
double *  b 
)

Definition at line 844 of file dgnss_management.c.

void measure_iar_b_with_external_ambs ( double  reciever_ecef[3],
u8  num_sdiffs,
sdiff_t sdiffs,
double *  ambs,
double *  b 
)

Definition at line 878 of file dgnss_management.c.

void normalize ( double  x[3])

Definition at line 802 of file dgnss_management.c.

bool prns_match ( u8 old_non_ref_prns,
u8  num_non_ref_sdiffs,
sdiff_t non_ref_sdiffs 
)

Definition at line 69 of file dgnss_management.c.

void sdiffs_to_prns ( u8  n,
sdiff_t sdiffs,
u8 prns 
)

Definition at line 196 of file dgnss_management.c.


Variable Documentation

Definition at line 27 of file dgnss_management.c.

Initial value:
 {
  .phase_var_test = DEFAULT_PHASE_VAR_TEST,
  .code_var_test = DEFAULT_CODE_VAR_TEST,
  .phase_var_kf = DEFAULT_PHASE_VAR_KF,
  .code_var_kf = DEFAULT_CODE_VAR_KF,
  .amb_drift_var = DEFAULT_AMB_DRIFT_VAR,
  .amb_init_var = DEFAULT_AMB_INIT_VAR,
  .new_int_var = DEFAULT_NEW_INT_VAR,
}

Definition at line 29 of file dgnss_management.c.

Definition at line 24 of file dgnss_management.c.

Definition at line 26 of file dgnss_management.c.

Definition at line 25 of file dgnss_management.c.



swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:50