Understanding the Plugin

There is a very specific set of steps that need to be followed in order to properly Initialize, Calibrate and Receive Altitude Data.

IMPORTANT REMINDER: due to the reliance of the plugin on the device’s HW capabilities, it’s not possible to utilize the Plugin in the editor.

The steps below must be performed in sequence for the Plugin to work properly:

  • Call InitSdk and wait until you receive Status Code 800 (SDK Initialization Success).
  • Launch the calibration screens by calling ShowCalibrationUI. You should see the following screen:
  • Follow the instructions and wait until you receive Status Code 870 (Manual Baro Calibration Success). If calibration fails, you can troubleshoot using the table below.
  • Invoke any of the StartAltitudeCalculation methods (there are three alternatives that obtain Altitude at different frequencies: 1, 30 or 60 seconds, as well as one single time). For more information, refer to the section above with description of methods.

Any other Status Codes can be troubleshooted utilizing the following reference table:

Status CodeDescriptionNote
200Successful assistance data delivery, including HAE, HAT and uncertainty data 
400General server failure 
403Invalid API Key 
6002D location is out of NextNav Pinnacle service area 
610Inside Pinnacle coverage/service area but reference pressure data is NOT available 
620Inside Pinnacle coverage/service area but barometer calibration data is NOT availableThis status code is typically not observed, but provided for reference  
630Combination of 610 and 620 CodesThis status code is typically not observed, but provided for reference
640Barometer calibration data is staleThis status code is typically not observed, but provided for reference

SdkStatusNotification supports the following error codes:

Error CodeDescriptionNotes
800SDK initialization success 
801SDK initializing in progress 
802Initializing pressure providerThe test mobile phone may not include a barometric sensor
803Initializing location provider 
804No location availableConsider as initialization failed after 10 seconds
805No pressure availableConsider as initialization failed after 10 seconds
806SDK initialization failed 
808SDK is already initialized 
810SDK is not initialized 
811SDK stop successfully 
815Input host URL is invalid 
830Altitude mode is activated 
832Waiting for pressure for assistance fetch 
833Waiting for location for assistance fetch 
834Waiting for NNCS 
835Altitude mode is deactivated 
870Manual barometer calibration success 
871Manual barometer calibration in progress 
872Manual barometer calibration failedThe end-user may be directed to manually calibrate in a different place/location and at a different time
876Device pressure reading is changing too fast and/or user doesn’t seem to be stillThe Pinnacle SDK cannot run the manual-calibration operation due to rapid movement/change. The end user may be directed that a calibration is needed when the user’s device is not moving.
877Not a good place (Ex: outside coverage area etc.) to collect dataThe end-user may be directed to manually calibrate in a different place/location and at a different time
896Activity permission is needed 
898Location permission is needed 
899Storage permission is needed 

IMPORTANT: on Android, if you receive Status Code 896, some permissions have not been granted successfully. This can happen depending on your project’s configuration and also AndroidManifest’s merge issues. If that’s the case, simply press the P button located on the top right corner of the screen to force the Permissions dialog to appear.

Errors & Warnings

  • Namespace Error
    • “Assets\Plugins\iOS\Editor\SwiftPostProcess.cs(6,19): error CS0234տ The type or namespace name ‘iOS’ does not exist in the namespace UnityEditor”.
    • You need to import/add the iOS module to the project and it will be fixed.