fix some issues
This commit is contained in:
@@ -55,7 +55,7 @@
|
|||||||
#ifdef NTRIP_RTK2GO
|
#ifdef NTRIP_RTK2GO
|
||||||
#define NTRIP_HOST "rtk2go.com"
|
#define NTRIP_HOST "rtk2go.com"
|
||||||
#define NTRIP_PORT 2101
|
#define NTRIP_PORT 2101
|
||||||
#define NTRIP_MOUNT_POINT "uithuizermeeden"
|
#define NTRIP_MOUNT_POINT "GER-Papenburg"
|
||||||
#define NTRIP_USER "alklein1@gmx.de"
|
#define NTRIP_USER "alklein1@gmx.de"
|
||||||
#define NTRIP_PASSWORD "none"
|
#define NTRIP_PASSWORD "none"
|
||||||
#endif // NTRIP_RTK2GO
|
#endif // NTRIP_RTK2GO
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "navigation.h"
|
#include "navigation.h"
|
||||||
|
|
||||||
bool Navigation::outputStatusPrintPVTdata = false;
|
bool Navigation::outputStatusPrintPVTdata = false;
|
||||||
|
bool Navigation::newData = false;
|
||||||
uint32_t Navigation::ubxUpdateTimeStatic = 0;
|
uint32_t Navigation::ubxUpdateTimeStatic = 0;
|
||||||
UBX_NAV_PVT_data_t* Navigation::ubxDataStatic = nullptr;
|
UBX_NAV_PVT_data_t* Navigation::ubxDataStatic = nullptr;
|
||||||
|
|
||||||
@@ -81,6 +82,11 @@ void Navigation::loop() {
|
|||||||
this->gps->checkUblox();
|
this->gps->checkUblox();
|
||||||
this->gps->checkCallbacks();
|
this->gps->checkCallbacks();
|
||||||
|
|
||||||
|
if (Navigation::newData) {
|
||||||
|
this->updateCurrentLocation();
|
||||||
|
Navigation::newData = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (this->isNtripInit)
|
if (this->isNtripInit)
|
||||||
this->ntripClient->loop();
|
this->ntripClient->loop();
|
||||||
}
|
}
|
||||||
@@ -163,14 +169,11 @@ void Navigation::updateCurrentLocation() {
|
|||||||
Point p;
|
Point p;
|
||||||
p.lon = this->ubxData->lon;
|
p.lon = this->ubxData->lon;
|
||||||
p.lat = this->ubxData->lat;
|
p.lat = this->ubxData->lat;
|
||||||
p.fixType = this->ubxData->fixType;
|
|
||||||
p.carrierSolution = this->ubxData->flags.all;
|
|
||||||
|
|
||||||
this->currentPosition = p;
|
this->currentPosition = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Navigation::nextPoint() {
|
bool Navigation::nextPoint() {
|
||||||
|
|
||||||
if (!this->navigationStarted)
|
if (!this->navigationStarted)
|
||||||
return false;
|
return false;
|
||||||
return this->setTargetPoint(this->route->getNextPoint());
|
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) {
|
void Navigation::savePVTdata(UBX_NAV_PVT_data_t *ubxDataStruct) {
|
||||||
Navigation::printPVTdata(ubxDataStruct);
|
Navigation::printPVTdata(ubxDataStruct);
|
||||||
|
|
||||||
|
Navigation::newData = true;
|
||||||
Navigation::ubxDataStatic = ubxDataStruct;
|
Navigation::ubxDataStatic = ubxDataStruct;
|
||||||
Navigation::ubxUpdateTimeStatic = millis();
|
Navigation::ubxUpdateTimeStatic = millis();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -214,6 +214,7 @@ class Navigation {
|
|||||||
static uint32_t ubxUpdateTimeStatic;
|
static uint32_t ubxUpdateTimeStatic;
|
||||||
|
|
||||||
static bool outputStatusPrintPVTdata;
|
static bool outputStatusPrintPVTdata;
|
||||||
|
static bool newData;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // NAVIGATION_H
|
#endif // NAVIGATION_H
|
||||||
|
|||||||
@@ -56,8 +56,9 @@ void Point::init(uint32_t horizontalAccuracy) {
|
|||||||
if (horizontalAccuracy > 9999)
|
if (horizontalAccuracy > 9999)
|
||||||
this->accuracy = PointAccuracy::fourDigOfCM;
|
this->accuracy = PointAccuracy::fourDigOfCM;
|
||||||
else if (horizontalAccuracy > 999)
|
else if (horizontalAccuracy > 999)
|
||||||
this->accuracy = PointAccuracy::threeDigOfCM
|
this->accuracy = PointAccuracy::threeDigOfCM;
|
||||||
else if (horizontalAccuracy > 99)
|
else if (horizontalAccuracy > 99)
|
||||||
|
this->accuracy = PointAccuracy::twoDigOfCM;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,14 +22,6 @@
|
|||||||
#define ROUTE_DISTANCE_BETWEEN_LATITUDE 111300
|
#define ROUTE_DISTANCE_BETWEEN_LATITUDE 111300
|
||||||
#define ROUTE_PI 3.14159265358979323846
|
#define ROUTE_PI 3.14159265358979323846
|
||||||
|
|
||||||
enum PointAccuracy {
|
|
||||||
none,
|
|
||||||
fourDigOfCM,
|
|
||||||
threeDigOfCM,
|
|
||||||
twoDigOfCM,
|
|
||||||
oneDigOfCM
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief A to handle points on the earth
|
* @brief A to handle points on the earth
|
||||||
*
|
*
|
||||||
@@ -38,6 +30,15 @@ enum PointAccuracy {
|
|||||||
*/
|
*/
|
||||||
class Point{
|
class Point{
|
||||||
public:
|
public:
|
||||||
|
enum PointAccuracy {
|
||||||
|
none,
|
||||||
|
fourDigOfCM,
|
||||||
|
threeDigOfCM,
|
||||||
|
twoDigOfCM,
|
||||||
|
oneDigOfCM
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Construct a new Point object
|
* @brief Construct a new Point object
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -109,11 +109,13 @@ void NTRIPClient::gpsConfiguration() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool NTRIPClient::setActivated(bool b) {
|
bool NTRIPClient::setActivated(bool b) {
|
||||||
|
// std::cout << "NTRIPClient::setActivated: b - " << b << std::endl;
|
||||||
if (b && this->state != NTRIPClientStates::notAvailable)
|
if (b && this->state != NTRIPClientStates::notAvailable)
|
||||||
this->activated = true;
|
this->activated = true;
|
||||||
else if (b)
|
else if (b)
|
||||||
return false;
|
return false;
|
||||||
this->activated = false;
|
else
|
||||||
|
this->activated = false;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,11 +201,13 @@ void MenuGPS::printPage() const {
|
|||||||
|
|
||||||
void MenuGPS::runCommand() const {
|
void MenuGPS::runCommand() const {
|
||||||
switch (this->currentPage) {
|
switch (this->currentPage) {
|
||||||
case 3:
|
case 3: {
|
||||||
|
// std::cout << "MenuGPS::runCommand " << this->ntripClient->getClientState() << std::endl;
|
||||||
if (this->ntripClient->getClientState() == NTRIPClientStates::pushData)
|
if (this->ntripClient->getClientState() == NTRIPClientStates::pushData)
|
||||||
this->ntripClient->setActivated(false);
|
this->ntripClient->setActivated(false);
|
||||||
else if (this->ntripClient->getClientState() != NTRIPClientStates::notAvailable)
|
else if (this->ntripClient->getClientState() != NTRIPClientStates::notAvailable)
|
||||||
this->ntripClient->setActivated(true);
|
this->ntripClient->setActivated(true);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -67,7 +67,7 @@ void makeMenu(void);
|
|||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
DebugTimes::setConsolOutput(true);
|
// DebugTimes::setConsolOutput(true);
|
||||||
DebugTimes setupTime;
|
DebugTimes setupTime;
|
||||||
char wifiIndicator = 'X';
|
char wifiIndicator = 'X';
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ void loop() {
|
|||||||
DebugTimes wifiTime;
|
DebugTimes wifiTime;
|
||||||
Network::checkWiFi();
|
Network::checkWiFi();
|
||||||
Network::checkMQTT();
|
Network::checkMQTT();
|
||||||
wifiTime.stopConsol("WiFi-Time", 5);
|
wifiTime.stopConsol("WiFi-Time", 10);
|
||||||
}
|
}
|
||||||
driveManager->loop();
|
driveManager->loop();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user