You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: examples/ZED-F9P/Example8_GetHighPrecisionPositionAndAccuracy/Example8_GetHighPrecisionPositionAndAccuracy.ino
+97-19
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
/*
2
-
Get the high precision geodetic solution for latituude and longitude
2
+
Get the high precision geodetic solution for latitude and longitude
3
3
By: Nathan Seidle
4
-
Modified by: Steven Rowland
4
+
Modified by: Steven Rowland and Paul Clark
5
5
SparkFun Electronics
6
-
Date: January 3rd, 2019
6
+
Date: April 17th, 2020
7
7
License: MIT. See license file for more information but you can
8
8
basically do whatever you want with this code.
9
9
10
10
This example shows how to inspect the accuracy of the high-precision
11
-
positional solution.
11
+
positional solution. Please see below for information about the units.
12
12
13
13
Feel like supporting open source hardware?
14
14
Buy a board from SparkFun!
@@ -36,22 +36,22 @@ void setup()
36
36
37
37
Wire.begin();
38
38
39
-
if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
39
+
//myGPS.enableDebugging(Serial);
40
+
41
+
if (myGPS.begin(Wire) == false) //Connect to the Ublox module using Wire port
40
42
{
41
43
Serial.println(F("Ublox GPS not detected at default I2C address. Please check wiring. Freezing."));
42
44
while (1);
43
45
}
44
46
45
-
//myGPS.enableDebugging(Serial);
46
-
47
47
myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
48
48
myGPS.setNavigationFrequency(20); //Set output to 20 times a second
49
49
50
50
byte rate = myGPS.getNavigationFrequency(); //Get the update rate of this module
51
-
Serial.print("Current update rate:");
51
+
Serial.print("Current update rate:");
52
52
Serial.println(rate);
53
-
54
-
myGPS.saveConfiguration(); //Save the current settings to flash and BBR
53
+
54
+
//myGPS.saveConfiguration(); //Save the current settings to flash and BBR
55
55
}
56
56
57
57
voidloop()
@@ -61,17 +61,95 @@ void loop()
61
61
if (millis() - lastTime > 1000)
62
62
{
63
63
lastTime = millis(); //Update the timer
64
-
Serial.print("HP Lat: ");
65
-
int32_t latitude = myGPS.getHighResLatitude();
66
-
Serial.print(latitude);
67
-
Serial.print(", HP Lon: ");
68
64
69
-
int32_t longitude = myGPS.getHighResLongitude();
70
-
Serial.print(longitude);
71
-
Serial.print(", Accuracy: ");
65
+
// getHighResLatitude: returns the latitude from HPPOSLLH as an int32_t in degrees * 10^-7
66
+
// getHighResLatitudeHp: returns the high resolution component of latitude from HPPOSLLH as an int8_t in degrees * 10^-9
67
+
// getHighResLongitude: returns the longitude from HPPOSLLH as an int32_t in degrees * 10^-7
68
+
// getHighResLongitudeHp: returns the high resolution component of longitude from HPPOSLLH as an int8_t in degrees * 10^-9
69
+
// getElipsoid: returns the height above ellipsoid as an int32_t in mm
70
+
// getElipsoidHp: returns the high resolution component of the height above ellipsoid as an int8_t in mm * 10^-1
71
+
// getMeanSeaLevel: returns the height above mean sea level as an int32_t in mm
72
+
// getMeanSeaLevelHp: returns the high resolution component of the height above mean sea level as an int8_t in mm * 10^-1
73
+
// getHorizontalAccuracy: returns the horizontal accuracy estimate from HPPOSLLH as an uint32_t in mm * 10^-1
72
74
75
+
// If you want to use the high precision latitude and longitude with the full 9 decimal places
76
+
// you will need to use a 64-bit double - which is not supported on all platforms
77
+
78
+
// To allow this example to run on standard platforms, we cheat by converting lat and lon to integer and fractional degrees
79
+
80
+
// The high resolution altitudes can be converted into standard 32-bit float
0 commit comments