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 Code | Description | Note |
200 | Successful assistance data delivery, including HAE, HAT and uncertainty data | |
400 | General server failure | |
403 | Invalid API Key | |
600 | 2D location is out of NextNav Pinnacle service area | |
610 | Inside Pinnacle coverage/service area but reference pressure data is NOT available | |
620 | Inside Pinnacle coverage/service area but barometer calibration data is NOT available | This status code is typically not observed, but provided for reference |
630 | Combination of 610 and 620 Codes | This status code is typically not observed, but provided for reference |
640 | Barometer calibration data is stale | This status code is typically not observed, but provided for reference |
SdkStatusNotification supports the following error codes:
Error Code | Description | Notes |
800 | SDK initialization success | |
801 | SDK initializing in progress | |
802 | Initializing pressure provider | The test mobile phone may not include a barometric sensor |
803 | Initializing location provider | |
804 | No location available | Consider as initialization failed after 10 seconds |
805 | No pressure available | Consider as initialization failed after 10 seconds |
806 | SDK initialization failed | |
808 | SDK is already initialized | |
810 | SDK is not initialized | |
811 | SDK stop successfully | |
815 | Input host URL is invalid | |
830 | Altitude mode is activated | |
832 | Waiting for pressure for assistance fetch | |
833 | Waiting for location for assistance fetch | |
834 | Waiting for NNCS | |
835 | Altitude mode is deactivated | |
870 | Manual barometer calibration success | |
871 | Manual barometer calibration in progress | |
872 | Manual barometer calibration failed | The end-user may be directed to manually calibrate in a different place/location and at a different time |
876 | Device pressure reading is changing too fast and/or user doesn’t seem to be still | The 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. |
877 | Not a good place (Ex: outside coverage area etc.) to collect data | The end-user may be directed to manually calibrate in a different place/location and at a different time |
896 | Activity permission is needed | |
898 | Location permission is needed | |
899 | Storage 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.
- Missing ‘package’ key attribute on element package at [:arcore_client:] AndroidManifest.xml:30:9-54
- You need to follow the steps in this page: https://developers.google.com/ar/develop/unity/android-11-build#unity_20193_20194_and_20201
- Source: https://forum.unity.com/threads/arcore-xr-plugin-2-12-requires-updated-gradle-on-unity-2019-4.1003444/