compilation works again

This commit is contained in:
2023-09-04 13:30:34 +02:00
parent 5f650982a7
commit 6a76470f45
23 changed files with 285 additions and 321 deletions
+17 -37
View File
@@ -11,18 +11,12 @@
#include "navigation.h"
bool Navigation::outputStatusPrintPVTdata = false;
bool Navigation::newData = false;
uint32_t Navigation::ubxUpdateTimeStatic = 0;
UBX_NAV_PVT_data_t* Navigation::ubxDataStatic = nullptr;
Navigation::Navigation(Route* route) {
Navigation::Navigation(const SensorData* sensorData, Route* route) {
this->sensorData = sensorData;
this->init(route);
}
void Navigation::init(Route* route) {
if (route)
this->route = route;
else
@@ -33,23 +27,9 @@ void Navigation::init(Route* route) {
Navigation::~Navigation() {
delete this->route;
if (this->ntripClient)
delete this->ntripClient;
}
void Navigation::initNtrip(String host, uint16_t port, String mountPoint, String user, String password) {
this->ntripClient = new NTRIPClient(this->gps, host.c_str(), port, mountPoint.c_str(), user.c_str(), password.c_str());
this->ntripClient->gpsConfiguration();
this->ntripClient->loop();
this->ntripClient->setActivated(false);
this->isNtripInit = true;
this->addChildComponent(this->ntripClient);
}
void Navigation::run() {
this->updateMagneticDeclination();
}
void Navigation::run() {}
void Navigation::newRoute() {
if (this->route)
@@ -119,31 +99,31 @@ Navigation::Status Navigation::addCurrentPosToRoute() {
return Status::Unchanged;
}
void Navigation::updateCurrentLocation() {
if (Navigation::ubxUpdateTimeStatic == this->ubxUpdateTime)
return;
// void Navigation::updateCurrentLocation() {
// if (Navigation::ubxUpdateTimeStatic == this->ubxUpdateTime)
// return;
this->ubxData = Navigation::ubxDataStatic;
this->ubxUpdateTime = Navigation::ubxUpdateTimeStatic;
// this->ubxData = Navigation::ubxDataStatic;
// this->ubxUpdateTime = Navigation::ubxUpdateTimeStatic;
Point::Coordinates coords;
coords.lat = this->ubxData->lat / 10000000.0;
coords.lon = this->ubxData->lon / 10000000.0;
// Point::Coordinates coords;
// coords.lat = this->ubxData->lat / 10000000.0;
// coords.lon = this->ubxData->lon / 10000000.0;
this->currentPosition = Point(coords, this->ubxData->hAcc);
}
// this->currentPosition = Point(coords, this->ubxData->hAcc);
// }
int16_t Navigation::calculateCourseCorrection(Point& point) {
int16_t targetCourse = point.courseTo(this->targetPoint);
int16_t correctionCourse;
if (this->calcAzimuthState == CalcAzimuthState::Good
|| this->calcAzimuthState == CalcAzimuthState::Super)
if (this->sensorData->getCalcAzimuthState() == CalcAzimuth::State::Good
|| this->sensorData->getCalcAzimuthState() == CalcAzimuth::State::Super)
{
correctionCourse = targetCourse - this->calcAzimuth;
correctionCourse = targetCourse - this->sensorData->getCalcAzimuth();
this->lastUsedCalcAzimuth = true;
} else {
correctionCourse = targetCourse - this->realAzimuth;
correctionCourse = targetCourse - this->sensorData->getRealAzimuth();
this->lastUsedCalcAzimuth = false;
}