compilation works again
This commit is contained in:
@@ -11,14 +11,14 @@
|
||||
|
||||
#include "menuGPS.h"
|
||||
|
||||
MenuGPS::MenuGPS(DriveManager* driveManager) :
|
||||
MenuGPS::MenuGPS(SensorData* sensorData) :
|
||||
MenuInformationSites(10) {
|
||||
this->navigation = driveManager->getNavigation();
|
||||
this->ntripClient = this->navigation->getNTRIPClient();
|
||||
this->sensorData = sensorData;
|
||||
// this->ntripClient = this->navigation->getNTRIPClient();
|
||||
}
|
||||
|
||||
void MenuGPS::printPage() const {
|
||||
UBX_NAV_PVT_data_t* gpsData = this->navigation->getUbxData();
|
||||
const UBX_NAV_PVT_data_t* gpsData = this->sensorData->getGnssData();
|
||||
uint8_t fixType = 0;
|
||||
if (gpsData)
|
||||
fixType = gpsData->fixType;
|
||||
@@ -66,15 +66,15 @@ void MenuGPS::printPage() const {
|
||||
break;
|
||||
|
||||
case 3: {
|
||||
NTRIPClientStates status = this->ntripClient->getClientState();
|
||||
lineOne = "NTRIP Client is";
|
||||
// NTRIPClientStates status = this->ntripClient->getClientState();
|
||||
// lineOne = "NTRIP Client is";
|
||||
|
||||
if (status == NTRIPClientStates::pushData)
|
||||
lineTwo = "enabled";
|
||||
else if (status == NTRIPClientStates::notAvailable)
|
||||
lineTwo = "not available";
|
||||
else
|
||||
lineTwo = "disabled";
|
||||
// if (status == NTRIPClientStates::pushData)
|
||||
// lineTwo = "enabled";
|
||||
// else if (status == NTRIPClientStates::notAvailable)
|
||||
// lineTwo = "not available";
|
||||
// else
|
||||
// lineTwo = "disabled";
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -134,7 +134,7 @@ void MenuGPS::printPage() const {
|
||||
case 8:
|
||||
lineOne = "Azimuth: ";
|
||||
lineTwo = "";
|
||||
lineTwo.concat(this->navigation->getAzimuth());
|
||||
lineTwo.concat(this->sensorData->getRealAzimuth());
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -148,12 +148,12 @@ void MenuGPS::printPage() const {
|
||||
void MenuGPS::runCommand() const {
|
||||
switch (this->getCurrentPage()) {
|
||||
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)
|
||||
this->ntripClient->setActivated(true);
|
||||
break;
|
||||
// // 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)
|
||||
// this->ntripClient->setActivated(true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
|
||||
|
||||
#include "menuInformationSites.h"
|
||||
#include "driveModi/driveManager.h"
|
||||
#include "navigation.h"
|
||||
#include "sensorData.h"
|
||||
#include "ntripClient.h"
|
||||
|
||||
/**
|
||||
@@ -30,14 +29,14 @@ class MenuGPS : public MenuInformationSites {
|
||||
*
|
||||
* @param gps
|
||||
*/
|
||||
MenuGPS(DriveManager* driveManager);
|
||||
MenuGPS(SensorData* sensorData);
|
||||
|
||||
private:
|
||||
void printPage() const override;
|
||||
void runCommand() const override;
|
||||
|
||||
NTRIPClient* ntripClient;
|
||||
Navigation* navigation;
|
||||
// NTRIPClient* ntripClient;
|
||||
SensorData* sensorData;
|
||||
};
|
||||
|
||||
#endif // MENU_GPS_H
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
void MenuAutopilot::printPage() const {
|
||||
CourseCorrection correction = this->autopilot->getCourseCorrection();
|
||||
UBX_NAV_PVT_data_t* gpsData = this->driveManager->getNavigation()->getUbxData();
|
||||
const UBX_NAV_PVT_data_t* gpsData = this->autopilot->getSensorData()->getGnssData();
|
||||
bool navigationStarted = this->autopilot->getState() >= Autopilot::State::NavigationStarted;
|
||||
|
||||
String distanceString = "";
|
||||
@@ -104,7 +104,7 @@ void MenuAutopilot::printPage() const {
|
||||
break;
|
||||
|
||||
case 3: {
|
||||
NTRIPClientStates status = this->driveManager->getNavigation()->getNTRIPClient()->getClientState();
|
||||
NTRIPClientStates status = this->autopilot->getSensorData()->getNtripClient()->getClientState();
|
||||
uint8_t carrSoln = gpsData->flags.bits.carrSoln;
|
||||
lineOne = "GNSS: ";
|
||||
|
||||
@@ -132,30 +132,30 @@ void MenuAutopilot::printPage() const {
|
||||
|
||||
case 4:
|
||||
|
||||
if (this->autopilot->getSensorData().getCalcAzimuth() == CalcAzimuth::CalcAzimuthState::Good
|
||||
||this->autopilot->getSensorData().getCalcAzimuth() == CalcAzimuth::CalcAzimuthState::Super)
|
||||
if (this->autopilot->getSensorData()->getCalcAzimuth() == CalcAzimuth::State::Good
|
||||
||this->autopilot->getSensorData()->getCalcAzimuth() == CalcAzimuth::State::Super)
|
||||
{
|
||||
lineOne = "Calc Azi: ";
|
||||
lineTwo = "State: ";
|
||||
lineOne.concat(this->autopilot->getSensorData().getCalcAzimuth());
|
||||
switch (this->autopilot->getSensorData().getCalcAzimuthState()) {
|
||||
case CalcAzimuth::CalcAzimuthState::Bad :
|
||||
lineOne.concat(this->autopilot->getSensorData()->getCalcAzimuth());
|
||||
switch (this->autopilot->getSensorData()->getCalcAzimuthState()) {
|
||||
case CalcAzimuth::State::Bad :
|
||||
lineTwo.concat("Bad");
|
||||
break;
|
||||
|
||||
case CalcAzimuth::CalcAzimuthState::Good :
|
||||
case CalcAzimuth::State::Good :
|
||||
lineTwo.concat("Good");
|
||||
break;
|
||||
|
||||
case CalcAzimuth::CalcAzimuthState::Invalid :
|
||||
case CalcAzimuth::State::Invalid :
|
||||
lineTwo.concat("Invalid");
|
||||
break;
|
||||
|
||||
case CalcAzimuth::CalcAzimuthState::Ok :
|
||||
case CalcAzimuth::State::Ok :
|
||||
lineTwo.concat("Ok");
|
||||
break;
|
||||
|
||||
case CalcAzimuth::CalcAzimuthState::Super :
|
||||
case CalcAzimuth::State::Super :
|
||||
lineTwo.concat("Super");
|
||||
break;
|
||||
|
||||
@@ -166,7 +166,7 @@ void MenuAutopilot::printPage() const {
|
||||
} else {
|
||||
lineOne = "Real Azi: ";
|
||||
lineTwo = "";
|
||||
lineOne.concat(this->driveManager->getNavigation()->getAzimuth());
|
||||
lineOne.concat(this->autopilot->getSensorData()->getRealAzimuth());
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -10,13 +10,11 @@
|
||||
*/
|
||||
#include "menuCalibrateCompass.h"
|
||||
|
||||
MenuCalibrateCompass::MenuCalibrateCompass(DriveManager* driveManager) : MenuDriveMode(driveManager) {
|
||||
this->caliCompass = new CalibrateCompass(this->driveManager->getNavigation()->getCompass());
|
||||
}
|
||||
MenuCalibrateCompass::MenuCalibrateCompass(DriveManager* driveManager) : MenuDriveMode(driveManager) {}
|
||||
|
||||
MenuCalibrateCompass::~MenuCalibrateCompass() {
|
||||
delete this->caliCompass;
|
||||
this->manualControl->setCalibrateCompass();
|
||||
this->caliCompassMode->setCalibrateCompass();
|
||||
}
|
||||
|
||||
void MenuCalibrateCompass::printPage() const {
|
||||
@@ -31,7 +29,7 @@ void MenuCalibrateCompass::printPage() const {
|
||||
|
||||
case 1:
|
||||
lineOne = "Azimuth:";
|
||||
lineTwo.concat(this->driveManager->getNavigation()->getAzimuth());
|
||||
lineTwo.concat(this->caliCompassMode->getSensorData()->getRealAzimuth());
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@@ -112,8 +110,9 @@ void MenuCalibrateCompass::printPage() const {
|
||||
|
||||
void MenuCalibrateCompass::init() {
|
||||
this->firstPrint = false;
|
||||
this->driveManager->changeModus(Modi::ManualControl);
|
||||
this->manualControl = (ManualControl*) this->driveManager->getDriveModiPtr();
|
||||
this->driveManager->changeModus(Modi::CalibrateCompass);
|
||||
this->caliCompassMode = (CalibrateCompassM*) this->driveManager->getDriveModiPtr();
|
||||
this->caliCompass = new CalibrateCompass(this->caliCompassMode->getSensorData()->getRealCompass());
|
||||
this->setCountPages(11);
|
||||
this->updateDelay = 500;
|
||||
}
|
||||
@@ -123,12 +122,12 @@ void MenuCalibrateCompass::runCommand() const {
|
||||
case 2:
|
||||
switch (this->caliCompass->getState()) {
|
||||
case CalibrateCompass::State::Ready :
|
||||
this->manualControl->setCalibrateCompass(this->caliCompass);
|
||||
this->caliCompassMode->setCalibrateCompass(this->caliCompass);
|
||||
this->caliCompass->start();
|
||||
break;
|
||||
|
||||
case CalibrateCompass::State::Finished:
|
||||
this->manualControl->setCalibrateCompass();
|
||||
this->caliCompassMode->setCalibrateCompass();
|
||||
this->caliCompass->useData();
|
||||
break;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#define MENU_CALIBRATE_COMPASS_H
|
||||
|
||||
#include "SpecialMenus/driveModi/menuDriveMode.h"
|
||||
#include ""
|
||||
#include "driveModi/Modi/CalibrateCompass/calibrateCompassM.h"
|
||||
#include "calibrateCompass.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
void MenuCaptureRoute::printPage() const {
|
||||
RouteInfo routeInfo = this->captureRoute->getRouteInfo();
|
||||
UBX_NAV_PVT_data_t* gpsData = this->driveManager->getNavigation()->getUbxData();
|
||||
const UBX_NAV_PVT_data_t* gpsData = this->captureRoute->getSensorData()->getGnssData();
|
||||
|
||||
String lineOne = "";
|
||||
String lineTwo = "";
|
||||
@@ -56,7 +56,7 @@ void MenuCaptureRoute::printPage() const {
|
||||
break;
|
||||
|
||||
case 4: {
|
||||
NTRIPClientStates status = this->driveManager->getNavigation()->getNTRIPClient()->getClientState();
|
||||
NTRIPClientStates status = this->captureRoute->getSensorData()->getNtripClient()->getClientState();
|
||||
lineOne = "NTRIP Client is";
|
||||
|
||||
if (status == NTRIPClientStates::pushData)
|
||||
@@ -85,7 +85,7 @@ void MenuCaptureRoute::printPage() const {
|
||||
case 6:
|
||||
lineOne = "hAccuracy: ";
|
||||
lineTwo = "Azimuth: ";
|
||||
lineTwo.concat(this->driveManager->getNavigation()->getAzimuth());
|
||||
lineTwo.concat(this->captureRoute->getSensorData()->getRealAzimuth());
|
||||
if (gpsData->fixType)
|
||||
lineOne.concat(gpsData->hAcc);
|
||||
else
|
||||
|
||||
@@ -12,24 +12,24 @@
|
||||
#include "driveModi/Modi/Autopilot/autopilot.h"
|
||||
#include "autopilot.h"
|
||||
|
||||
DirectionChangeSignal::DirectionChangeSignal(Navigation* navigation) {
|
||||
this->navigation = navigation;
|
||||
DirectionChangeSignal::DirectionChangeSignal(Autopilot* pilot) {
|
||||
this->pilot = pilot;
|
||||
this->action();
|
||||
}
|
||||
|
||||
DirectionChangeSignal::~DirectionChangeSignal() {
|
||||
navigation->disableCalcAzimuth();
|
||||
pilot->getSensorData()->getCalcCompass()->disableCalcAzimuth();
|
||||
}
|
||||
|
||||
void DirectionChangeSignal::action() {
|
||||
this->navigation->drivingDirectionChange();
|
||||
pilot->getSensorData()->getCalcCompass()->drivingDirectionChange(pilot->getSensorData()->getCurrentPos());
|
||||
}
|
||||
|
||||
|
||||
Autopilot::Autopilot(DriveModiParams params, Navigation* navigation)
|
||||
: ManualControl(params) {
|
||||
this->setInputMode(ManualControl::InputMode::Digital);
|
||||
this->directionChangeSignal = new DirectionChangeSignal(navigation);
|
||||
this->directionChangeSignal = new DirectionChangeSignal(this);
|
||||
this->setDirectionChangeCallback(this->directionChangeSignal);
|
||||
this->navigation = navigation;
|
||||
this->init();
|
||||
@@ -119,7 +119,7 @@ void Autopilot::init() {
|
||||
else
|
||||
this->state = State::NoRoute;
|
||||
this->routeInfo = this->navigation->getRouteInfo();
|
||||
this->navigation->getNTRIPClient()->setAutoReconnect(true);
|
||||
this->sensorData->getNtripClient()->setAutoReconnect(true);
|
||||
|
||||
this->lastOrderStatus = this->navigation->getCourseCorrection(this->courseCorrection, true);
|
||||
|
||||
@@ -143,7 +143,7 @@ void Autopilot::beginRotate() {
|
||||
if (this->state != State::SelfDrivingRotate) {
|
||||
this->lastState = this->state;
|
||||
this->state = State::SelfDrivingRotate;
|
||||
this->rotationAimAzimuth = this->navigation->getAzimuth() + this->courseCorrection.correction;
|
||||
this->rotationAimAzimuth = this->getSensorData()->getRealAzimuth() + this->courseCorrection.correction;
|
||||
this->rotationAimAzimuth = Navigation::fixDegree(this->rotationAimAzimuth);
|
||||
|
||||
this->moveControl->setSpeed(0);
|
||||
@@ -155,17 +155,17 @@ void Autopilot::beginRotate() {
|
||||
}
|
||||
|
||||
void Autopilot::rotate() {
|
||||
if (abs(this->navigation->getAzimuth() - this->rotationAimAzimuth) < this->maxCourseDeviationBeforeAct) {
|
||||
if (abs(this->getSensorData()->getRealAzimuth() - this->rotationAimAzimuth) < this->maxCourseDeviationBeforeAct) {
|
||||
this->endRotate();
|
||||
return;
|
||||
}
|
||||
|
||||
if ((abs(this->navigation->getAzimuth() - this->rotationAimAzimuth) < this->maxCourseDeviationBeforeAct * 3)
|
||||
if ((abs(this->getSensorData()->getRealAzimuth() - this->rotationAimAzimuth) < this->maxCourseDeviationBeforeAct * 3)
|
||||
&&
|
||||
((this->courseCorrection.correction > 0
|
||||
&& this->rotationAimAzimuth < this->navigation->getAzimuth())
|
||||
&& this->rotationAimAzimuth < this->getSensorData()->getRealAzimuth())
|
||||
|| (this->courseCorrection.correction < 0
|
||||
&& this->rotationAimAzimuth > this->navigation->getAzimuth())))
|
||||
&& this->rotationAimAzimuth > this->getSensorData()->getRealAzimuth())))
|
||||
{
|
||||
this->endRotate();
|
||||
std::cout << "Autopilot::rotate: Rover rotated too far" << std::endl;
|
||||
@@ -177,7 +177,7 @@ void Autopilot::endRotate() {
|
||||
return;
|
||||
|
||||
this->state = this->lastState;
|
||||
this->navigation->drivingDirectionChange();
|
||||
this->sensorData->getCalcCompass()->drivingDirectionChange(this->sensorData->getCurrentPos());
|
||||
this->moveControl->setRotationSpeed(0);
|
||||
this->moveControl->emergencyStop();
|
||||
this->moveControl->setDrivingStatus(MoveControl::Status::Drive);
|
||||
|
||||
@@ -16,15 +16,7 @@
|
||||
#include "navigation.h"
|
||||
#include "driveModi/Modi/ManualControl/manualControl.h"
|
||||
|
||||
class DirectionChangeSignal : public DirectionChangeWrapper {
|
||||
public:
|
||||
DirectionChangeSignal(Navigation* navigation);
|
||||
~DirectionChangeSignal();
|
||||
void action() override;
|
||||
|
||||
private:
|
||||
Navigation* navigation;
|
||||
};
|
||||
class DirectionChangeSignal;
|
||||
|
||||
/**
|
||||
* @brief This class use the navigate class to drive automaticaly
|
||||
@@ -130,4 +122,14 @@ class Autopilot : public ManualControl {
|
||||
double minRemainingDistance = 0.25;
|
||||
};
|
||||
|
||||
class DirectionChangeSignal : public DirectionChangeWrapper {
|
||||
public:
|
||||
DirectionChangeSignal(Autopilot* pilot);
|
||||
~DirectionChangeSignal();
|
||||
void action() override;
|
||||
|
||||
private:
|
||||
Autopilot* pilot;
|
||||
};
|
||||
|
||||
#endif // AUTOPILOT_H
|
||||
|
||||
@@ -15,7 +15,7 @@ CaptureRoute::CaptureRoute(DriveModiParams params, Navigation* navigation)
|
||||
: ManualControl(params) {
|
||||
this->navigation = navigation;
|
||||
this->navigation->getRoute()->clear();
|
||||
this->navigation->getNTRIPClient()->setAutoReconnect(true);
|
||||
this->sensorData->getNtripClient()->setAutoReconnect(true);
|
||||
this->routeInfo = navigation->getRouteInfo();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ TestMode::~TestMode() {
|
||||
|
||||
void TestMode::run() {
|
||||
if (this->maneuver == Maneuver::Turn) {
|
||||
uint16_t delta = abs(this->azimuth - this->navigation->getAzimuth());
|
||||
uint16_t delta = abs(this->azimuth - this->getSensorData()->getRealAzimuth());
|
||||
if (delta > this->degree)
|
||||
this->abort = true;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ bool TestMode::drive(int16_t cm, int16_t degree) {
|
||||
else if (degree > 0)
|
||||
this->moveControl->setRotationSpeed(this->maxRotationSpeed);
|
||||
|
||||
this->azimuth = this->navigation->getAzimuth();
|
||||
this->azimuth = this->getSensorData()->getRealAzimuth();
|
||||
this->degree = degree;
|
||||
|
||||
this->maneuverTime = 5 * 1000;
|
||||
|
||||
@@ -11,18 +11,18 @@
|
||||
|
||||
#include "driveModi/driveManager.h"
|
||||
|
||||
DriveManager::DriveManager(MoveControl *moveControl, SensorData* sensorData, ControlPadInput *input, bool wifi) {
|
||||
DriveManager::DriveManager(MoveControl *moveControl, const SensorData* sensorData, const ControlPadInput *input) {
|
||||
this->driveModiParams.input = input;
|
||||
this->driveModiParams.moveControl = moveControl;
|
||||
this->driveModiParams.sensorData = sensorData;
|
||||
|
||||
this->init(wifi);
|
||||
this->init();
|
||||
}
|
||||
|
||||
DriveManager::DriveManager(DriveModiParams params, bool wifi){
|
||||
DriveManager::DriveManager(DriveModiParams params){
|
||||
this->driveModiParams = params;
|
||||
|
||||
this->init(wifi);
|
||||
this->init();
|
||||
}
|
||||
|
||||
DriveManager::~DriveManager() {
|
||||
@@ -73,10 +73,8 @@ void DriveManager::changeModus(Modi modus) {
|
||||
this->addChildComponent(this->currentModusPtr);
|
||||
}
|
||||
|
||||
void DriveManager::init(bool wifi) {
|
||||
this->navigation = new Navigation();
|
||||
if (wifi)
|
||||
this->navigation->initNtrip(NTRIP_HOST, NTRIP_PORT, NTRIP_MOUNT_POINT, NTRIP_USER, NTRIP_PASSWORD);
|
||||
void DriveManager::init() {
|
||||
this->navigation = new Navigation(this->driveModiParams.sensorData);
|
||||
|
||||
this->addChildComponent(this->driveModiParams.moveControl);
|
||||
this->addChildComponent(this->navigation);
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
enum class Modi {
|
||||
Off,
|
||||
ManualControl,
|
||||
CalibrateCompass,
|
||||
CaptureRoute,
|
||||
Autopilot,
|
||||
TestMode
|
||||
@@ -52,8 +53,8 @@ class DriveManager : public Component {
|
||||
*
|
||||
* @param moveControl
|
||||
*/
|
||||
DriveManager(MoveControl *moveControl, SensorData* sensorData, ControlPadInput *input, bool wifi = false);
|
||||
DriveManager(DriveModiParams params, bool wifi = false);
|
||||
DriveManager(MoveControl *moveControl, const SensorData* sensorData, const ControlPadInput *input);
|
||||
DriveManager(DriveModiParams params);
|
||||
|
||||
/**
|
||||
* @brief Destroy the Drive Manager object
|
||||
@@ -99,7 +100,7 @@ class DriveManager : public Component {
|
||||
|
||||
private:
|
||||
void run() override {};
|
||||
void init(bool wifi);
|
||||
void init();
|
||||
|
||||
Modi currentModus = Modi::Off;
|
||||
DriveModi *currentModusPtr = nullptr;
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
struct DriveModiParams {
|
||||
MoveControl* moveControl;
|
||||
ControlPadInput* input;
|
||||
SensorData* sensorData;
|
||||
const ControlPadInput* input;
|
||||
const SensorData* sensorData;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -35,7 +35,7 @@ class DriveModi : public Component {
|
||||
DriveModi(DriveModiParams);
|
||||
virtual ~DriveModi();
|
||||
|
||||
SensorData getSensorData() const { return this->sensorData; }
|
||||
const SensorData* getSensorData() const { return this->sensorData; }
|
||||
|
||||
/**
|
||||
* @brief Set the max speed
|
||||
@@ -59,8 +59,8 @@ class DriveModi : public Component {
|
||||
|
||||
protected:
|
||||
MoveControl *moveControl;
|
||||
ControlPadInput* input;
|
||||
SensorData* sensorData;
|
||||
const ControlPadInput* input;
|
||||
const SensorData* sensorData;
|
||||
double maxForwardSpeed = 1;
|
||||
double maxRotationSpeed = 7;
|
||||
|
||||
|
||||
+6
-9
@@ -31,7 +31,6 @@
|
||||
#include "network.h"
|
||||
#include "debugMqtt.h"
|
||||
#include "battery.h"
|
||||
#include "sensors.h"
|
||||
#include "sensorData.h"
|
||||
#include "debugTimes.h"
|
||||
#include "controlPad.h"
|
||||
@@ -57,7 +56,6 @@ OutputBuf* outputBuf;
|
||||
DebugMqtt* debugMqtt = nullptr;
|
||||
Battery* mainBattery;
|
||||
SPIClass* spiPort;
|
||||
Sensors* sensors;
|
||||
SensorData* sensorData;
|
||||
ControlPad* controlPad;
|
||||
|
||||
@@ -119,11 +117,10 @@ void setup() {
|
||||
std::cout << "Build timestamp: " << BUILD_TIMESTAMP << std::endl;
|
||||
std::cout << "All actions from the main program run on Core -> " << xPortGetCoreID() << std::endl;
|
||||
|
||||
sensors = new Sensors();
|
||||
sensors->enableGnss(spiPort, PinNumbers::gnssSpiCs);
|
||||
sensors->enableCompass();
|
||||
sensorData = sensors->getSensorData();
|
||||
driveManager = new DriveManager(&moveController, sensorData, controlPad->getControlPadDataPtr(), wifiIsActive);
|
||||
sensorData = new SensorData();
|
||||
sensorData->enableGnss(spiPort, PinNumbers::gnssSpiCs);
|
||||
sensorData->enableRealCompass();
|
||||
driveManager = new DriveManager(&moveController, sensorData, controlPad->getControlPadDataPtr());
|
||||
|
||||
outputBuf->activateMqtt(true);
|
||||
|
||||
@@ -150,7 +147,7 @@ void loop() {
|
||||
#endif //MQTT
|
||||
wifiTime.stopConsol("WiFi-Time", 10);
|
||||
}
|
||||
sensors->loop();
|
||||
sensorData->loop();
|
||||
driveManager->loop();
|
||||
controlPad->loop();
|
||||
main_m->update();
|
||||
@@ -225,7 +222,7 @@ void makeMenu() {
|
||||
MenuAutopilot* auto_m = new MenuAutopilot(driveManager);
|
||||
MenuTestMode* testM_m = new MenuTestMode(driveManager);
|
||||
MenuCalibrateCompass* comp_m = new MenuCalibrateCompass(driveManager);
|
||||
MenuGPS* gps_m = new MenuGPS(driveManager);
|
||||
MenuGPS* gps_m = new MenuGPS(sensorData);
|
||||
MenuSysteminformation* sys_m = new MenuSysteminformation(mainBattery);
|
||||
MenuRoute* rout_m = new MenuRoute(driveManager->getNavigation()->getRoute());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user