-
Notifications
You must be signed in to change notification settings - Fork 83
Efficiently accessing accuracy #131
Description
Efficiently accessing accuracy
With AutoPVT I can get most of the current values pretty efficiently, and keep my display and button presses quite responsive on a SAMD51 chip.
But once I start reading the vertical and horizontal accuracy every time getPVT() returns true, once a second the UI responsiveness stalls for a good .25 seconds or more.
I realized this is because highResModuleQueried isn't updated when you enable AutoPVT.
So I added a similar method to do the same thing as set autopvt to enable sending HPPOSLLH on a regular interval:
boolean SFE_UBLOX_GPS::setAutoHPPOSLLH(boolean enable, uint16_t maxWait)
{
packetCfg.cls = UBX_CLASS_CFG;
packetCfg.id = UBX_CFG_MSG;
packetCfg.len = 3;
packetCfg.startingSpot = 0;
payloadCfg[0] = UBX_CLASS_NAV;
payloadCfg[1] = UBX_NAV_HPPOSLLH;
payloadCfg[2] = enable ? 1 : 0; // rate relative to navigation freq.
boolean ok = ((sendCommand(&packetCfg, maxWait)) == SFE_UBLOX_STATUS_DATA_SENT); // We are only expecting an ACK
if (ok)
{
autoHPPOSLLH = enable;
}
highResModuleQueried.all = false;
return ok;
}The sendCommand does return success, and I do see the messages coming through in the debug log after this, but it doesn't appear to actually parse them.
In getHPPOSLLH() I also added the first 4 lines here to hopefully avoid reading them over and over again, but still no luck:
boolean SFE_UBLOX_GPS::getHPPOSLLH(uint16_t maxWait)
{
+ if(autoHPPOSLLH)
+ {
+ checkUbloxInternal(&packetCfg, UBX_CLASS_NAV, UBX_NAV_HPPOSLLH);
+ return highResModuleQueried.all;
+ }
//The GPS is not automatically reporting navigation position so we have to poll explicitly
packetCfg.cls = UBX_CLASS_NAV;
packetCfg.id = UBX_NAV_HPPOSLLH;
packetCfg.len = 0;
return (sendCommand(&packetCfg, maxWait) == SFE_UBLOX_STATUS_DATA_RECEIVED); // We are only expecting data (no ACK)
}What am I missing here to make this work?
Your workbench
- What development board or microcontroller are you using?
SparkFun SAMD51 Thing Plus - What version of hardware or breakout board are you using?
? - How is the breakout board wired to your microcontroller?
I2C - How is everything being powered?
USB from SAM51 ->, power transfered to GPS via IC2 - Are there any additional details that may help us help you?
Here's the log I see. Notice how the message is being ignored:
heckUbloxI2C: Large packet of 144 bytes received
Incoming: Size: 92 Received: CLS:NAV ID:PVT Len: 0x5C Payload: [TRUNCATED]
packetCfg now valid
packetAck now valid
packetCfg classAndIDmatch
packetAck classAndIDmatch
Incoming: Size: 36 Received: CLS:NAV ID:0x14 Len: 0x24 Payload: IGNORED
packetCfg now valid
packetAck now valid
packetAck classAndIDmatch
checkUbloxI2C: OK, zero bytes available
checkUbloxI2C: OK, zero bytes available
checkUbloxI2C: OK, zero bytes available
checkUbloxI2C: OK, zero bytes available