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) |
Integer ambiguity resolution using bayesian hypothesis testing.
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.
u8 ambiguity_iar_can_solve | ( | ambiguity_test_t * | amb_test | ) |
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.
amb_test | The ambiguity test to perform MLE in. |
ambs | The output MLE hypothesis. |
Definition at line 296 of file ambiguity_test.c.
u32 ambiguity_test_n_hypotheses | ( | ambiguity_test_t * | amb_test | ) |
Returns the number of hypotheses currently in the ambiguity test.
amb_test | The ambiguity test whose number of hypotheses we want. |
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.
amb_test | The test to check against. |
ambs | The ambiguity hypothesis to look for. |
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.
num_dds | The number of DDs in each hypothesis. (Used to initialize amb_check). |
hyp | The hypothesis to be checked against. |
amb_check | Keeps track of which ambs are still unanimous and their values. |
Definition at line 498 of file ambiguity_test.c.
void create_ambiguity_test | ( | ambiguity_test_t * | amb_test | ) |
Definition at line 38 of file ambiguity_test.c.
void destroy_ambiguity_test | ( | ambiguity_test_t * | amb_test | ) |
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().
arg | The accumulator/map/filter information |
elem | The hypothesis to be mapped/filtered/folded against. |
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().
x | The accumulator. Contains the hypothesis and whether it's found. |
elem | The hypothesis being folded against (checked for match). |
Definition at line 226 of file ambiguity_test.c.
A memory pool fold method to find the max likelihood estimate of the ambiguities.
Should be used in memory_pool_fold().
x | The fold accumulator. Contains the MLE and supporting fields. |
elem | The 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.
amb_test | A pointer to the ambiguity_test_t struct to query against. |
hyp_N | A pointer to the array of s32's to represent the output hyp. |
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.
amb_test | The amb_test struct to be updated |
state_dim | The length of the float state/number of DDs. |
float_prns | The list of prns associated with the float DD estimate. |
sdiffs | Not currently used. |
float_mean | The float DD ambiguity estimate. |
float_cov | The float DD ambiguity estimate's covariance. |
DE_mtx | The differenced ECEF unit vectors pointing to the satellite. |
obs_cov | The 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.
amb_test | The local amb_test struct. Must have the current amb_check. |
num_sdiffs | The number of sdiffs passed in. |
sdiffs | The sdiffs from which we make amb_sdiffs. |
ambiguity_dd_measurements | DD measurement vector for the amb_test's sats. |
amb_sdiffs | sdiffs that match the amb_test's sats constructed from the input sdiffs. |
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.
amb_test | The local amb_test struct. Must have a current amb_check. |
num_sdiffs | The number of sdiffs passed in. |
sdiffs | The sdiffs from which we make amb_sdiffs. |
ambiguity_dd_measurements | DD measurement vector for the amb_test's unanimously resolved sats. |
amb_sdiffs | sdiffs that match the amb_test's unanimously resolved sats constructed from the input sdiffs. |
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.
m | The matrix to be printed. |
_r | The number of rows to be printed. |
_c | The number of columns in the matrix. |
Definition at line 94 of file ambiguity_test.c.
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:
m | The covariance matrix to be transformed. |
dim | The 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.
m | The number of rows in the matrix M. |
n | The number of columns in the matrix M and elements of v. |
M | The matrix M to be multiplied. |
v | The 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.
m | The number of rows to be printed in the matrices. |
n | The number of columns in the matrix. |
mat1 | The 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).
m | The number of rows in the matrices. |
n | The number of columns in the matrices. |
mat1 | The matrix to be subtracted from. |
mat2 | The 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.
ref_ecef | The ecef coordinate to pretend we are at to use relative to the sats. |
phase_var | The variance of the carrier phase measurements. |
code_var | The variance of the code pseudorange measurements. |
amb_test | The ambiguity test to update. |
state_dim | The dimension of the float state. |
float_sats | The satellites being represented in the float state. |
sdiffs | The single differenced measurements/sat positions of all sats tracked. |
float_mean | The float estimate of the integer ambiguities. |
float_cov_U | The U in the UDU' decomposition of the covariance of the float estimate. |
float_cov_D | The 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().
x | Points to a hyp_filter_t containing the accumulator and everything needed for the map. |
elem | The hypothesis to be mapAccum'd. |
Definition at line 480 of file ambiguity_test.c.
void update_unanimous_ambiguities | ( | ambiguity_test_t * | amb_test | ) |
Definition at line 560 of file ambiguity_test.c.