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

Commit eca9868

Browse files
authored
Merge pull request #146 from balamuruganky/release_candidate
NAV-PVT velocity parameters parsed.
2 parents 469e864 + 436486b commit eca9868

File tree

4 files changed

+113
-1
lines changed

4 files changed

+113
-1
lines changed

examples/Example13_PVT/Example1_AutoPVT/Example1_AutoPVT.ino

+26-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,32 @@ void loop()
7878
int PDOP = myGPS.getPDOP();
7979
Serial.print(F(" PDOP: "));
8080
Serial.print(PDOP);
81-
Serial.print(F(" (10^-2)"));
81+
Serial.print(F(" (10^-2)"));
82+
83+
int nedNorthVel = myGPS.getNedNorthVel();
84+
Serial.print(F(" VelN: "));
85+
Serial.print(nedNorthVel);
86+
Serial.print(F(" (mm/s)"));
87+
88+
int nedEastVel = myGPS.getNedEastVel();
89+
Serial.print(F(" VelE: "));
90+
Serial.print(nedEastVel);
91+
Serial.print(F(" (mm/s)"));
92+
93+
int nedDownVel = myGPS.getNedDownVel();
94+
Serial.print(F(" VelD: "));
95+
Serial.print(nedDownVel);
96+
Serial.print(F(" (mm/s)"));
97+
98+
int verticalAccEst = myGPS.getVerticalAccEst();
99+
Serial.print(F(" VAccEst: "));
100+
Serial.print(verticalAccEst);
101+
Serial.print(F(" (mm)"));
102+
103+
int horizontalAccEst = myGPS.getHorizontalAccEst();
104+
Serial.print(F(" HAccEst: "));
105+
Serial.print(horizontalAccEst);
106+
Serial.print(F(" (mm)"));
82107

83108
Serial.println();
84109
} else {

keywords.txt

+5
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ getGroundSpeed KEYWORD2
5353
getHeading KEYWORD2
5454
getPDOP KEYWORD2
5555
getTimeOfWeek KEYWORD2
56+
getHorizontalAccEst KEYWORD2
57+
getVerticalAccEst KEYWORD2
58+
getNedNorthVel KEYWORD2
59+
getNedEastVel KEYWORD2
60+
getNedDownVel KEYWORD2
5661

5762
setPortOutput KEYWORD2
5863
setPortInput KEYWORD2

src/SparkFun_Ublox_Arduino_Library.cpp

+63
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,12 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
990990
latitude = extractLong(28 - startingSpot);
991991
altitude = extractLong(32 - startingSpot);
992992
altitudeMSL = extractLong(36 - startingSpot);
993+
horizontalAccEst = extractLong(40 - startingSpot);
994+
verticalAccEst = extractLong(44 - startingSpot);
995+
nedNorthVel = extractLong(48 - startingSpot);
996+
nedEastVel = extractLong(52 - startingSpot);
997+
nedDownVel = extractLong(56 - startingSpot);
998+
993999
groundSpeed = extractLong(60 - startingSpot);
9941000
headingOfMotion = extractLong(64 - startingSpot);
9951001
pDOP = extractInt(76 - startingSpot);
@@ -1013,6 +1019,13 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
10131019
moduleQueried.latitude = true;
10141020
moduleQueried.altitude = true;
10151021
moduleQueried.altitudeMSL = true;
1022+
1023+
moduleQueried.horizontalAccEst = true;
1024+
moduleQueried.verticalAccEst = true;
1025+
moduleQueried.nedNorthVel = true;
1026+
moduleQueried.nedEastVel = true;
1027+
moduleQueried.nedDownVel = true;
1028+
10161029
moduleQueried.SIV = true;
10171030
moduleQueried.fixType = true;
10181031
moduleQueried.carrierSolution = true;
@@ -3527,6 +3540,56 @@ int32_t SFE_UBLOX_GPS::getAltitudeMSL(uint16_t maxWait)
35273540
return (altitudeMSL);
35283541
}
35293542

3543+
int32_t SFE_UBLOX_GPS::getHorizontalAccEst(uint16_t maxWait)
3544+
{
3545+
if (moduleQueried.horizontalAccEst == false)
3546+
getPVT(maxWait);
3547+
moduleQueried.horizontalAccEst = false; //Since we are about to give this to user, mark this data as stale
3548+
moduleQueried.all = false;
3549+
3550+
return (horizontalAccEst);
3551+
}
3552+
3553+
int32_t SFE_UBLOX_GPS::getVerticalAccEst(uint16_t maxWait)
3554+
{
3555+
if (moduleQueried.verticalAccEst == false)
3556+
getPVT(maxWait);
3557+
moduleQueried.verticalAccEst = false; //Since we are about to give this to user, mark this data as stale
3558+
moduleQueried.all = false;
3559+
3560+
return (verticalAccEst);
3561+
}
3562+
3563+
int32_t SFE_UBLOX_GPS::getNedNorthVel(uint16_t maxWait)
3564+
{
3565+
if (moduleQueried.nedNorthVel == false)
3566+
getPVT(maxWait);
3567+
moduleQueried.nedNorthVel = false; //Since we are about to give this to user, mark this data as stale
3568+
moduleQueried.all = false;
3569+
3570+
return (nedNorthVel);
3571+
}
3572+
3573+
int32_t SFE_UBLOX_GPS::getNedEastVel(uint16_t maxWait)
3574+
{
3575+
if (moduleQueried.nedEastVel == false)
3576+
getPVT(maxWait);
3577+
moduleQueried.nedEastVel = false; //Since we are about to give this to user, mark this data as stale
3578+
moduleQueried.all = false;
3579+
3580+
return (nedEastVel);
3581+
}
3582+
3583+
int32_t SFE_UBLOX_GPS::getNedDownVel(uint16_t maxWait)
3584+
{
3585+
if (moduleQueried.nedDownVel == false)
3586+
getPVT(maxWait);
3587+
moduleQueried.nedDownVel = false; //Since we are about to give this to user, mark this data as stale
3588+
moduleQueried.all = false;
3589+
3590+
return (nedDownVel);
3591+
}
3592+
35303593
//Get the number of satellites used in fix
35313594
uint8_t SFE_UBLOX_GPS::getSIV(uint16_t maxWait)
35323595
{

src/SparkFun_Ublox_Arduino_Library.h

+19
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,13 @@ class SFE_UBLOX_GPS
515515
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.
516516
int32_t getAltitude(uint16_t maxWait = getPVTmaxWait); //Returns the current altitude in mm above ellipsoid
517517
int32_t getAltitudeMSL(uint16_t maxWait = getPVTmaxWait); //Returns the current altitude in mm above mean sea level
518+
519+
int32_t getHorizontalAccEst(uint16_t maxWait = getPVTmaxWait);
520+
int32_t getVerticalAccEst(uint16_t maxWait = getPVTmaxWait);
521+
int32_t getNedNorthVel(uint16_t maxWait = getPVTmaxWait);
522+
int32_t getNedEastVel(uint16_t maxWait = getPVTmaxWait);
523+
int32_t getNedDownVel(uint16_t maxWait = getPVTmaxWait);
524+
518525
uint8_t getSIV(uint16_t maxWait = getPVTmaxWait); //Returns number of sats used in fix
519526
uint8_t getFixType(uint16_t maxWait = getPVTmaxWait); //Returns the type of fix: 0=no, 3=3D, 4=GNSS+Deadreckoning
520527
uint8_t getCarrierSolutionType(uint16_t maxWait = getPVTmaxWait); //Returns RTK solution: 0=no, 1=float solution, 2=fixed solution
@@ -709,6 +716,11 @@ class SFE_UBLOX_GPS
709716
int32_t longitude; //Degrees * 10^-7 (more accurate than floats)
710717
int32_t altitude; //Number of mm above ellipsoid
711718
int32_t altitudeMSL; //Number of mm above Mean Sea Level
719+
uint32_t horizontalAccEst;
720+
uint32_t verticalAccEst;
721+
int32_t nedNorthVel;
722+
int32_t nedEastVel;
723+
int32_t nedDownVel;
712724
uint8_t SIV; //Number of satellites used in position solution
713725
uint8_t fixType; //Tells us when we have a solution aka lock
714726
uint8_t carrierSolution; //Tells us when we have an RTK float/fixed solution
@@ -908,6 +920,13 @@ uint16_t eastingDOP; // Easting dilution of precision * 10^-2
908920
uint32_t latitude : 1;
909921
uint32_t altitude : 1;
910922
uint32_t altitudeMSL : 1;
923+
924+
uint32_t horizontalAccEst : 1;
925+
uint32_t verticalAccEst : 1;
926+
uint32_t nedNorthVel : 1;
927+
uint32_t nedEastVel : 1;
928+
uint32_t nedDownVel : 1;
929+
911930
uint32_t SIV : 1;
912931
uint32_t fixType : 1;
913932
uint32_t carrierSolution : 1;

0 commit comments

Comments
 (0)