Classes | Functions
Integer Ambiguity Resolution

Classes

struct  fold_contains_t
struct  fold_mle_t
struct  generate_hypothesis_state_t
struct  hyp_filter_t
struct  intersection_ndxs_t
struct  rebase_prns_t
struct  recorrelation_params_t

Functions

static void _check_unanimous (void *arg, element_t *elem)
void add_sats (ambiguity_test_t *amb_test, u8 ref_prn, u32 num_added_dds, u8 *added_prns, s32 *lower_bounds, s32 *upper_bounds, s32 *Z_inv)
u8 ambiguity_iar_can_solve (ambiguity_test_t *amb_test)
u8 ambiguity_sat_inclusion (ambiguity_test_t *amb_test, u8 num_dds_in_intersection, sats_management_t *float_sats, double *float_mean, double *float_cov_U, double *float_cov_D)
u8 ambiguity_sat_projection (ambiguity_test_t *amb_test, u8 num_dds_in_intersection, u8 *dd_intersection_ndxs)
void ambiguity_test_MLE_ambs (ambiguity_test_t *amb_test, s32 *ambs)
u32 ambiguity_test_n_hypotheses (ambiguity_test_t *amb_test)
u8 ambiguity_test_pool_contains (ambiguity_test_t *amb_test, double *ambs)
u8 ambiguity_update_reference (ambiguity_test_t *amb_test, u8 num_sdiffs, sdiff_t *sdiffs, sdiff_t *sdiffs_with_ref_first)
u8 ambiguity_update_sats (ambiguity_test_t *amb_test, u8 num_sdiffs, sdiff_t *sdiffs, sats_management_t *float_sats, double *float_mean, double *float_cov_U, double *float_cov_D)
void assign_r_mean (residual_mtxs_t *res_mtxs, u8 num_dds, double *hypothesis, double *r_mean)
void assign_r_vec (residual_mtxs_t *res_mtxs, u8 num_dds, double *dd_measurements, double *r_vec)
void assign_residual_covariance_inverse (u8 num_dds, double *obs_cov, double *q, double *r_cov_inv)
void check_unanimous_ambs (u8 num_dds, hypothesis_t *hyp, unanimous_amb_check_t *amb_check)
void create_ambiguity_test (ambiguity_test_t *amb_test)
void destroy_ambiguity_test (ambiguity_test_t *amb_test)
s8 determine_sats_addition (ambiguity_test_t *amb_test, double *float_N_cov, u8 num_float_dds, double *float_N_mean, s32 *lower_bounds, s32 *upper_bounds, u8 *num_dds_to_add, s32 *Z_inv)
s8 filter_all (void *arg, element_t *elem)
s8 filter_and_renormalize (void *arg, element_t *elem)
u8 find_indices_of_intersection_sats (ambiguity_test_t *amb_test, u8 num_sdiffs, sdiff_t *sdiffs_with_ref_first, u8 *intersection_ndxs)
u32 float_to_decor (ambiguity_test_t *amb_test, double *addible_float_cov, u8 num_addible_dds, double *addible_float_mean, u8 num_dds_to_add, s32 *lower_bounds, s32 *upper_bounds, double *Z)
void fold_contains (void *x, element_t *elem)
void fold_mle (void *x, element_t *elem)
s8 generate_next_hypothesis (void *x_, u32 n)
double get_quadratic_term (residual_mtxs_t *res_mtxs, u8 num_dds, double *hypothesis, double *r_vec)
s8 get_single_hypothesis (ambiguity_test_t *amb_test, s32 *hyp_N)
void hypothesis_prod (element_t *new_, void *x_, u32 n, element_t *elem_)
void init_ambiguity_test (ambiguity_test_t *amb_test, u8 state_dim, u8 *float_prns, sdiff_t *sdiffs, double *float_mean, double *float_cov, double *DE_mtx, double *obs_cov)
void init_residual_matrices (residual_mtxs_t *res_mtxs, u8 num_dds, double *DE_mtx, double *obs_cov)
bool is_prn_set (u8 len, u8 *prns)
s8 make_ambiguity_dd_measurements_and_sdiffs (ambiguity_test_t *amb_test, u8 num_sdiffs, sdiff_t *sdiffs, double *ambiguity_dd_measurements, sdiff_t *amb_sdiffs)
s8 make_ambiguity_resolved_dd_measurements_and_sdiffs (ambiguity_test_t *amb_test, u8 num_sdiffs, sdiff_t *sdiffs, double *ambiguity_dd_measurements, sdiff_t *amb_sdiffs)
s8 make_dd_measurements_and_sdiffs (u8 ref_prn, u8 *non_ref_prns, u8 num_dds, u8 num_sdiffs, sdiff_t *sdiffs, double *ambiguity_dd_measurements, sdiff_t *amb_sdiffs)
void print_double_mtx (double *m, u32 _r, u32 _c)
void print_hyp (void *arg, element_t *elem)
void print_pearson_mtx (double *m, u32 dim)
void print_s32_gemv (u32 m, u32 n, s32 *M, s32 *v)
void print_s32_mtx (u32 m, u32 n, s32 *mat)
void print_s32_mtx_diff (u32 m, u32 n, s32 *mat1, s32 *mat2)
void projection_aggregator (element_t *new_, void *x_, u32 n, element_t *elem_)
s32 projection_comparator (void *arg, element_t *a, element_t *b)
void rebase_hypothesis (void *arg, element_t *elem)
void recorrelate_added_sats (void *arg, element_t *elem_)
void reset_ambiguity_test (ambiguity_test_t *amb_test)
s8 sats_match (ambiguity_test_t *amb_test, u8 num_sdiffs, sdiff_t *sdiffs)
void test_ambiguities (ambiguity_test_t *amb_test, double *dd_measurements)
void update_ambiguity_test (double ref_ecef[3], double phase_var, double code_var, ambiguity_test_t *amb_test, u8 state_dim, sdiff_t *sdiffs, u8 changed_sats)
void update_and_get_max_ll (void *x_, element_t *elem)
void update_unanimous_ambiguities (ambiguity_test_t *amb_test)

Detailed Description

Integer ambiguity resolution using bayesian hypothesis testing.


Function Documentation

static void _check_unanimous ( void *  arg,
element_t elem 
) [static]

Definition at line 552 of file ambiguity_test.c.

void add_sats ( ambiguity_test_t amb_test,
u8  ref_prn,
u32  num_added_dds,
u8 added_prns,
s32 lower_bounds,
s32 upper_bounds,
s32 Z_inv 
)

Definition at line 1525 of file ambiguity_test.c.

Definition at line 614 of file ambiguity_test.c.

u8 ambiguity_sat_inclusion ( ambiguity_test_t amb_test,
u8  num_dds_in_intersection,
sats_management_t float_sats,
double *  float_mean,
double *  float_cov_U,
double *  float_cov_D 
)

Definition at line 1049 of file ambiguity_test.c.

u8 ambiguity_sat_projection ( ambiguity_test_t amb_test,
u8  num_dds_in_intersection,
u8 dd_intersection_ndxs 
)

Definition at line 1011 of file ambiguity_test.c.

void ambiguity_test_MLE_ambs ( ambiguity_test_t amb_test,
s32 ambs 
)

Performs max likelihood estimation on an ambiguity test.

Assuming an ambiguity test already has hypotheses, finds the MLE hypothesis. WARNING: Does not handle the case where the test is not populated.

Parameters:
amb_testThe ambiguity test to perform MLE in.
ambsThe output MLE hypothesis.

Definition at line 296 of file ambiguity_test.c.

Returns the number of hypotheses currently in the ambiguity test.

Parameters:
amb_testThe ambiguity test whose number of hypotheses we want.
Returns:
The number of hypotheses currently in the ambiguity test.

Definition at line 454 of file ambiguity_test.c.

u8 ambiguity_test_pool_contains ( ambiguity_test_t amb_test,
double *  ambs 
)

Tests whether an ambiguity test has a particular hypothesis.

Parameters:
amb_testThe test to check against.
ambsThe ambiguity hypothesis to look for.
Returns:
Whether or not the pool contains ambs.

Definition at line 247 of file ambiguity_test.c.

u8 ambiguity_update_reference ( ambiguity_test_t amb_test,
u8  num_sdiffs,
sdiff_t sdiffs,
sdiff_t sdiffs_with_ref_first 
)

Definition at line 929 of file ambiguity_test.c.

u8 ambiguity_update_sats ( ambiguity_test_t amb_test,
u8  num_sdiffs,
sdiff_t sdiffs,
sats_management_t float_sats,
double *  float_mean,
double *  float_cov_U,
double *  float_cov_D 
)

Definition at line 1275 of file ambiguity_test.c.

void assign_r_mean ( residual_mtxs_t res_mtxs,
u8  num_dds,
double *  hypothesis,
double *  r_mean 
)

Definition at line 1746 of file ambiguity_test.c.

void assign_r_vec ( residual_mtxs_t res_mtxs,
u8  num_dds,
double *  dd_measurements,
double *  r_vec 
)

Definition at line 1734 of file ambiguity_test.c.

void assign_residual_covariance_inverse ( u8  num_dds,
double *  obs_cov,
double *  q,
double *  r_cov_inv 
)

Definition at line 1678 of file ambiguity_test.c.

void check_unanimous_ambs ( u8  num_dds,
hypothesis_t hyp,
unanimous_amb_check_t amb_check 
)

Keeps track of which integer ambiguities are uninimously agreed upon in the pool.

Parameters:
num_ddsThe number of DDs in each hypothesis. (Used to initialize amb_check).
hypThe hypothesis to be checked against.
amb_checkKeeps track of which ambs are still unanimous and their values.

Definition at line 498 of file ambiguity_test.c.

Definition at line 38 of file ambiguity_test.c.

Definition at line 79 of file ambiguity_test.c.

s8 determine_sats_addition ( ambiguity_test_t amb_test,
double *  float_N_cov,
u8  num_float_dds,
double *  float_N_mean,
s32 lower_bounds,
s32 upper_bounds,
u8 num_dds_to_add,
s32 Z_inv 
)

Definition at line 1219 of file ambiguity_test.c.

s8 filter_all ( void *  arg,
element_t elem 
)

A memory pool filter for clearing out all elements of a pool.

Definition at line 50 of file ambiguity_test.c.

s8 filter_and_renormalize ( void *  arg,
element_t elem 
)

A combination fold/map/filter to renormalize the log likelihoods and remove unlikely hyps.

The log likelihood of the hypotheses are filtered against a threshold. Those hypotheses that make the cut are (1) normalized such that the MLE has value 0, making them logs of the probability ratio against the MLE hyp, and (2) checked to see if any of their integer ambiguities are unanimous amongst all hypotheses in the test pool.

The thresholding is done before the normalization for both numerical stability, and so that hypotheses which are just REALLY BAD are removed, even if they are the best we have. This is a kinda arbitrary choice of how to do things. Maybe we should see if it has practical implications?

This function is used by memory_pool_filter().

Parameters:
argThe accumulator/map/filter information
elemThe hypothesis to be mapped/filtered/folded against.
Returns:
Whether or not this hypothesis made the cut.

Definition at line 542 of file ambiguity_test.c.

u8 find_indices_of_intersection_sats ( ambiguity_test_t amb_test,
u8  num_sdiffs,
sdiff_t sdiffs_with_ref_first,
u8 intersection_ndxs 
)

Definition at line 1324 of file ambiguity_test.c.

u32 float_to_decor ( ambiguity_test_t amb_test,
double *  addible_float_cov,
u8  num_addible_dds,
double *  addible_float_mean,
u8  num_dds_to_add,
s32 lower_bounds,
s32 upper_bounds,
double *  Z 
)

Definition at line 1159 of file ambiguity_test.c.

void fold_contains ( void *  x,
element_t elem 
)

A memory pool fold method to check if a hypothesis is in the pool.

Should be used in memory_pool_fold().

Parameters:
xThe accumulator. Contains the hypothesis and whether it's found.
elemThe hypothesis being folded against (checked for match).

Definition at line 226 of file ambiguity_test.c.

void fold_mle ( void *  x,
element_t elem 
)

A memory pool fold method to find the max likelihood estimate of the ambiguities.

Should be used in memory_pool_fold().

Parameters:
xThe fold accumulator. Contains the MLE and supporting fields.
elemThe hypothesis to fold.

Definition at line 277 of file ambiguity_test.c.

s8 generate_next_hypothesis ( void *  x_,
u32  n 
)

Definition at line 1390 of file ambiguity_test.c.

double get_quadratic_term ( residual_mtxs_t res_mtxs,
u8  num_dds,
double *  hypothesis,
double *  r_vec 
)

Definition at line 1756 of file ambiguity_test.c.

s8 get_single_hypothesis ( ambiguity_test_t amb_test,
s32 hyp_N 
)

Gets the hypothesis out of an ambiguity test struct, if there is only one.

Given an ambiguity_test_t, if that test has only one hypothesis allocated, copies it to the hyp_N and returns 0. Otherwise, returns -1.

Parameters:
amb_testA pointer to the ambiguity_test_t struct to query against.
hyp_NA pointer to the array of s32's to represent the output hyp.
Returns:
0 iff there only one hypothesis in the pool, -1 otherwise.

Definition at line 199 of file ambiguity_test.c.

void hypothesis_prod ( element_t new_,
void *  x_,
u32  n,
element_t elem_ 
)

Definition at line 1422 of file ambiguity_test.c.

void init_ambiguity_test ( ambiguity_test_t amb_test,
u8  state_dim,
u8 float_prns,
sdiff_t sdiffs,
double *  float_mean,
double *  float_cov,
double *  DE_mtx,
double *  obs_cov 
)

Starts a hypothesis test for integer ambiguity resolution (IAR).

Initializes an IAR test.

Adds an empty element the ambiguity test pool, then adds hypotheses for various satellites if they fit.

Assumes that the IAR hypothesis pool is empty. Assumes that the dimension of the float state is the number of DDs.

Parameters:
amb_testThe amb_test struct to be updated
state_dimThe length of the float state/number of DDs.
float_prnsThe list of prns associated with the float DD estimate.
sdiffsNot currently used.
float_meanThe float DD ambiguity estimate.
float_covThe float DD ambiguity estimate's covariance.
DE_mtxThe differenced ECEF unit vectors pointing to the satellite.
obs_covThe observation covariance matrix of the phase.

Definition at line 324 of file ambiguity_test.c.

void init_residual_matrices ( residual_mtxs_t res_mtxs,
u8  num_dds,
double *  DE_mtx,
double *  obs_cov 
)

Definition at line 1605 of file ambiguity_test.c.

bool is_prn_set ( u8  len,
u8 prns 
)

Definition at line 620 of file ambiguity_test.c.

s8 make_ambiguity_dd_measurements_and_sdiffs ( ambiguity_test_t amb_test,
u8  num_sdiffs,
sdiff_t sdiffs,
double *  ambiguity_dd_measurements,
sdiff_t amb_sdiffs 
)

Make the DD measurements and sdiffs that correspond to the DDs in amb_test. This will make a set of sdiffs and DD measurements that correspond to the amb_test's sats.

Parameters:
amb_testThe local amb_test struct. Must have the current amb_check.
num_sdiffsThe number of sdiffs passed in.
sdiffsThe sdiffs from which we make amb_sdiffs.
ambiguity_dd_measurementsDD measurement vector for the amb_test's sats.
amb_sdiffssdiffs that match the amb_test's sats constructed from the input sdiffs.
Returns:
error code. see make_dd_measurements_and_sdiffs docstring.

Definition at line 827 of file ambiguity_test.c.

s8 make_ambiguity_resolved_dd_measurements_and_sdiffs ( ambiguity_test_t amb_test,
u8  num_sdiffs,
sdiff_t sdiffs,
double *  ambiguity_dd_measurements,
sdiff_t amb_sdiffs 
)

Make the DD measurements and sdiffs that correspond to the resolved DDs in amb_test. Assuming that amb_test has not been modified since the last check to see whether it can resolve a fixed position (that is, amb_test->amb_check is up to date, this will make a set of sdiffs and DD measurements that correspond to the resolved sats.

Returns 0 if the input sdiff sats are a superset of the resolved IAR sats. Returns -1 otherwise.

Parameters:
amb_testThe local amb_test struct. Must have a current amb_check.
num_sdiffsThe number of sdiffs passed in.
sdiffsThe sdiffs from which we make amb_sdiffs.
ambiguity_dd_measurementsDD measurement vector for the amb_test's unanimously resolved sats.
amb_sdiffssdiffs that match the amb_test's unanimously resolved sats constructed from the input sdiffs.
Returns:
error code; see make_dd_measurements_and_sdiffs docstring.

Definition at line 778 of file ambiguity_test.c.

s8 make_dd_measurements_and_sdiffs ( u8  ref_prn,
u8 non_ref_prns,
u8  num_dds,
u8  num_sdiffs,
sdiff_t sdiffs,
double *  ambiguity_dd_measurements,
sdiff_t amb_sdiffs 
)

Definition at line 658 of file ambiguity_test.c.

void print_double_mtx ( double *  m,
u32  _r,
u32  _c 
)

Prints a matrix of doubles.

Used primarily for printing matrices in a gdb session. Assumes row-major (C-style) storage.

Parameters:
mThe matrix to be printed.
_rThe number of rows to be printed.
_cThe number of columns in the matrix.

Definition at line 94 of file ambiguity_test.c.

void print_hyp ( void *  arg,
element_t elem 
)

Definition at line 1513 of file ambiguity_test.c.

void print_pearson_mtx ( double *  m,
u32  dim 
)

Prints the matrix of Pearson correlation coefficients of a covariance matrix.

Takes in a double valued covariance matrix and prints the pearson correlation coefficients of each pair of variables:

\[ \rho_{ij} = \frac{cov_{ij}}{\sigma_i \sigma_j} \]

Parameters:
mThe covariance matrix to be transformed.
dimThe dimension of the covariance matrix.

Definition at line 116 of file ambiguity_test.c.

void print_s32_gemv ( u32  m,
u32  n,
s32 M,
s32 v 
)

Prints the result of a matrix-vector product of s32's. Given a matrix M and vector v of s32's, prints the result of M*v.

Parameters:
mThe number of rows in the matrix M.
nThe number of columns in the matrix M and elements of v.
MThe matrix M to be multiplied.
vThe vector v to be multiplied.

Definition at line 172 of file ambiguity_test.c.

void print_s32_mtx ( u32  m,
u32  n,
s32 mat 
)

Prints a s32 valued matrix.

Parameters:
mThe number of rows to be printed in the matrices.
nThe number of columns in the matrix.
mat1The matrix to be printed.

Definition at line 153 of file ambiguity_test.c.

void print_s32_mtx_diff ( u32  m,
u32  n,
s32 mat1,
s32 mat2 
)

Prints the difference between two s32 valued matrices.

Given two s32 valued matrices of the same shape, prints their difference (first matrix minus second).

Parameters:
mThe number of rows in the matrices.
nThe number of columns in the matrices.
mat1The matrix to be subtracted from.
mat2The matrix to be subtracted.

Definition at line 136 of file ambiguity_test.c.

void projection_aggregator ( element_t new_,
void *  x_,
u32  n,
element_t elem_ 
)

Definition at line 991 of file ambiguity_test.c.

s32 projection_comparator ( void *  arg,
element_t a,
element_t b 
)

Definition at line 965 of file ambiguity_test.c.

void rebase_hypothesis ( void *  arg,
element_t elem 
)

Definition at line 901 of file ambiguity_test.c.

void recorrelate_added_sats ( void *  arg,
element_t elem_ 
)

Definition at line 1493 of file ambiguity_test.c.

void reset_ambiguity_test ( ambiguity_test_t amb_test)

Definition at line 57 of file ambiguity_test.c.

s8 sats_match ( ambiguity_test_t amb_test,
u8  num_sdiffs,
sdiff_t sdiffs 
)

Definition at line 846 of file ambiguity_test.c.

void test_ambiguities ( ambiguity_test_t amb_test,
double *  dd_measurements 
)

Definition at line 578 of file ambiguity_test.c.

void update_ambiguity_test ( double  ref_ecef[3],
double  phase_var,
double  code_var,
ambiguity_test_t amb_test,
u8  state_dim,
sdiff_t sdiffs,
u8  changed_sats 
)

Updates the IAR process with new measurements.

Updates the satellites being tested, adding and removing hypotheses as needed.

Assumes that the float estimates include all of the sats in the sdiffs. Assumes that the dimension of the float estimates is one less than the number of sats. Assumes that the sdiffs are arranged entirely in increasing order by PRN.

Parameters:
ref_ecefThe ecef coordinate to pretend we are at to use relative to the sats.
phase_varThe variance of the carrier phase measurements.
code_varThe variance of the code pseudorange measurements.
amb_testThe ambiguity test to update.
state_dimThe dimension of the float state.
float_satsThe satellites being represented in the float state.
sdiffsThe single differenced measurements/sat positions of all sats tracked.
float_meanThe float estimate of the integer ambiguities.
float_cov_UThe U in the UDU' decomposition of the covariance of the float estimate.
float_cov_DThe D in the UDU' decomposition of the covariance of the float estimate.

INVALIDATES unanimous ambiguities

Definition at line 385 of file ambiguity_test.c.

void update_and_get_max_ll ( void *  x_,
element_t elem 
)

A mapAccum styled function to update the hypothesis log-likelihoods and find the greatest LL. Simultaneously performs a map, doing a Bayesian update of the log likelihoods of each hypothesis, while performing a fold on those updated log likelihoods to find the likelihood of the MLE hypothesis.

To be given to memory_pool_fold().

Parameters:
xPoints to a hyp_filter_t containing the accumulator and everything needed for the map.
elemThe hypothesis to be mapAccum'd.

Definition at line 480 of file ambiguity_test.c.

Definition at line 560 of file ambiguity_test.c.



swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:57:01