Functions for storing and manipulating single difference observations.
#define GPS_L1_LAMBDA (GPS_C / GPS_L1_HZ) |
Definition at line 26 of file single_diff.c.
bool _contains_prn | ( | u8 | len, |
u8 * | prns, | ||
u8 | prn | ||
) |
Definition at line 284 of file single_diff.c.
void almanacs_to_single_diffs | ( | u8 | n, |
almanac_t * | alms, | ||
gps_time_t | timestamp, | ||
sdiff_t * | sdiffs | ||
) |
Convert a list of almanacs to a list of single differences. This only fills the position, velocity and prn.
It's only useful for using functions that need a sdiff_t when you have almanac_t.
Definition at line 228 of file single_diff.c.
s8 copy_sdiffs_put_ref_first | ( | u8 | ref_prn, |
u8 | num_sdiffs, | ||
sdiff_t * | sdiffs, | ||
sdiff_t * | sdiffs_with_ref_first | ||
) |
Definition at line 264 of file single_diff.c.
void double_diff | ( | u8 | n, |
sdiff_t * | sds, | ||
sdiff_t * | dds, | ||
u8 | ref_idx | ||
) |
Definition at line 250 of file single_diff.c.
Definition at line 294 of file single_diff.c.
u8 make_propagated_sdiffs | ( | u8 | n_local, |
navigation_measurement_t * | m_local, | ||
u8 | n_remote, | ||
navigation_measurement_t * | m_remote, | ||
double * | remote_dists, | ||
double | remote_pos_ecef[3], | ||
ephemeris_t * | es, | ||
gps_time_t | t, | ||
sdiff_t * | sds | ||
) |
Propagates remote measurements to a local time and makes sdiffs. When we get two sets of observations that aren't time matched to each other (but are internally time matched within each set), we need to adjust one set of measurements to be our best guess of what it would have been had we measured it at the other set's time. This function does that and differences those measurements from sats present in both sets.
It returns the number of sats common in both.
n_local | The number of measurements taken locally. |
m_local | The measurements taken locally (sorted by prn). |
n_remote | The number of measurements taken remotely. |
m_remote | THe measurements taken remotely (sorted by prn). |
remote_dists | The distances from the remote receiver to each satellite at the time the remote measurements were taken (i-th element of this list must correspond to the i-th element of m_remote). |
remote_pos_ecef | The position of the remote receiver (presumed constant in ecef). |
sds | The single differenced propagated measurements. |
Definition at line 162 of file single_diff.c.
u8 propagate | ( | u8 | n, |
double | ref_ecef[3], | ||
navigation_measurement_t * | m_in_base, | ||
gps_time_t * | t_base, | ||
navigation_measurement_t * | m_in_rover, | ||
gps_time_t * | t_rover, | ||
navigation_measurement_t * | m_out_base | ||
) |
Definition at line 28 of file single_diff.c.
int sdiff_search_prn | ( | const void * | a, |
const void * | b | ||
) |
Definition at line 128 of file single_diff.c.
u8 single_diff | ( | u8 | n_a, |
navigation_measurement_t * | m_a, | ||
u8 | n_b, | ||
navigation_measurement_t * | m_b, | ||
sdiff_t * | sds | ||
) |
Calculate single difference observations. Undifferenced input observations are assumed to be both taken at the same time, `t`.
SNR in the output is the lesser of the SNRs of inputs a and b.
`sat_pos` and `sat_vel` are taken from input a.
n_a | Number of measurements in `m_a` m_a Array of undifferenced observations, sorted by PRN |
n_b | Number of measurements in `m_b` m_new Array of b navigation measurements, sorted by PRN |
sds | Single difference observations |
Definition at line 99 of file single_diff.c.