osqzss / gps-sdr-sim

Software-Defined GPS Signal Simulator
MIT License
2.61k stars 760 forks source link

ECEF Coordinates overwritten in Static Receiver Mode #359

Open cjb-eng opened 1 year ago

cjb-eng commented 1 year ago

I'm new to github so not sure if I should post an issue first or simply go ahead and generate a pull request to propose resolution to my issue.

In short, when I specify ECEF coordinates for a static receiver location using the -c flag, the program's default ECEF coordinates overwrites those I specified with the -c flag. It appears that the overwrite is happening on line 1976 since the case 'c' (line 1825) only initializes xyz. From my testing, a simple fix is to simply add a call to xyz2llh after scanning in the xyz coordinates on line 1825 which makes the calculation on line 1976 somewhat redundant when using the -c flag. Since the code uses xyz from line 1976, the cleaner solution is probably to add logic to bypass the call to llh2xyz when the -c flag is used.

osqzss commented 1 year ago

Yes, you're right. Line 1976 is redundant. I will fix this issue sometime.