Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds velocity LSQ solution test #63

Merged
merged 5 commits into from
Mar 19, 2024
Merged

Adds velocity LSQ solution test #63

merged 5 commits into from
Mar 19, 2024

Conversation

jtec
Copy link
Owner

@jtec jtec commented Mar 6, 2024

This PR adds a unit test computing antenna velocity using Doppler observations, thereby closing #42.

@jtec jtec changed the title Velocity LSQ solution test Adds velocity LSQ solution test Mar 6, 2024
@jtec jtec requested a review from plutonheaven March 9, 2024 10:46
@jtec
Copy link
Owner Author

jtec commented Mar 9, 2024

@plutonheaven I noticed that Doppler observations in the CSV are in Hz and not converted to m/s. I wonder whether that is not the more appropriate choice, prx being just a prepocessor (i.e. it makes sense to have it preserve the RINEX units), and Doppler obs in Hz being the "natural" observation of a receiver? I also changed the carrier obs unit to cycles (does not look like it's converted to meters anywhere on main) to be consistent with RINEX - let me know what you think.

@jtec jtec marked this pull request as ready for review March 9, 2024 10:51
@plutonheaven
Copy link
Collaborator

@plutonheaven I noticed that Doppler observations in the CSV are in Hz and not converted to m/s. [...]

I think both thing would make sense, converting everything to m or m/s, or keeping the original units of the RINEX format.

I would tend to keep the RINEX units, because converting Doppler from Hz to m/s makes some assumptions on the smaller satellite clock drift and on the user position (for LOS vector computation). Notably, if LEO PNT really emerge, those assumptions may change (larger Doppler effect, smaller distance, cheaper satellite clocks with larger drift ???)

It could better to leave those conversion to the user, so that he makes a conscious choice about it.

So let us keep Doppler obs in Hz and carrier obs in cycles!

src/prx/user.py Outdated
@@ -15,7 +16,38 @@ def parse_prx_csv_file(prx_file: Path):
return pd.read_csv(prx_file, comment="#"), parse_prx_csv_file_metadata(prx_file)


def spp_vt_lsq(df, p_ecef_m):
df = df[df.D_obs_hz.notna()].reset_index(drop=True)
df["D_obs_mps"] = df.D_obs_hz * cGpsSpeedOfLight_mps / df.carrier_frequency_hz
Copy link
Collaborator

@plutonheaven plutonheaven Mar 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to https://gnss-sdr.org/docs/sp-blocks/observables/#doppler-shift-measurement, the conversion to mps involves a minus sign.

df["D_obs_mps"] = - df.D_obs_hz * cGpsSpeedOfLight_mps / df.carrier_frequency_hz

Then, the corrected pseudorange rate would have the following signs:
df["D_obs_corrected_mps"] = ( df.D_obs_mps.to_numpy().reshape(-1, 1) + df.dclock_mps.to_numpy().reshape(-1, 1) - df["satellite_los_velocities"].to_numpy().reshape(-1, 1) )

All those sign errors are unobservable for fixed data collect.

We should probably put a short dynamic trajectory and verify if the estimated velocity using the doppler observations corresponds to the time difference of the estimated position.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree, added #66

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for checking the sign, made the change.

@jtec jtec requested a review from plutonheaven March 16, 2024 15:04
@jtec jtec force-pushed the velocity_lsq_test branch from 32ddbc9 to 072db6a Compare March 16, 2024 15:12
@jtec jtec merged commit e5cf0af into main Mar 19, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants