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

Commit 9479135

Browse files
committed
getHeadVehValid function added.
1 parent b7beb48 commit 9479135

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

Diff for: keywords.txt

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ getInvalidLlh KEYWORD2
6464
getHeadVeh KEYWORD2
6565
getMagDec KEYWORD2
6666
getMagAcc KEYWORD2
67+
getHeadVehValid KEYWORD2
6768

6869
setPortOutput KEYWORD2
6970
setPortInput KEYWORD2

Diff for: src/SparkFun_Ublox_Arduino_Library.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,7 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
10291029
gnssFixOk = extractByte(21 - startingSpot) & 0x1; //Get the 1st bit
10301030
diffSoln = extractByte(21 - startingSpot) >> 1 & 0x1; //Get the 2nd bit
10311031
carrierSolution = extractByte(21 - startingSpot) >> 6; //Get 6th&7th bits of this byte
1032+
headVehValid = extractByte(21 - startingSpot) >> 5 & 0x1; // Get the 5th bit
10321033
SIV = extractByte(23 - startingSpot);
10331034
longitude = extractSignedLong(24 - startingSpot);
10341035
latitude = extractSignedLong(28 - startingSpot);
@@ -1064,6 +1065,7 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
10641065
moduleQueried.all = true;
10651066
moduleQueried.gnssFixOk = true;
10661067
moduleQueried.diffSoln = true;
1068+
moduleQueried.headVehValid = true;
10671069
moduleQueried.longitude = true;
10681070
moduleQueried.latitude = true;
10691071
moduleQueried.altitude = true;
@@ -3850,6 +3852,18 @@ uint8_t SFE_UBLOX_GPS::getCarrierSolutionType(uint16_t maxWait)
38503852
return (carrierSolution);
38513853
}
38523854

3855+
//Get whether head vehicle valid or not
3856+
bool SFE_UBLOX_GPS::getHeadVehValid(uint16_t maxWait)
3857+
{
3858+
if (moduleQueried.headVehValid == false)
3859+
getPVT(maxWait);
3860+
moduleQueried.headVehValid = false; //Since we are about to give this to user, mark this data as stale
3861+
moduleQueried.all = false;
3862+
3863+
return (headVehValid);
3864+
}
3865+
3866+
38533867
//Get the ground speed in mm/s
38543868
int32_t SFE_UBLOX_GPS::getGroundSpeed(uint16_t maxWait)
38553869
{
@@ -3971,6 +3985,7 @@ void SFE_UBLOX_GPS::flushPVT()
39713985
moduleQueried.all = false;
39723986
moduleQueried.gnssFixOk = false;
39733987
moduleQueried.diffSoln = false;
3988+
moduleQueried.headVehValid = false;
39743989
moduleQueried.longitude = false;
39753990
moduleQueried.latitude = false;
39763991
moduleQueried.altitude = false;
@@ -3980,7 +3995,13 @@ void SFE_UBLOX_GPS::flushPVT()
39803995
moduleQueried.carrierSolution = false;
39813996
moduleQueried.groundSpeed = false;
39823997
moduleQueried.headingOfMotion = false;
3998+
moduleQueried.speedAccEst = false;
3999+
moduleQueried.headingAccEst = false;
39834000
moduleQueried.pDOP = false;
4001+
moduleQueried.invalidLlh = false;
4002+
moduleQueried.headVeh = false;
4003+
moduleQueried.magDec = false;
4004+
moduleQueried.magAcc = false;
39844005
}
39854006

39864007
//Mark all the HPPOSLLH data as read/stale. This is handy to get data alignment after CRC failure

Diff for: src/SparkFun_Ublox_Arduino_Library.h

+3
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ class SFE_UBLOX_GPS
507507

508508
bool getGnssFixOk(uint16_t maxWait = getPVTmaxWait); //Get whether we have a valid fix (i.e within DOP & accuracy masks)
509509
bool getDiffSoln(uint16_t maxWait = getPVTmaxWait); //Get whether differential corrections were applied
510+
bool getHeadVehValid(uint16_t maxWait = getPVTmaxWait);
510511
int32_t getLatitude(uint16_t maxWait = getPVTmaxWait); //Returns the current latitude in degrees * 10^-7. Auto selects between HighPrecision and Regular depending on ability of module.
511512
int32_t getLongitude(uint16_t maxWait = getPVTmaxWait); //Returns the current longitude in degrees * 10-7. Auto selects between HighPrecision and Regular depending on ability of module.
512513
int32_t getAltitude(uint16_t maxWait = getPVTmaxWait); //Returns the current altitude in mm above ellipsoid
@@ -736,6 +737,7 @@ class SFE_UBLOX_GPS
736737

737738
bool gnssFixOk; //valid fix (i.e within DOP & accuracy masks)
738739
bool diffSoln; //Differential corrections were applied
740+
bool headVehValid;
739741
int32_t latitude; //Degrees * 10^-7 (more accurate than floats)
740742
int32_t longitude; //Degrees * 10^-7 (more accurate than floats)
741743
int32_t altitude; //Number of mm above ellipsoid
@@ -1032,6 +1034,7 @@ class SFE_UBLOX_GPS
10321034
uint32_t all : 1;
10331035
uint32_t gnssFixOk : 1;
10341036
uint32_t diffSoln : 1;
1037+
uint32_t headVehValid : 1;
10351038
uint32_t longitude : 1;
10361039
uint32_t latitude : 1;
10371040
uint32_t altitude : 1;

0 commit comments

Comments
 (0)