Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.

Merging release_candidate : version 1.8.9 #160

Merged
merged 9 commits into from
Dec 14, 2020
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Thanks to:
* [dotMorten](https://github.com/dotMorten) for the MSGOUT keys, autoHPPOSLLH, autoDOP and upgrades to autoPVT.
* [markuckermann](https://github.com/markuckermann) for spotting the config layer gremlins
* [vid553](https://github.com/vid553) for the Zephyr port
* [balamuruganky](https://github.com/balamuruganky) for the NAV-PVT velocity parameters
* [balamuruganky](https://github.com/balamuruganky) for the NAV-PVT velocity parameters, getSpeedAccEst, getHeadingAccEst, getInvalidLlh, getHeadVeh, getMagDec and getMagAcc
* [nelarsen](https://github.com/nelarsen) for the buffer overrun improvements
* [mstranne](https://github.com/mstranne) and [shaneperera](https://github.com/shaneperera) for the pushRawData suggestion
* [rubienr](https://github.com/rubienr) for spotting the logical AND issues
Expand Down Expand Up @@ -113,6 +113,21 @@ packets in its internal buffer (about 500 bytes) and the library will read those
called, update its internal copy of the nav data 5 times, and return `true` to the sketch. The
sketch calls `getLatitude`, etc. and retrieve the data of the most recent of those 5 packets.

The library also supports:
* `autoHPPOSLLH`
* `autoDOP`
* `autoHNRAtt`
* `autoHNRDyn`
* `autoHNRPVT`

Memory Usage
---------------------------------

Version 1.8.9 introduced support for `autoHNR` on the NEO-M8U, and that tipped the balance in terms of RAM use on the ATmega328.
The library does still run on the ATmega328 but you will see _**Low memory available, stability problems may occur**_ warnings
as the global variables now occupy 1540 bytes of RAM. If you do want to run this library on the ATmega328, you may need to regress
to Version 1.8.8 via the Library Manager.

Products That Use This Library
---------------------------------
* [GPS-16481](https://www.sparkfun.com/products/16481) - SparkFun GPS-RTK-SMA Breakout - ZED-F9P (Qwiic)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
By: Paul Clark
SparkFun Electronics
Date: December, 2020
License: MIT. See license file for more information but you can
basically do whatever you want with this code.

This example configures the High Navigation Rate on the NEO-M8U and then
polls and displays the attitude solution, vehicle dynamics information
and high rate position, velocity and time.

This example polls the high rate data.
(The next example uses "autoHNR" to receive the HNR data automatically.)

Please make sure your NEO-M8U is running UDR firmware >= 1.31. Please update using u-center if necessary:
https://www.u-blox.com/en/product/neo-m8u-module#tab-documentation-resources

Feel like supporting open source hardware?
Buy a board from SparkFun!
NEO-M8U: https://www.sparkfun.com/products/16329

Hardware Connections:
Plug a Qwiic cable into the GPS and a Redboard Qwiic
If you don't have a platform with a Qwiic connection use the
SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
Open the serial monitor at 115200 baud to see the output

*/

#include <Wire.h> //Needed for I2C to GPS

#include <SparkFun_Ublox_Arduino_Library.h> //http://librarymanager/All#SparkFun_Ublox_GPS
SFE_UBLOX_GPS myGPS;

void setup()
{
Serial.begin(115200);
while (!Serial); //Wait for user to open terminal
Serial.println(F("SparkFun u-blox Example"));

Wire.begin();

//myGPS.enableDebugging(); // Uncomment this line to enable debug messages on Serial

if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
{
Serial.println(F("Warning! u-blox GPS did not begin correctly."));
Serial.println(F("(This may be because the I2C port is busy with HNR messages.)"));
}

myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR

if (myGPS.setHNRNavigationRate(10) == true) //Set the High Navigation Rate to 10Hz
Serial.println(F("setHNRNavigationRate was successful"));
else
Serial.println(F("setHNRNavigationRate was NOT successful"));
}

void loop()
{
// Poll and print selected HNR data
if (myGPS.getHNRAtt(125) == true) // Request HNR Att data using a 125ms timeout
{
Serial.print(F("Roll: "));
Serial.print(myGPS.hnrAtt.roll);
Serial.print(F(" Pitch: "));
Serial.print(myGPS.hnrAtt.pitch);
Serial.print(F(" Heading: "));
Serial.println(myGPS.hnrAtt.heading);
}
if (myGPS.getHNRDyn(125) == true) // Request HNR Dyn data using a 125ms timeout
{
Serial.print(F("xAccel: "));
Serial.print(myGPS.hnrVehDyn.xAccel);
Serial.print(F(" yAccel: "));
Serial.print(myGPS.hnrVehDyn.yAccel);
Serial.print(F(" zAccel: "));
Serial.println(myGPS.hnrVehDyn.zAccel);
}
if (myGPS.getHNRPVT(125) == true) // Request HNR PVT data using a 125ms timeout
{
Serial.print(F("ns: "));
Serial.print(myGPS.hnrPVT.nano);
Serial.print(F(" Lat: "));
Serial.print(myGPS.hnrPVT.lat);
Serial.print(F(" Lon: "));
Serial.println(myGPS.hnrPVT.lon);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/*
By: Paul Clark
SparkFun Electronics
Date: December, 2020
License: MIT. See license file for more information but you can
basically do whatever you want with this code.

This example configures the High Navigation Rate on the NEO-M8U and then
reads and displays the attitude solution, vehicle dynamics information
and high rate position, velocity and time.

This example uses "autoHNR" to receive the HNR data automatically.

Please make sure your NEO-M8U is running UDR firmware >= 1.31. Please update using u-center if necessary:
https://www.u-blox.com/en/product/neo-m8u-module#tab-documentation-resources

Feel like supporting open source hardware?
Buy a board from SparkFun!
NEO-M8U: https://www.sparkfun.com/products/16329

Hardware Connections:
Plug a Qwiic cable into the GPS and a Redboard Qwiic
If you don't have a platform with a Qwiic connection use the
SparkFun Qwiic Breadboard Jumper (https://www.sparkfun.com/products/14425)
Open the serial monitor at 115200 baud to see the output

*/

#include <Wire.h> //Needed for I2C to GPS

#include <SparkFun_Ublox_Arduino_Library.h> //http://librarymanager/All#SparkFun_Ublox_GPS
SFE_UBLOX_GPS myGPS;

boolean usingAutoHNRAtt = false;
boolean usingAutoHNRDyn = false;
boolean usingAutoHNRPVT = false;

void setup()
{
Serial.begin(115200);
while (!Serial); //Wait for user to open terminal
Serial.println(F("SparkFun u-blox Example"));

Wire.begin();

//myGPS.enableDebugging(); // Uncomment this line to enable debug messages on Serial

if (myGPS.begin() == false) //Connect to the Ublox module using Wire port
{
Serial.println(F("Warning! u-blox GPS did not begin correctly."));
Serial.println(F("(This may be because the I2C port is busy with HNR messages.)"));
}

myGPS.setI2COutput(COM_TYPE_UBX); //Set the I2C port to output UBX only (turn off NMEA noise)
myGPS.saveConfigSelective(VAL_CFG_SUBSEC_IOPORT); //Save (only) the communications port settings to flash and BBR

if (myGPS.setHNRNavigationRate(10) == true) //Set the High Navigation Rate to 10Hz
Serial.println(F("setHNRNavigationRate was successful"));
else
Serial.println(F("setHNRNavigationRate was NOT successful"));

usingAutoHNRAtt = myGPS.setAutoHNRAtt(true); //Attempt to enable auto HNR attitude messages
usingAutoHNRDyn = myGPS.setAutoHNRDyn(true); //Attempt to enable auto HNR vehicle dynamics messages
usingAutoHNRPVT = myGPS.setAutoHNRPVT(true); //Attempt to enable auto HNR PVT messages
}

void loop()
{
if (usingAutoHNRAtt && (myGPS.getHNRAtt() == true)) // If setAutoHNRAtt was successful and new data is available
{
Serial.print(F("Roll: ")); // Print selected data
Serial.print(myGPS.hnrAtt.roll);
Serial.print(F(" Pitch: "));
Serial.print(myGPS.hnrAtt.pitch);
Serial.print(F(" Heading: "));
Serial.println(myGPS.hnrAtt.heading);
}
if (usingAutoHNRDyn && (myGPS.getHNRDyn() == true)) // If setAutoHNRDyn was successful and new data is available
{
Serial.print(F("xAccel: ")); // Print selected data
Serial.print(myGPS.hnrVehDyn.xAccel);
Serial.print(F(" yAccel: "));
Serial.print(myGPS.hnrVehDyn.yAccel);
Serial.print(F(" zAccel: "));
Serial.println(myGPS.hnrVehDyn.zAccel);
}
if (usingAutoHNRPVT && (myGPS.getHNRPVT() == true)) // If setAutoHNRPVT was successful and new data is available
{
Serial.print(F("ns: ")); // Print selected data
Serial.print(myGPS.hnrPVT.nano);
Serial.print(F(" Lat: "));
Serial.print(myGPS.hnrPVT.lat);
Serial.print(F(" Lon: "));
Serial.println(myGPS.hnrPVT.lon);
}
}
30 changes: 29 additions & 1 deletion examples/Example13_PVT/Example1_AutoPVT/Example1_AutoPVT.ino
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ void setup()
void loop()
{
// Calling getPVT returns true if there actually is a fresh navigation solution available.
if (myGPS.getPVT())
// Start the reading only when valid LLH is available
if (myGPS.getPVT() && (myGPS.getInvalidLlh() == false))
{
Serial.println();
long latitude = myGPS.getLatitude();
Expand Down Expand Up @@ -105,6 +106,33 @@ void loop()
Serial.print(horizontalAccEst);
Serial.print(F(" (mm)"));

int speedAccEst = myGPS.getSpeedAccEst();
Serial.print(F(" SpeedAccEst: "));
Serial.print(speedAccEst);
Serial.print(F(" (mm/s)"));

int headAccEst = myGPS.getHeadingAccEst();
Serial.print(F(" HeadAccEst: "));
Serial.print(headAccEst);
Serial.print(F(" (degrees * 10^-5)"));

if (myGPS.getHeadVehValid() == true) {
int headVeh = myGPS.getHeadVeh();
Serial.print(F(" HeadVeh: "));
Serial.print(headVeh);
Serial.print(F(" (degrees * 10^-5)"));

int magDec = myGPS.getMagDec();
Serial.print(F(" MagDec: "));
Serial.print(magDec);
Serial.print(F(" (degrees * 10^-2)"));

int magAcc = myGPS.getMagAcc();
Serial.print(F(" MagAcc: "));
Serial.print(magAcc);
Serial.print(F(" (degrees * 10^-2)"));
}

Serial.println();
} else {
Serial.print(".");
Expand Down
19 changes: 19 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ getVerticalAccEst KEYWORD2
getNedNorthVel KEYWORD2
getNedEastVel KEYWORD2
getNedDownVel KEYWORD2
getSpeedAccEst KEYWORD2
getHeadingAccEst KEYWORD2
getInvalidLlh KEYWORD2
getHeadVeh KEYWORD2
getMagDec KEYWORD2
getMagAcc KEYWORD2
getHeadVehValid KEYWORD2

setPortOutput KEYWORD2
setPortInput KEYWORD2
Expand Down Expand Up @@ -175,6 +182,18 @@ setStaticPosition KEYWORD2

pushRawData KEYWORD2

setHNRNavigationRate KEYWORD2
getHNRNavigationRate KEYWORD2
assumeAutoHNRAtt KEYWORD2
setAutoHNRAtt KEYWORD2
getHNRAtt KEYWORD2
assumeAutoHNRDyn KEYWORD2
setAutoHNRDyn KEYWORD2
getHNRDyn KEYWORD2
assumeAutoHNRPVT KEYWORD2
setAutoHNRPVT KEYWORD2
getHNRPVT KEYWORD2

#######################################
# Constants (LITERAL1)
#######################################
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=SparkFun u-blox Arduino Library
version=1.8.8
version=1.8.9
author=SparkFun Electronics <[email protected]>
maintainer=SparkFun Electronics <sparkfun.com>
sentence=Library for I2C and Serial Communication with u-blox modules
Expand Down
Loading