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

Questions regarding laika's input measurement specs for implementing DGPS #4

Closed
anuragxel opened this issue Oct 31, 2019 · 4 comments
Closed

Comments

@anuragxel
Copy link

Hi, I'm trying to modify laika to create an ad-hoc DGPS system from Android phones via their Raw GNSS API. I have been experimenting with GNSS Logger app/library from Google [1]. I was trying to use this output as input to your library to measure GPS first, and then extend it to a functioning DGPS solution.

  1. I'm having trouble with providing inputs to laika. The documentation mentions there are 8 values per row (in the comma2k19 dataset repository here), but the numpy arrays (raw_gnss_ublox) contains 10 values (and laika expects 10 values as input). The following is my current understanding (I calculated gpsWeek, gpsSecondsOfWeek, pseudorange using [2], from what I got out of comma2k19 dataset docs.)
return np.array([
        svid, # PRN
        gpsWeek, # week of gps_time of reception (gps_week),
        gpsSecondsOfWeek, # time pf week of gps_time of reception (s),
        np.nan, # GLONASS channel, as GPS, it's nan
        pseudorange, # calculated via the android params
        -1, # pseudorange_std, if it's uncertainty, is there a reference to see how it's calculated?
        pseudorangeRateMetersPerSecond,
        pseudorange_rate_std, # pseudorangeRateUncertaintyMetersPerSecond from android API?
        -1, #  S1C --> Signal Strength ??
        -1, # L1C --> Carrier Cycles ??
    ])

(a) What expected as input for pseudorange_std and pseudorange_rate_std parameters? Is it uncertainty (I assumed as std could mean standard deviation? If so, is there are reference where I can see this and thus implement it?
(b) Are the last two values necessary? I couldn't find any indication what they are, apart from digging in the library and figuring out the keys, which when I read the RINEX documentation.

  1. I'm trying to understand dgps.py. I'm trying to replace ground station data with GNSS data (that I understand is downloaded from the internet) from a different source. I want to know what exactly is being sent to AstroDog so that I can compute this via the ad-hoc ground station?

I understand the principles of DGPS, however, the design is bit unclear (from reading parse_dgps). From what I understand, sending back a good DGPSDelay object is all need to do. What would that entail? Is there any other class I should be looking at?

[1] The outputs of the GNSSLogger library are as follows,

ElapsedRealtimeMillis,TimeNanos,LeapSecond,TimeUncertaintyNanos,FullBiasNanos,BiasNanos,BiasUncertaintyNanos,DriftNanosPerSecond,DriftUncertaintyNanosPerSecond,HardwareClockDiscontinuityCount,Svid,TimeOffsetNanos,State,ReceivedSvTimeNanos,ReceivedSvTimeUncertaintyNanos,Cn0DbHz,PseudorangeRateMetersPerSecond,PseudorangeRateUncertaintyMetersPerSecond,AccumulatedDeltaRangeState,AccumulatedDeltaRangeMeters,AccumulatedDeltaRangeUncertaintyMeters,CarrierFrequencyHz,CarrierCycles,CarrierPhase,CarrierPhaseUncertainty,MultipathIndicator,SnrInDb,ConstellationType,AgcDb,CarrierFrequencyHz

[2] This is my pseudorange code. raw is the GNSS output from the Android API.

WEEKSEC = 604800
SPEED_OF_LIGHT = 2.99792458e8
def compute_gps_times_and_pseudorange_vals(raw):
    # from https://www.gsa.europa.eu/system/files/reports/gnss_raw_measurement_web_0.pdf
    tRx_GNSS = float(raw['TimeNanos']) - (float(raw['FullBiasNanos']) + float(raw['BiasNanos'])) 
    gps_week = tRx_GNSS // (WEEKSEC*1e9)
    tRx = np.mod(tRx_GNSS,WEEKSEC*1e9)
    gps_seconds_of_week = np.round(tRx * 1e-9)
    tTx = float(raw['ReceivedSvTimeNanos']) + float(raw['TimeOffsetNanos'])
    pr =  (tRx - tTx) * SPEED_OF_LIGHT * 1e-9
    return pr, gps_week, gps_seconds_of_week

@anuragxel anuragxel changed the title Questions regarding laika's input measurement for creating DGPS Questions regarding laika's input measurement for building DGPS Oct 31, 2019
@anuragxel anuragxel changed the title Questions regarding laika's input measurement for building DGPS Questions regarding laika's input measurement specs for building DGPS Oct 31, 2019
@anuragxel anuragxel changed the title Questions regarding laika's input measurement specs for building DGPS Questions regarding laika's input measurement specs for implementing DGPS Oct 31, 2019
@haraschax
Copy link
Collaborator

haraschax commented Nov 21, 2019

  1. 1a)Yes those standard for standard deviations of the given measurements, usually receivers give an uncertainty for each measurement, this is usually a standard deviation or a variation. In this case we use standard deviations. The optimizer uses this to weight a given measurement. If you can't get one from your receiver just use 1.

  2. 1b) Yes laika uses 10 values internally, which include S1C and L1C which are the signal strength and carrier cycles of the L1 measurement. They are not needed for regular positioning in laika, this is why they are not in the comma2k19 dataset.

  3. 2You can implement your own GPSDelay object that uses your ground station data. If your ground station outputs in the RINEX format you should be able to parse it in the same way laika does with the read_rinex_obs function. Laika automatically finds ground stations close to you and gets the DGPSDelay objects for it, but if you have your own ground station you should be able to rewrite it a little so it just uses a DGPSDelay object from your ground station.

@anuragxel
Copy link
Author

anuragxel commented Nov 27, 2019

Thanks for your response. I'll look into the pointers you have mentioned and try and get it to work. I did have a couple of follow up questions, hopefully, you can answer these queries too.

  1. So, I don't need to pass a 10 value array, is that what you are saying? Because the walk-through etc all use that array. I'll look for the corresponding function call for if I only have 8 values then. Because I have been encountering the following error when I do,
    observables['S1C'] = arr[8] IndexError: index 8 is out of bounds for axis 0 with size 8
    when I try to run the following line
    measurements = [laika_raw.normal_meas_from_array(m_arr) for m_arr in sat_data]
    (I figured it out, kindly disregard)

  2. Can you tell me which ublox GPS receiver that you were using? I'd like to buy one to test it myself and I'd appreciate if you could tell me the specific hardware model (dev board and make).

Update: I do see that your reader for qcom sets the value for S1C and L1C as np.nan. That makes sense. It would be great if you could clarify question 2. :)

@haraschax
Copy link
Collaborator

  1. Yes you need to put 10 values, but you can just put zeros or nans for those, since they are not used for the functionality you are looking for.

  2. We use a ublox m8P module. You can get dev kits for them https://www.sparkfun.com/products/15005, there are many different devkits, some are cheaper. If you just want the cheapest module with raw gnss data, the M8T module should work too.

@anuragxel
Copy link
Author

anuragxel commented Dec 4, 2019

Thanks for your answers, I had put in nan's and was able to get the basic code to work. I'll get the M8P devkit to try the DGPS part. I'm having troubles getting the KalmanFilter to run but I guess that's on my end. I'll close this issue.

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

No branches or pull requests

2 participants