Skip to content

Commit fad9bdc

Browse files
Copilotjbrodovsky
andcommitted
Address code review feedback for documentation
Co-authored-by: jbrodovsky <57160841+jbrodovsky@users.noreply.github.com>
1 parent 682de21 commit fad9bdc

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

docs/USER_GUIDE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,9 @@ cargo doc --open -p strapdown-core
661661

662662
Or view online at [docs.rs/strapdown-core](https://docs.rs/strapdown-core).
663663

664+
> **Note:** The package is named `strapdown-core` but the library exports as `strapdown`.
665+
> In your code, use `use strapdown::...` for imports.
666+
664667
### Key Types
665668

666669
#### `StrapdownState`

examples/configs/particle_filter_comparison.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
#
1414
# # Particle Filter
1515
# strapdown-sim -i input.csv -o pf_result.csv particle-filter \
16-
# --num-particles 200 \
17-
# --config particle_filter_comparison.yaml
16+
# --config particle_filter_comparison.yaml \
17+
# --num-particles 200
1818
#
1919
# Expected behavior: Both filters should track well during GNSS
2020
# availability. Particle filter may show better robustness to

scripts/analyze_results.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
import pandas as pd
2424
import matplotlib.pyplot as plt
2525

26+
# Earth radius in meters (WGS84 mean radius)
27+
EARTH_RADIUS_M = 6371000
28+
2629
# Optional: haversine for accurate distance calculation
2730
try:
2831
from haversine import haversine_vector, Unit
@@ -52,14 +55,13 @@ def calculate_position_error(truth: pd.DataFrame, test: pd.DataFrame) -> np.ndar
5255
error_m = haversine_vector(truth_coords, test_coords, Unit.METERS)
5356
else:
5457
# Equirectangular approximation (less accurate but simple)
55-
R = 6371000 # Earth radius in meters
5658
lat1 = np.radians(truth_coords[:, 0])
5759
lat2 = np.radians(test_coords[:, 0])
5860
dlat = lat2 - lat1
5961
dlon = np.radians(test_coords[:, 1] - truth_coords[:, 1])
6062
x = dlon * np.cos((lat1 + lat2) / 2)
6163
y = dlat
62-
error_m = R * np.sqrt(x**2 + y**2)
64+
error_m = EARTH_RADIUS_M * np.sqrt(x**2 + y**2)
6365

6466
return error_m
6567

@@ -288,13 +290,12 @@ def main():
288290
# Covariance consistency (if available)
289291
if 'latitude_cov' in test.columns:
290292
# Convert lat covariance from radians² to meters²
291-
R = 6371000
292-
lat_cov_m2 = test['latitude_cov'].values * (R * np.pi / 180)**2
293+
lat_cov_m2 = test['latitude_cov'].values * (EARTH_RADIUS_M * np.pi / 180)**2
293294

294295
# Use latitude component of position error for comparison
295296
lat_error = np.abs(
296297
test['latitude'].values - truth['latitude'].values
297-
) * R * np.pi / 180
298+
) * EARTH_RADIUS_M * np.pi / 180
298299

299300
plot_covariance_bounds(
300301
time_s, lat_error, lat_cov_m2,

0 commit comments

Comments
 (0)