fix some issues
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "navigation.h"
|
||||
|
||||
bool Navigation::outputStatusPrintPVTdata = false;
|
||||
bool Navigation::newData = false;
|
||||
uint32_t Navigation::ubxUpdateTimeStatic = 0;
|
||||
UBX_NAV_PVT_data_t* Navigation::ubxDataStatic = nullptr;
|
||||
|
||||
@@ -81,6 +82,11 @@ void Navigation::loop() {
|
||||
this->gps->checkUblox();
|
||||
this->gps->checkCallbacks();
|
||||
|
||||
if (Navigation::newData) {
|
||||
this->updateCurrentLocation();
|
||||
Navigation::newData = false;
|
||||
}
|
||||
|
||||
if (this->isNtripInit)
|
||||
this->ntripClient->loop();
|
||||
}
|
||||
@@ -163,14 +169,11 @@ void Navigation::updateCurrentLocation() {
|
||||
Point p;
|
||||
p.lon = this->ubxData->lon;
|
||||
p.lat = this->ubxData->lat;
|
||||
p.fixType = this->ubxData->fixType;
|
||||
p.carrierSolution = this->ubxData->flags.all;
|
||||
|
||||
this->currentPosition = p;
|
||||
}
|
||||
|
||||
bool Navigation::nextPoint() {
|
||||
|
||||
bool Navigation::nextPoint() {
|
||||
if (!this->navigationStarted)
|
||||
return false;
|
||||
return this->setTargetPoint(this->route->getNextPoint());
|
||||
@@ -238,6 +241,7 @@ void Navigation::printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct) {
|
||||
void Navigation::savePVTdata(UBX_NAV_PVT_data_t *ubxDataStruct) {
|
||||
Navigation::printPVTdata(ubxDataStruct);
|
||||
|
||||
Navigation::newData = true;
|
||||
Navigation::ubxDataStatic = ubxDataStruct;
|
||||
Navigation::ubxUpdateTimeStatic = millis();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user