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

Commit ec1661b

Browse files
committed
NAV-PVT velocity parameters parsed.
1 parent 5edcbf6 commit ec1661b

File tree

2 files changed

+83
-1
lines changed

2 files changed

+83
-1
lines changed

src/SparkFun_Ublox_Arduino_Library.cpp

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,12 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
986986
latitude = extractLong(28 - startingSpot);
987987
altitude = extractLong(32 - startingSpot);
988988
altitudeMSL = extractLong(36 - startingSpot);
989+
horizontalAccEst = extractLong(40 - startingSpot);
990+
verticalAccEst = extractLong(44 - startingSpot);
991+
nedNorthVel = extractLong(48 - startingSpot);
992+
nedEastVel = extractLong(52 - startingSpot);
993+
nedDownVel = extractLong(56 - startingSpot);
994+
989995
groundSpeed = extractLong(60 - startingSpot);
990996
headingOfMotion = extractLong(64 - startingSpot);
991997
pDOP = extractInt(76 - startingSpot);
@@ -1007,6 +1013,13 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
10071013
moduleQueried.latitude = true;
10081014
moduleQueried.altitude = true;
10091015
moduleQueried.altitudeMSL = true;
1016+
1017+
moduleQueried.horizontalAccEst = true;
1018+
moduleQueried.verticalAccEst = true;
1019+
moduleQueried.nedNorthVel = true;
1020+
moduleQueried.nedEastVel = true;
1021+
moduleQueried.nedDownVel = true;
1022+
10101023
moduleQueried.SIV = true;
10111024
moduleQueried.fixType = true;
10121025
moduleQueried.carrierSolution = true;
@@ -3308,6 +3321,56 @@ int32_t SFE_UBLOX_GPS::getAltitudeMSL(uint16_t maxWait)
33083321
return (altitudeMSL);
33093322
}
33103323

3324+
int32_t SFE_UBLOX_GPS::getHorizontalAccEst(uint16_t maxWait)
3325+
{
3326+
if (moduleQueried.horizontalAccEst == false)
3327+
getPVT(maxWait);
3328+
moduleQueried.horizontalAccEst = false; //Since we are about to give this to user, mark this data as stale
3329+
moduleQueried.all = false;
3330+
3331+
return (horizontalAccEst);
3332+
}
3333+
3334+
int32_t SFE_UBLOX_GPS::getVerticalAccEst(uint16_t maxWait)
3335+
{
3336+
if (moduleQueried.verticalAccEst == false)
3337+
getPVT(maxWait);
3338+
moduleQueried.verticalAccEst = false; //Since we are about to give this to user, mark this data as stale
3339+
moduleQueried.all = false;
3340+
3341+
return (verticalAccEst);
3342+
}
3343+
3344+
int32_t SFE_UBLOX_GPS::getNedNorthVel(uint16_t maxWait)
3345+
{
3346+
if (moduleQueried.nedNorthVel == false)
3347+
getPVT(maxWait);
3348+
moduleQueried.nedNorthVel = false; //Since we are about to give this to user, mark this data as stale
3349+
moduleQueried.all = false;
3350+
3351+
return (nedNorthVel);
3352+
}
3353+
3354+
int32_t SFE_UBLOX_GPS::getNedEastVel(uint16_t maxWait)
3355+
{
3356+
if (moduleQueried.nedEastVel == false)
3357+
getPVT(maxWait);
3358+
moduleQueried.nedEastVel = false; //Since we are about to give this to user, mark this data as stale
3359+
moduleQueried.all = false;
3360+
3361+
return (nedEastVel);
3362+
}
3363+
3364+
int32_t SFE_UBLOX_GPS::getNedDownVel(uint16_t maxWait)
3365+
{
3366+
if (moduleQueried.nedDownVel == false)
3367+
getPVT(maxWait);
3368+
moduleQueried.nedDownVel = false; //Since we are about to give this to user, mark this data as stale
3369+
moduleQueried.all = false;
3370+
3371+
return (nedDownVel);
3372+
}
3373+
33113374
//Get the number of satellites used in fix
33123375
uint8_t SFE_UBLOX_GPS::getSIV(uint16_t maxWait)
33133376
{
@@ -3800,4 +3863,4 @@ bool SFE_UBLOX_GPS::setStaticPosition(int32_t ecefXOrLat, int8_t ecefXOrLatHP, i
38003863
bool SFE_UBLOX_GPS::setStaticPosition(int32_t ecefXOrLat, int32_t ecefYOrLon, int32_t ecefZOrAlt, bool latlong, uint16_t maxWait)
38013864
{
38023865
return (setStaticPosition(ecefXOrLat, 0, ecefYOrLon, 0, ecefZOrAlt, 0, latlong, maxWait));
3803-
}
3866+
}

src/SparkFun_Ublox_Arduino_Library.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,13 @@ class SFE_UBLOX_GPS
508508
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.
509509
int32_t getAltitude(uint16_t maxWait = getPVTmaxWait); //Returns the current altitude in mm above ellipsoid
510510
int32_t getAltitudeMSL(uint16_t maxWait = getPVTmaxWait); //Returns the current altitude in mm above mean sea level
511+
512+
int32_t getHorizontalAccEst(uint16_t maxWait = getPVTmaxWait);
513+
int32_t getVerticalAccEst(uint16_t maxWait = getPVTmaxWait);
514+
int32_t getNedNorthVel(uint16_t maxWait = getPVTmaxWait);
515+
int32_t getNedEastVel(uint16_t maxWait = getPVTmaxWait);
516+
int32_t getNedDownVel(uint16_t maxWait = getPVTmaxWait);
517+
511518
uint8_t getSIV(uint16_t maxWait = getPVTmaxWait); //Returns number of sats used in fix
512519
uint8_t getFixType(uint16_t maxWait = getPVTmaxWait); //Returns the type of fix: 0=no, 3=3D, 4=GNSS+Deadreckoning
513520
uint8_t getCarrierSolutionType(uint16_t maxWait = getPVTmaxWait); //Returns RTK solution: 0=no, 1=float solution, 2=fixed solution
@@ -691,6 +698,11 @@ class SFE_UBLOX_GPS
691698
int32_t longitude; //Degrees * 10^-7 (more accurate than floats)
692699
int32_t altitude; //Number of mm above ellipsoid
693700
int32_t altitudeMSL; //Number of mm above Mean Sea Level
701+
uint32_t horizontalAccEst;
702+
uint32_t verticalAccEst;
703+
int32_t nedNorthVel;
704+
int32_t nedEastVel;
705+
int32_t nedDownVel;
694706
uint8_t SIV; //Number of satellites used in position solution
695707
uint8_t fixType; //Tells us when we have a solution aka lock
696708
uint8_t carrierSolution; //Tells us when we have an RTK float/fixed solution
@@ -877,6 +889,13 @@ class SFE_UBLOX_GPS
877889
uint32_t latitude : 1;
878890
uint32_t altitude : 1;
879891
uint32_t altitudeMSL : 1;
892+
893+
uint32_t horizontalAccEst : 1;
894+
uint32_t verticalAccEst : 1;
895+
uint32_t nedNorthVel : 1;
896+
uint32_t nedEastVel : 1;
897+
uint32_t nedDownVel : 1;
898+
880899
uint32_t SIV : 1;
881900
uint32_t fixType : 1;
882901
uint32_t carrierSolution : 1;

0 commit comments

Comments
 (0)