snapshot module

Point solution methods using GNSS measurements.

This module contains point solution methods for estimating position at a single GNSS measurement epoch. Position is solved using the Weighted Least Squares algorithm.

snapshot.solve_wls(measurements, weight_type=None, only_bias=False, receiver_state=None, tol=1e-07, max_count=20, sv_rx_time=False, delta_t_decimals=-2)[source]

Runs weighted least squares across each timestep.

Runs weighted least squares across each timestep and adds a new row for the receiver’s position and clock bias.

The option for only_bias allows the user to only calculate the clock bias if the receiver position is already known. Only the bias term in rx_est_m will be updated if only_bias is set to True.

If only_bias is set to True, then the receiver position must also be passed in as the receiver_state.

Parameters:
  • measurements (gnss_lib_py.navdata.navdata.NavData) – Instance of the NavData class which must include at least gps_millis, x_sv_m, y_sv_m, and z_sv_m

  • weight_type (string) – Must either be None or the name of a row in measurements

  • only_bias (bool) – If True, then only the receiver clock bias is estimated. Otherwise, both position and clock bias are estimated.

  • receiver_state (gnss_lib_py.navdata.navdata.NavData) – Only used if only_bias is set to True, see description above. Receiver position in ECEF frame in meters as an instance of the NavData class with at least the following rows: x_rx*_m, y_rx*_m, z_rx*_m, gps_millis.

  • tol (float) – Tolerance used for the convergence check.

  • max_count (int) – Number of maximum iterations before process is aborted and solution returned.

  • sv_rx_time (bool) – Flag that specifies whether the input SV positions are in the ECEF frame of reference corresponding to when the measurements were received. If set to True, the satellite positions are used as is. The default value is False, in which case the ECEF positions are assumed to in the ECEF frame at the time of signal transmission and are converted to the ECEF frame at the time of signal reception, while solving the WLS problem.

  • delta_t_decimals (int) – Decimal places after which times are considered equal.

Returns:

state_estimate – Estimated receiver position in ECEF frame in meters and the estimated receiver clock bias also in meters as an instance of the NavData class with shape (4 x # unique timesteps) and the following rows: gps_millis, x_rx_wls_m, y_rx_wls_m, z_rx_wls_m, b_rx_wls_m, lat_rx_wls_deg, lon_rx_wls_deg, alt_rx_wls_m.

Return type:

gnss_lib_py.navdata.navdata.NavData

snapshot.wls(rx_est_m, pos_sv_m, corr_pr_m, weights=None, only_bias=False, tol=1e-07, max_count=20, sv_rx_time=False)[source]

Weighted least squares solver for GNSS measurements.

The option for only_bias allows the user to only calculate the clock bias if the receiver position is already known. Only the bias term in rx_est_m will be updated if only_bias is set to True.

Parameters:
  • rx_est_m (np.ndarray) – Estimated receiver position in ECEF frame in meters and the estimated receiver clock bias also in meters in an array with shape (4 x 1) and the following order: x_rx_m, y_rx_m, z_rx_m, b_rx_m.

  • pos_sv_m (np.ndarray) – Satellite ECEF positions as an array of shape [# svs x 3] where the columns contain in order x_sv_m, y_sv_m, and z_sv_m.

  • corr_pr_m (np.ndarray) – Corrected pseudoranges for all satellites with shape of [# svs x 1]

  • weights (np.array) – Weights as an array of shape [# svs x 1] where the column is in the same order as pos_sv_m and corr_pr_m

  • only_bias (bool) – If True, then only the receiver clock bias is estimated. Otherwise, both position and clock bias are estimated.

  • tol (float) – Tolerance used for the convergence check.

  • max_count (int) – Number of maximum iterations before process is aborted and solution returned.

  • sv_rx_time (bool) – Flag to indicate if the satellite positions at the time of transmission should be used as is or if they should be transformed to the ECEF frame of reference at the time of reception. For real measurements, use sv_rx_time=False to account for the Earth’s rotation and convert SV positions from the ECEF frame at the time of signal transmission to the ECEF frame at the time of signal reception. If the SV positions should be used as is, set sv_rx_time=True to indicate that the given positions are in the ECEF frame of reference for when the signals are received. By default, sv_rx_time=False.

Returns:

rx_est_m – Estimated receiver position in ECEF frame in meters and the estimated receiver clock bias also in meters in an array with shape (4 x 1) and the following order: x_rx_m, y_rx_m, z_rx_m, b_rx_m.

Return type:

np.ndarray

Notes

This function internally updates the used SV position to account for the time taken for the signal to travel to the Earth from the GNSS satellites. Since the SV and receiver positions are calculated in an ECEF frame of reference, which is moving with the Earth’s rotation, the reference frame is slightly (about 30 m along longitude) different when the signals are received than when the signals were transmitted. Given the receiver’s position is estimated when the signal is received, the SV positions need to be updated to reflect the change in the frame of reference in which their position is calculated.

This update happens after every Gauss-Newton update step and is adapted from [1].

References