Clarification about GNSS location hint fields

Hello, 

We are trying to use the nrf91 GNSS with the `nrf_modem_gnss` library. I'm looking for clarification on these fields that are listed in `struct nrf_modem_gnss_agps_data_location`, as the comments about the "coded number K" are a little unclear:

 773     /** Uncertainty, semi-major. Range 0...127 or 255 for missing latitude and longitude.                                                                                                                                     
   774      *  The uncertainty (in meters) is mapped from the coded number K with following formula:                                                                                                                                 
   775      *  r = C * ((1 + x)^K - 1), where C = 10 and x = 0,1. Range of r (in kilometers) 0...1800.                                                                                                                               
   776      *                                                                                                                                                                                                                        
   777      * @note Value 255 is only supported by modem firmware v1.3.0 or later.                                                                                                                                                   
   778      */                                                                                                                                                                                                                       
   779     uint8_t unc_semimajor;                                                                                                                                                                                                    
   780                                                                                                                                                                                                                               
   781     /** Uncertainty, semi-minor. Range 0...127 or 255 for missing latitude and longitude.                                                                                                                                     
   782      *  The uncertainty (in meters) is mapped from the coded number K with following formula:                                                                                                                                 
   783      *  r = C * ((1 + x)^K - 1), where C = 10 and x = 0,1. Range of r (in kilometers) 0...1800.                                                                                                                               
   784      *                                                                                                                                                                                                                        
   785      * @note Value 255 is only supported by modem firmware v1.3.0 or later.                                                                                                                                                   
   786      */                                                                                                                                                                                                                       
   787     uint8_t unc_semiminor;                                                                                                                                                                                                    
   788                                                                                                                                                                                                                                                                                                                                                                                                                            
   799                                                                                                                                                                                                                               
   800     /** The confidence level (expressed as a percentage) with which                                                                                                                                                           
   801      *  the position of a target entity is included within the uncertainty ellipsoid.                                                                                                                                         
   802      *  Range 0...128. '0' indicates 'no information'.                                                                                                                                                                        
   803      *  Values 101..128  should be treated as '0'.                                                                                                                                                                            
   804      */                                                                                                                                                                                                                       
   805     uint8_t confidence;  

Right now, we only are able to obtain the latitude, longitude, and accuracy value as a hint that is acquired from a google location API. Is there a way to translate those into unc_semimajor, unc_semiminor, and confidence to pass to the GNSS module as a location hint? 

Thank you! 

Parents
  • Hi,

    Is there a way to translate those into unc_semimajor, unc_semiminor, and confidence to pass to the GNSS module as a location hint? 

    The accuracy you get form Google can be converted to K value. Accuracy is the same as uncertainty.

    Just needs to be converted into unc_semimajor and unc_semiminor using the formula provided.  Location is usually given with 1-sigma confidence, so should set the confidence field to 68 (i.e. 68%).

    Since cellular position accuracy is given in radius of circle the unc_semimajor and unc_semiminor will be the same value.

    That gives the K =  Log(Accuracy)/Log(1.1), so if we have a accuracy of 300 meter the the K value is 36.

    The following formula should work in Excel: =LOG(<accuracy>/10+1,1.1). depending on what version of Excel you have the "," might not be accepted as the divider for number and base.

    Regards,
    Jonathan

  • Thank you for the response! I have been testing the GPS location hint with the equation you've given, using the `nrf_modem _gnss` module. However, we've noticed that with the location hint, we are actually taking longer to find a fix than if we did not have the location hint so we think the conversions could be off.

    Can you confirm that the following are the correct equations and units for this location hint struct? The accuracy is in meters. 

    • Latitude, longitude are scaled by 1e5 
    • unc_semimajor = log(acc)/log(1.1) 
    • unc_semiminor = log(acc)/log(1.1) 
    • unc_altitude = 255 (we don't have altitude accuracy at the moment)  
    • confidence = 68 

    Thank you! 

Reply
  • Thank you for the response! I have been testing the GPS location hint with the equation you've given, using the `nrf_modem _gnss` module. However, we've noticed that with the location hint, we are actually taking longer to find a fix than if we did not have the location hint so we think the conversions could be off.

    Can you confirm that the following are the correct equations and units for this location hint struct? The accuracy is in meters. 

    • Latitude, longitude are scaled by 1e5 
    • unc_semimajor = log(acc)/log(1.1) 
    • unc_semiminor = log(acc)/log(1.1) 
    • unc_altitude = 255 (we don't have altitude accuracy at the moment)  
    • confidence = 68 

    Thank you! 

Children
Related