@@ -1039,10 +1039,15 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
1039
1039
nedNorthVel = extractSignedLong (48 - startingSpot);
1040
1040
nedEastVel = extractSignedLong (52 - startingSpot);
1041
1041
nedDownVel = extractSignedLong (56 - startingSpot);
1042
-
1043
1042
groundSpeed = extractSignedLong (60 - startingSpot);
1044
1043
headingOfMotion = extractSignedLong (64 - startingSpot);
1044
+ speedAccEst = extractLong (68 - startingSpot);
1045
+ headingAccEst = extractLong (72 - startingSpot);
1045
1046
pDOP = extractInt (76 - startingSpot);
1047
+ invalidLlh = extractByte (78 - startingSpot) & 0x1 ;
1048
+ headVeh = extractSignedLong (84 - startingSpot);
1049
+ magDec = extractSignedInt (88 - startingSpot);
1050
+ magAcc = extractInt (90 - startingSpot);
1046
1051
1047
1052
// Mark all datums as fresh (not read before)
1048
1053
moduleQueried.gpsiTOW = true ;
@@ -1063,19 +1068,23 @@ void SFE_UBLOX_GPS::processUBXpacket(ubxPacket *msg)
1063
1068
moduleQueried.latitude = true ;
1064
1069
moduleQueried.altitude = true ;
1065
1070
moduleQueried.altitudeMSL = true ;
1066
-
1067
1071
moduleQueried.horizontalAccEst = true ;
1068
1072
moduleQueried.verticalAccEst = true ;
1069
1073
moduleQueried.nedNorthVel = true ;
1070
1074
moduleQueried.nedEastVel = true ;
1071
1075
moduleQueried.nedDownVel = true ;
1072
-
1073
1076
moduleQueried.SIV = true ;
1074
1077
moduleQueried.fixType = true ;
1075
1078
moduleQueried.carrierSolution = true ;
1076
1079
moduleQueried.groundSpeed = true ;
1077
1080
moduleQueried.headingOfMotion = true ;
1081
+ moduleQueried.speedAccEst = true ;
1082
+ moduleQueried.headingAccEst = true ;
1078
1083
moduleQueried.pDOP = true ;
1084
+ moduleQueried.invalidLlh = true ;
1085
+ moduleQueried.headVeh = true ;
1086
+ moduleQueried.magDec = true ;
1087
+ moduleQueried.magAcc = true ;
1079
1088
}
1080
1089
else if (msg->id == UBX_NAV_HPPOSLLH && msg->len == 36 )
1081
1090
{
@@ -3111,6 +3120,19 @@ uint16_t SFE_UBLOX_GPS::extractInt(uint8_t spotToStart)
3111
3120
return (val);
3112
3121
}
3113
3122
3123
+ // Just so there is no ambiguity about whether a uint16_t will cast to a int16_t correctly...
3124
+ int16_t SFE_UBLOX_GPS::extractSignedInt (int8_t spotToStart)
3125
+ {
3126
+ union // Use a union to convert from uint16_t to int16_t
3127
+ {
3128
+ uint16_t unsignedInt;
3129
+ int16_t signedInt;
3130
+ } stSignedInt;
3131
+
3132
+ stSignedInt.unsignedInt = extractInt (spotToStart);
3133
+ return (stSignedInt.signedInt );
3134
+ }
3135
+
3114
3136
// Given a spot, extract a byte from the payload
3115
3137
uint8_t SFE_UBLOX_GPS::extractByte (uint8_t spotToStart)
3116
3138
{
@@ -3195,6 +3217,54 @@ bool SFE_UBLOX_GPS::getTimeValid(uint16_t maxWait)
3195
3217
return (gpsTimeValid);
3196
3218
}
3197
3219
3220
+ uint32_t SFE_UBLOX_GPS::getSpeedAccEst (uint16_t maxWait)
3221
+ {
3222
+ if (moduleQueried.speedAccEst == false )
3223
+ getPVT (maxWait);
3224
+ moduleQueried.speedAccEst = false ; // Since we are about to give this to user, mark this data as stale
3225
+ return (speedAccEst);
3226
+ }
3227
+
3228
+ uint32_t SFE_UBLOX_GPS::getHeadingAccEst (uint16_t maxWait)
3229
+ {
3230
+ if (moduleQueried.headingAccEst == false )
3231
+ getPVT (maxWait);
3232
+ moduleQueried.headingAccEst = false ; // Since we are about to give this to user, mark this data as stale
3233
+ return (headingAccEst);
3234
+ }
3235
+
3236
+ bool SFE_UBLOX_GPS::getInvalidLlh (uint16_t maxWait)
3237
+ {
3238
+ if (moduleQueried.invalidLlh == false )
3239
+ getPVT (maxWait);
3240
+ moduleQueried.invalidLlh = false ; // Since we are about to give this to user, mark this data as stale
3241
+ return (invalidLlh);
3242
+ }
3243
+
3244
+ int32_t SFE_UBLOX_GPS::getHeadVeh (uint16_t maxWait)
3245
+ {
3246
+ if (moduleQueried.headVeh == false )
3247
+ getPVT (maxWait);
3248
+ moduleQueried.headVeh = false ; // Since we are about to give this to user, mark this data as stale
3249
+ return (headVeh);
3250
+ }
3251
+
3252
+ int16_t SFE_UBLOX_GPS::getMagDec (uint16_t maxWait)
3253
+ {
3254
+ if (moduleQueried.magDec == false )
3255
+ getPVT (maxWait);
3256
+ moduleQueried.magDec = false ; // Since we are about to give this to user, mark this data as stale
3257
+ return (magDec);
3258
+ }
3259
+
3260
+ uint16_t SFE_UBLOX_GPS::getMagAcc (uint16_t maxWait)
3261
+ {
3262
+ if (moduleQueried.magAcc == false )
3263
+ getPVT (maxWait);
3264
+ moduleQueried.magAcc = false ; // Since we are about to give this to user, mark this data as stale
3265
+ return (magAcc);
3266
+ }
3267
+
3198
3268
// Get the current millisecond
3199
3269
uint16_t SFE_UBLOX_GPS::getMillisecond (uint16_t maxWait)
3200
3270
{
0 commit comments