Snapshot Localization Algorithms

These tutorials demonstrate the snapshot localization algorithms available in gnss_lib_py.

Weighted Least Squares

[1]:
import gnss_lib_py as glp
[2]:
# load Android Google Challenge data
glp.make_dir("../data")
!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/google_decimeter_2021/Pixel4XL_derived.csv --quiet -nc -O "../data/Pixel4XL_derived.csv"
derived_data = glp.AndroidDerived2021("../data/Pixel4XL_derived.csv", remove_timing_outliers=False)

Solve for the Weighted Least Squares position estimate simply by passing the measurement data.

When obtaining WLS estimates for real measurements, the rotation of the Earth between the signal transmission and reception has to be accounted for. solve_wls accounts for this by default and rotates the given SV positions into the ECEF frame of reference when the signals were received rather using the ECEF frame of reference of when the signals were transmitted.

If you assume that the satellite positions are given in the ECEF frame of reference when the signals were received (and not transmitted), set the parameter sv_rx_time = True in the function call.

[3]:
state_wls = glp.solve_wls(derived_data)
# When assuming that SV positions are given in the ECEF frame when signals are received use
# state_wls = glp.solve_wls(derived_data, sv_rx_time=True)

Plot the ECEF x and ECEF y computed position estimate of the receiver

[4]:
glp.plot_map(state_wls)

Extended Kalman Filter

[5]:
import gnss_lib_py as glp
[6]:
# load Android Google Challenge data
glp.make_dir("../data")
!wget https://raw.githubusercontent.com/Stanford-NavLab/gnss_lib_py/main/data/unit_test/google_decimeter_2021/Pixel4XL_derived.csv --quiet -nc -O "../data/Pixel4XL_derived.csv"
derived_data = glp.AndroidDerived2021("../data/Pixel4XL_derived.csv", remove_timing_outliers=False)

Solve for the extended Kalman filter position estimate simply by passing the measurement data.

[7]:
state_ekf = glp.solve_gnss_ekf(derived_data)

Plot the ECEF x and ECEF y computed position estimate of the receiver

[8]:
glp.plot_map(state_ekf)