Skip to content

Commit 5bad500

Browse files
committed
Minor fixes and doc builds
1 parent a4fa69c commit 5bad500

3 files changed

Lines changed: 53 additions & 9 deletions

File tree

gnss_lib_py/algorithms/snapshot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,11 @@ def wls(rx_est_m, pos_sv_m, corr_pr_m, weights = None,
218218
frame of reference in which their position is calculated.
219219
220220
This update happens after every Gauss-Newton update step and is
221-
adapted from [1]__.
221+
adapted from [1]_.
222222
223223
References
224224
----------
225-
.. [1] https://github.com/google/gps-measurement-tools/blob/master/opensource/FlightTimeCorrection.m
225+
.. [1] https://github.com/google/gps-measurement-tools/blob/master/opensource/FlightTimeCorrection.m
226226
227227
"""
228228

gnss_lib_py/utils/sim_gnss.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,10 @@ def _find_delxyz_range(sv_posvel, pos, satellites):
316316
pos = np.reshape(pos, [1, 3])
317317
if np.size(pos)!=3:
318318
raise ValueError('Position is not in XYZ')
319-
if isinstance(sv_posvel, NavData):
320-
_, sv_pos, _ = _extract_pos_vel_arr(sv_posvel)
321-
else:
319+
if isinstance(sv_posvel, np.ndarray):
322320
sv_pos = sv_posvel[:, :3]
321+
else:
322+
_, sv_pos, _ = _extract_pos_vel_arr(sv_posvel)
323323
del_pos = sv_pos - np.tile(np.reshape(pos, [-1, 3]), (satellites, 1))
324324
true_range = np.linalg.norm(del_pos, axis=1)
325325
return del_pos, true_range

notebooks/tutorials/algorithms.ipynb

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
"id": "3bc6b5dd",
3636
"metadata": {},
3737
"source": [
38-
"Solve for the Weighted Least Squares position estimate simply by passing the measurement data."
38+
"Solve for the Weighted Least Squares position estimate simply by passing the measurement data.\n",
39+
"\n",
40+
"When obtaining WLS estimates for real measurements, the rotation of the Earth between the signal transmission and reception has to be accounted for.\n",
41+
"`solve_wls` accounts for this by default and rotates the given SV positions into the ECEF frame of reference when the signals were received.\n",
42+
"\n",
43+
"In case you assume that the satellite positions are given for the ECEF frame of reference when the signals were received,\n",
44+
"this can be accomplished by setting the parameter `tx_time = False` in the function call."
3945
]
4046
},
4147
{
@@ -45,7 +51,9 @@
4551
"metadata": {},
4652
"outputs": [],
4753
"source": [
48-
"state_wls = glp.solve_wls(derived_data)"
54+
"state_wls = glp.solve_wls(derived_data)\n",
55+
"# When assuming that SV positions are given in the ECEF frame when signals are received use\n",
56+
"# state_wls = glp.solve_wls(derived_data, use_tx_time=True)"
4957
]
5058
},
5159
{
@@ -101,7 +109,35 @@
101109
"id": "0387e03e",
102110
"metadata": {},
103111
"source": [
104-
"Solve for the Weighted Least Squares position estimate simply by passing the measurement data."
112+
"Solve for the Weighted Least Squares position estimate simply by passing the measurement data.\n",
113+
"\n",
114+
"The implemented EKF also assumes that the satellite positions are given for when the signals were transmitted and that\n",
115+
"they must be rotated to account for the change in the ECEF frame of reference.\n",
116+
"\n",
117+
"In this case, to change this default behaviour, pass a dictionary `init_dict` with the key-value pair `\"use_tx_time\": True`."
118+
]
119+
},
120+
{
121+
"cell_type": "markdown",
122+
"id": "31e7b493",
123+
"metadata": {},
124+
"source": [
125+
"To prevent accidental usage of untuned process and measurement noises, `solve_gnss_ekf` requires an initialization \\\n",
126+
"dictionary containing values for the process noise `\"Q\"` and the measurement noise `\"R\"`.\n",
127+
"\n",
128+
"In the naive implementation, the noise matrix is set to the size of the measurement vector using the scalar value `\"R\"`."
129+
]
130+
},
131+
{
132+
"cell_type": "code",
133+
"execution_count": null,
134+
"id": "2dfb8d75",
135+
"metadata": {},
136+
"outputs": [],
137+
"source": [
138+
"import numpy as np\n",
139+
"init_dict = {\"Q\": np.eye(7),\n",
140+
" \"R\" : np.eye(1)}"
105141
]
106142
},
107143
{
@@ -113,7 +149,7 @@
113149
},
114150
"outputs": [],
115151
"source": [
116-
"state_ekf = glp.solve_gnss_ekf(derived_data)"
152+
"state_ekf = glp.solve_gnss_ekf(derived_data, init_dict)"
117153
]
118154
},
119155
{
@@ -209,6 +245,14 @@
209245
"source": [
210246
"figs = glp.plot_metric_by_constellation(galileo_data, \"gps_millis\", \"residuals_m\")"
211247
]
248+
},
249+
{
250+
"cell_type": "code",
251+
"execution_count": null,
252+
"id": "fdc6d9cb",
253+
"metadata": {},
254+
"outputs": [],
255+
"source": []
212256
}
213257
],
214258
"metadata": {

0 commit comments

Comments
 (0)