fix some issues

This commit is contained in:
2022-12-20 23:55:55 +01:00
parent 16ac28e997
commit 6590f26e44
8 changed files with 29 additions and 18 deletions
+1 -1
View File
@@ -55,7 +55,7 @@
#ifdef NTRIP_RTK2GO
#define NTRIP_HOST "rtk2go.com"
#define NTRIP_PORT 2101
#define NTRIP_MOUNT_POINT "uithuizermeeden"
#define NTRIP_MOUNT_POINT "GER-Papenburg"
#define NTRIP_USER "alklein1@gmx.de"
#define NTRIP_PASSWORD "none"
#endif // NTRIP_RTK2GO
+7 -3
View File
@@ -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() {
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();
}
+1
View File
@@ -214,6 +214,7 @@ class Navigation {
static uint32_t ubxUpdateTimeStatic;
static bool outputStatusPrintPVTdata;
static bool newData;
};
#endif // NAVIGATION_H
+2 -1
View File
@@ -56,8 +56,9 @@ void Point::init(uint32_t horizontalAccuracy) {
if (horizontalAccuracy > 9999)
this->accuracy = PointAccuracy::fourDigOfCM;
else if (horizontalAccuracy > 999)
this->accuracy = PointAccuracy::threeDigOfCM
this->accuracy = PointAccuracy::threeDigOfCM;
else if (horizontalAccuracy > 99)
this->accuracy = PointAccuracy::twoDigOfCM;
}
+9 -8
View File
@@ -22,14 +22,6 @@
#define ROUTE_DISTANCE_BETWEEN_LATITUDE 111300
#define ROUTE_PI 3.14159265358979323846
enum PointAccuracy {
none,
fourDigOfCM,
threeDigOfCM,
twoDigOfCM,
oneDigOfCM
};
/**
* @brief A to handle points on the earth
*
@@ -38,6 +30,15 @@ enum PointAccuracy {
*/
class Point{
public:
enum PointAccuracy {
none,
fourDigOfCM,
threeDigOfCM,
twoDigOfCM,
oneDigOfCM
};
/**
* @brief Construct a new Point object
*
+2
View File
@@ -109,10 +109,12 @@ void NTRIPClient::gpsConfiguration() {
}
bool NTRIPClient::setActivated(bool b) {
// std::cout << "NTRIPClient::setActivated: b - " << b << std::endl;
if (b && this->state != NTRIPClientStates::notAvailable)
this->activated = true;
else if (b)
return false;
else
this->activated = false;
return true;
+3 -1
View File
@@ -201,7 +201,8 @@ void MenuGPS::printPage() const {
void MenuGPS::runCommand() const {
switch (this->currentPage) {
case 3:
case 3: {
// std::cout << "MenuGPS::runCommand " << this->ntripClient->getClientState() << std::endl;
if (this->ntripClient->getClientState() == NTRIPClientStates::pushData)
this->ntripClient->setActivated(false);
else if (this->ntripClient->getClientState() != NTRIPClientStates::notAvailable)
@@ -209,3 +210,4 @@ void MenuGPS::runCommand() const {
break;
}
}
}
+2 -2
View File
@@ -67,7 +67,7 @@ void makeMenu(void);
void setup() {
Serial.begin(115200);
DebugTimes::setConsolOutput(true);
// DebugTimes::setConsolOutput(true);
DebugTimes setupTime;
char wifiIndicator = 'X';
@@ -130,7 +130,7 @@ void loop() {
DebugTimes wifiTime;
Network::checkWiFi();
Network::checkMQTT();
wifiTime.stopConsol("WiFi-Time", 5);
wifiTime.stopConsol("WiFi-Time", 10);
}
driveManager->loop();