doxygen finished

This commit is contained in:
2023-10-12 19:50:10 +02:00
parent db74898b72
commit 5eaeb2749b
39 changed files with 1283 additions and 1019 deletions
+1
View File
@@ -152,6 +152,7 @@
"Rtcm",
"Schalke",
"Soln",
"Systeminformation",
"TPMOBIL",
"UBLOX",
"wheelspeed",
+2
View File
@@ -30,12 +30,14 @@ Do later:
-> ESP und Sensoren in den DeepSleep für Auschalten oder Akkuschutz
-> Doxygen comments
- navigation
- autopilot
Do now:
Code:
Doxygen Kommentare aktualisieren
Fernbedienung!
Compass calibration überprüfen
Latex:
Anhang: Liste mit allen Komponenten und Kurzbeschreibung
+13 -13
View File
@@ -26,27 +26,28 @@
#include <BluetoothSerial.h>
/**
* @brief A alternativ streambuf for std::cout
* @brief A alternative streambuf for std::cout
*
* The streambuf is used to double the std::cout to consol
* and MQTT.
*
*/
class OutputBuf : public std::streambuf {
public:
class OutputBuf : public std::streambuf
{
public:
/**
* @brief Construct a new Output Buf Mqtt object
*
* @param debugMqtt
* @param serialBT
*/
OutputBuf(DebugMqtt* debugMqtt = nullptr, BluetoothSerial* serialBT = nullptr);
OutputBuf(DebugMqtt *debugMqtt = nullptr, BluetoothSerial *serialBT = nullptr);
/**
* @brief Activate the mqtt output
*
* This only works if the DebugMqtt is set by
* setDebugMqtt.
* setDebugMqtt().
*
* @param status
*/
@@ -56,17 +57,16 @@ class OutputBuf : public std::streambuf {
* @brief Active the output over the bluetooth serial consol
*
* This only works if BluetoothSerial is set by
* setSerialBT.
* setSerialBT().
*
* @param status
*/
void activateSerialBT(bool status);
void setDebugMqtt(DebugMqtt* debugMqtt);
void setSerialBT(BluetoothSerial* serialBT);
void setDebugMqtt(DebugMqtt *debugMqtt);
void setSerialBT(BluetoothSerial *serialBT);
protected:
protected:
/**
* @brief
*
@@ -75,12 +75,12 @@ class OutputBuf : public std::streambuf {
*/
virtual std::streambuf::int_type overflow(std::streambuf::int_type c);
private:
private:
bool isMqttActive = false;
bool isSerialBTActive = false;
DebugMqtt* debugMqtt;
BluetoothSerial* serialBT;
DebugMqtt *debugMqtt;
BluetoothSerial *serialBT;
};
#endif // OUTPUT_STREAM_MQTT_H
@@ -1,7 +1,7 @@
/**
* @file menuCalibrateBattery.h
* @author Alexander Klein (alex@kleiax.de)
* @brief
* @brief Contains a Menu class to calibrate the Battery class
* @version 0.1
* @date 2023-09-26
*
@@ -15,13 +15,27 @@
#include "menuControl.h"
#include "battery.h"
/**
* @brief A Menu class to calibrate the Battery class
*/
class MenuCalibrateBattery : public MenuControl
{
public:
/**
* @brief Construct a new MenuCalibrateBattery object
*
* Prepare the calibration.
*
* @param battery
*/
MenuCalibrateBattery(Battery *battery);
/**
* @brief Prints the instructions for the calibration
*/
void printMenu() override;
// User Inputs
void left() override;
void no() override { this->left(); }
void right() override;
+7 -7
View File
@@ -20,20 +20,20 @@
* @brief A class to tune the PID settings
*
*/
class MenuPidSettings : public MenuIntInputWrapper {
public:
class MenuPidSettings : public MenuIntInputWrapper
{
public:
/**
* @brief Construct a new Menu Pid Settings object
*
* @param pid
*/
MenuPidSettings(PID* pid);
MenuPidSettings(PID *pid);
void action(int16_t* values, uint8_t length) override;
private:
PID* pid;
void action(int16_t *values, uint8_t length) override;
private:
PID *pid;
};
#endif // PID_SETTINGS_H
+7
View File
@@ -111,6 +111,13 @@ public:
*/
void exportRoute(uint8_t routeNumber);
/**
* @brief Delete a Route
*
* The functions tries to delete the current route from the RoverApi.
*
* @param routeNumber
*/
void deleteRoute(uint8_t routeNumber);
/**
+6 -6
View File
@@ -20,8 +20,9 @@
* @brief Prints coordinates of Route side by side.
*
*/
class MenuRoutePoints : public MenuInformationSites {
public:
class MenuRoutePoints : public MenuInformationSites
{
public:
/**
* @brief Construct a new Menu Route Points object
*
@@ -34,17 +35,16 @@ class MenuRoutePoints : public MenuInformationSites {
*
* Set the amount of pages.
*/
void init () override;
void init() override;
/**
* @brief Prints the the coordinates of the current Point.
*/
void printPage() const override;
private:
Route* route;
private:
Route *route;
bool error = false;
};
#endif // MENU_ROUTE_POINTS_H
+16 -7
View File
@@ -1,7 +1,7 @@
/**
* @file menuSensorData.h
* @author Alexander Klein (alex@kleiax.de)
* @brief
* @brief Contains a MenuInformationClass to print the SensorData
* @version 0.1
* @date 2023-09-04
*
@@ -15,14 +15,23 @@
#include "menuInformationSites.h"
#include "sensorData.h"
class MenuSensorData : public MenuInformationSites {
public:
MenuSensorData(SensorData* SensorData);
/**
* @brief A MenuInformationClass to print the SensorData
*/
class MenuSensorData : public MenuInformationSites
{
public:
/**
* @brief Construct a new MenuSensorData object
*
* @param SensorData
*/
MenuSensorData(SensorData *SensorData);
private:
private:
void printPage() const override;
SensorData* sensorData;
SensorData *sensorData;
};
#endif //MENU_SENSOR_DATA_H
#endif // MENU_SENSOR_DATA_H
+4 -2
View File
@@ -11,8 +11,10 @@
#include "menuSpeed.h"
void MenuSpeed::action(int16_t* values, uint8_t length) {
if (length != 2) {
void MenuSpeed::action(int16_t *values, uint8_t length)
{
if (length != 2)
{
return;
}
this->speeds.x = values[0] / 10.0;
+17 -8
View File
@@ -1,7 +1,7 @@
/**
* @file menuSpeed.h
* @author Alexander Klein (alex@kleiax.de)
* @brief
* @brief Contains a MenuIntInputWrapper to change speeds
* @version 0.1
* @date 2023-09-26
*
@@ -15,15 +15,24 @@
#include <menuIntInput.h>
#include "moveControl.h"
class MenuSpeed : public MenuIntInputWrapper {
public:
MenuSpeed(DrivingSpeeds& speeds) : speeds(speeds){};
/**
* @brief A MenuIntInputWrapper class to change speeds
*/
class MenuSpeed : public MenuIntInputWrapper
{
public:
MenuSpeed(DrivingSpeeds &speeds) : speeds(speeds){};
void action(int16_t* values, uint8_t length) override;
private:
DrivingSpeeds& speeds;
/**
* @brief Changes the speeds
*
* @param values
* @param length
*/
void action(int16_t *values, uint8_t length) override;
private:
DrivingSpeeds &speeds;
};
#endif // MENU_SPEED_H
@@ -11,15 +11,18 @@
#include "menuSysteminformation.h"
MenuSysteminformation::MenuSysteminformation(Battery* mainBattery)
: MenuInformationSites(8), mainBattery {mainBattery} {
MenuSysteminformation::MenuSysteminformation(Battery *mainBattery)
: MenuInformationSites(8), mainBattery{mainBattery}
{
this->noEqualLeft = true;
}
void MenuSysteminformation::printPage() const {
void MenuSysteminformation::printPage() const
{
String lineOne = "";
String lineTwo = "";
switch (this->getCurrentPage()) {
switch (this->getCurrentPage())
{
case 0:
lineOne = "Free Heap:";
lineTwo.concat(ESP.getFreeHeap());
@@ -71,4 +74,3 @@ void MenuSysteminformation::printPage() const {
this->print(lineOne, lineTwo);
}
@@ -26,19 +26,20 @@
*
* The informations are about the batteries, memory and uptime.
*/
class MenuSysteminformation : public MenuInformationSites {
public:
class MenuSysteminformation : public MenuInformationSites
{
public:
/**
* @brief Construct a new Menu Systeminformation object
*
* @param mainBattery
*/
MenuSysteminformation(Battery* mainBattery);
MenuSysteminformation(Battery *mainBattery);
private:
private:
void printPage() const override;
Battery* mainBattery;
Battery *mainBattery;
};
#endif // MENU_SYSTEMINFORMATION_H
@@ -19,14 +19,15 @@
* @brief A class to print informations about the Autopilot
*
*/
class MenuAutopilot : public MenuDriveMode {
public:
class MenuAutopilot : public MenuDriveMode
{
public:
/**
* @brief Construct a new Menu Autopilot object
*
* @param driveManager for MenuDriveMode
*/
MenuAutopilot(DriveManager* driveManager) : MenuDriveMode(driveManager) {}
MenuAutopilot(DriveManager *driveManager) : MenuDriveMode(driveManager) {}
/**
* @brief Prints the Information to display and console
@@ -39,13 +40,12 @@ class MenuAutopilot : public MenuDriveMode {
*/
void printPage() const override;
/**
* @brief can be called to update shown data
*/
void update() override;
private:
private:
void init() override;
void runCommand() override;
void runCommandNo() override;
@@ -53,7 +53,7 @@ class MenuAutopilot : public MenuDriveMode {
bool mutable targetFreezed = false;
double mutable minDistance;
Autopilot* autopilot;
Autopilot *autopilot;
RouteInfo routeInfo;
};
@@ -10,18 +10,21 @@
*/
#include "menuCalibrateCompass.h"
MenuCalibrateCompass::MenuCalibrateCompass(DriveManager* driveManager) : MenuDriveMode(driveManager) {}
MenuCalibrateCompass::MenuCalibrateCompass(DriveManager *driveManager) : MenuDriveMode(driveManager) {}
MenuCalibrateCompass::~MenuCalibrateCompass() {
MenuCalibrateCompass::~MenuCalibrateCompass()
{
delete this->caliCompass;
this->caliCompassMode->setCalibrateCompass();
}
void MenuCalibrateCompass::printPage() const {
void MenuCalibrateCompass::printPage() const
{
String lineOne = "";
String lineTwo = "";
switch (this->getCurrentPage()) {
switch (this->getCurrentPage())
{
case 0:
lineOne = "-Ready to drive-";
lineTwo = "Compass Mode";
@@ -33,13 +36,14 @@ void MenuCalibrateCompass::printPage() const {
break;
case 2:
switch (this->caliCompass->getState()) {
case CalibrateCompass::State::Ready :
switch (this->caliCompass->getState())
{
case CalibrateCompass::State::Ready:
lineOne = "Start compass";
lineTwo = "calibration";
break;
case CalibrateCompass::State::Calibrating :
case CalibrateCompass::State::Calibrating:
lineOne = "Calibrating...";
lineTwo = "Move around";
break;
@@ -108,7 +112,8 @@ void MenuCalibrateCompass::printPage() const {
this->print(lineOne, lineTwo);
}
void MenuCalibrateCompass::init() {
void MenuCalibrateCompass::init()
{
this->firstPrint = false;
this->caliCompassMode = new CalibrateCompassM();
this->driveManager->changeModus(this->caliCompassMode);
@@ -117,11 +122,14 @@ void MenuCalibrateCompass::init() {
MenuDriveMode::updateDelay = MenuCalibrateCompass::updateDelay;
}
void MenuCalibrateCompass::runCommand() {
switch (this->getCurrentPage()) {
void MenuCalibrateCompass::runCommand()
{
switch (this->getCurrentPage())
{
case 2:
switch (this->caliCompass->getState()) {
case CalibrateCompass::State::Ready :
switch (this->caliCompass->getState())
{
case CalibrateCompass::State::Ready:
this->caliCompassMode->setCalibrateCompass(this->caliCompass);
this->caliCompass->start();
break;
@@ -20,14 +20,15 @@
* @brief A class to print informations about the class ManualControl
*
*/
class MenuCalibrateCompass : public MenuDriveMode {
public:
class MenuCalibrateCompass : public MenuDriveMode
{
public:
/**
* @brief Construct a new Menu Manual Control object
*
* @param driveManager
*/
MenuCalibrateCompass(DriveManager* driveManager);
MenuCalibrateCompass(DriveManager *driveManager);
~MenuCalibrateCompass();
/**
@@ -40,13 +41,12 @@ class MenuCalibrateCompass : public MenuDriveMode {
*/
void printPage() const override;
protected:
private:
void init() override;
void runCommand() override;
private:
CalibrateCompassM* caliCompassMode = nullptr;
CalibrateCompass* caliCompass = nullptr;
CalibrateCompassM *caliCompassMode = nullptr;
CalibrateCompass *caliCompass = nullptr;
static constexpr uint16_t updateDelay = 500;
};
@@ -18,14 +18,15 @@
* @brief A class to print informations about the Autopilot
*
*/
class MenuCaptureRoute : public MenuDriveMode {
public:
class MenuCaptureRoute : public MenuDriveMode
{
public:
/**
* @brief Construct a new Menu Capture Route object
*
* @param driveManager
*/
MenuCaptureRoute(DriveManager* driveManager) : MenuDriveMode(driveManager) {}
MenuCaptureRoute(DriveManager *driveManager) : MenuDriveMode(driveManager) {}
/**
* @brief Prints the Information to display and console
@@ -43,12 +44,11 @@ class MenuCaptureRoute : public MenuDriveMode {
*/
void update() override;
private:
void runCommand() override;
private:
void init() override;
CaptureRoute* captureRoute = nullptr;
CaptureRoute *captureRoute = nullptr;
static constexpr uint16_t updateDelay = 500;
};
@@ -10,26 +10,30 @@
*/
#include "menuManualDrive.h"
MenuManualControl::MenuManualControl(DriveManager* driveManager) : MenuDriveMode(driveManager) {
MenuManualControl::MenuManualControl(DriveManager *driveManager) : MenuDriveMode(driveManager)
{
this->noEqualLeft = true;
}
void MenuManualControl::printPage() const {
void MenuManualControl::printPage() const
{
String lineOne = "";
String lineTwo = "";
switch (this->getCurrentPage()) {
switch (this->getCurrentPage())
{
case 0:
lineOne = "-Ready to drive-";
break;
case 1:
lineOne = "Input mode:";
if (this->manualControl->getInputMode() == ManualControl::InputMode::Analog) {
if (this->manualControl->getInputMode() == ManualControl::InputMode::Analog)
{
lineTwo = "Analog";
}
else {
else
{
lineTwo = "Digital";
}
break;
@@ -50,7 +54,8 @@ void MenuManualControl::printPage() const {
this->print(lineOne, lineTwo);
}
void MenuManualControl::init() {
void MenuManualControl::init()
{
this->firstPrint = false;
this->manualControl = new ManualControl();
this->driveManager->changeModus(this->manualControl);
@@ -60,8 +65,10 @@ void MenuManualControl::init() {
MenuDriveMode::init();
}
void MenuManualControl::runCommand() {
switch (this->getCurrentPage()) {
void MenuManualControl::runCommand()
{
switch (this->getCurrentPage())
{
case 1:
this->manualControl->switchInputMode();
break;
@@ -19,14 +19,15 @@
* @brief A class to print informations about the class ManualControl
*
*/
class MenuManualControl : public MenuDriveMode {
public:
class MenuManualControl : public MenuDriveMode
{
public:
/**
* @brief Construct a new Menu Manual Control object
*
* @param driveManager
*/
MenuManualControl(DriveManager* driveManager);
MenuManualControl(DriveManager *driveManager);
/**
* @brief Prints the Information to display and console
@@ -38,13 +39,12 @@ class MenuManualControl : public MenuDriveMode {
*/
void printPage() const override;
protected:
private:
void init() override;
void runCommand() override;
private:
ManualControl* manualControl = nullptr;
CalibrateCompass* caliCompass = nullptr;
ManualControl *manualControl = nullptr;
CalibrateCompass *caliCompass = nullptr;
static constexpr uint16_t updateDelay = 500;
};
@@ -10,19 +10,23 @@
*/
#include "menuTestMode.h"
MenuTestMode::MenuTestMode(DriveManager* driveManager)
: driveManager {driveManager}
MenuTestMode::MenuTestMode(DriveManager *driveManager)
: driveManager{driveManager}
{
}
MenuTestMode::~MenuTestMode() {
if (isInit) {
MenuTestMode::~MenuTestMode()
{
if (isInit)
{
delete this->mainMenu;
}
}
void MenuTestMode::printMenu() {
if (!this->isInit) {
void MenuTestMode::printMenu()
{
if (!this->isInit)
{
this->isInit = true;
this->init();
}
@@ -30,62 +34,82 @@ void MenuTestMode::printMenu() {
this->mainMenu->printMenu();
}
void MenuTestMode::down() {
if (this->checkInput()) {
void MenuTestMode::down()
{
if (this->checkInput())
{
this->mainMenu->down();
}
}
void MenuTestMode::up() {
if (this->checkInput()) {
void MenuTestMode::up()
{
if (this->checkInput())
{
this->mainMenu->up();
}
}
void MenuTestMode::right() {
if (this->checkInput()) {
void MenuTestMode::right()
{
if (this->checkInput())
{
this->mainMenu->right();
}
}
void MenuTestMode::left() {
void MenuTestMode::left()
{
if (this->mainMenu->isInSubmenu())
if (this->checkInput()) {
if (this->checkInput())
{
this->mainMenu->left();
}
else {
else
{
this->testMode->abortManeuver();
this->mainMenu->left();
}
else {
else
{
this->parentMenu->printMenu();
}
}
void MenuTestMode::yes() {
if (this->checkInput()) {
void MenuTestMode::yes()
{
if (this->checkInput())
{
this->mainMenu->yes();
}
}
void MenuTestMode::no() {
if (this->mainMenu->isInSubmenu()) {
void MenuTestMode::no()
{
if (this->mainMenu->isInSubmenu())
{
if (this->checkInput())
this->mainMenu->no();
else {
else
{
this->testMode->abortManeuver();
this->mainMenu->no();
}}
else{
this->left();}
}
}
else
{
this->left();
}
}
void MenuTestMode::init() {
void MenuTestMode::init()
{
this->testMode = new TestMode();
this->driveManager->changeModus(this->testMode);
auto dummy = []() {
std::cout << "Dummy in Action" <<std::endl;
auto dummy = []()
{
std::cout << "Dummy in Action" << std::endl;
};
// Create menu
@@ -103,7 +127,6 @@ void MenuTestMode::init() {
auto *encoderLeftMenu = new SpeedometerTest(this->testMode->getSpeedometerLeft());
auto *encoderRightMenu = new SpeedometerTest(this->testMode->getSpeedometerRight());
// Set menus on LCD
this->mainMenu->setLcd(this->lcd);
engineMenu->setLcd(this->lcd);
@@ -143,7 +166,6 @@ void MenuTestMode::init() {
engineBothMenu->setMinMaxSteps(1, 0, secondsMax, 1);
engineBothMenu->setPrintParentMenu(false);
// Entrys for the menus
auto *engineAction = new MenuAction("Engine", engineMenu);
auto *engineLeftAction = new MenuAction("Left", engineLeftMenu);
@@ -185,70 +207,85 @@ void MenuTestMode::init() {
lightMenu->addEntry(lightOffAction);
}
void MenuTestMode::update() {
if (this->maneuverInAction) {
if (millis() - this->lastUpdateTime > updateDelay) {
void MenuTestMode::update()
{
if (this->maneuverInAction)
{
if (millis() - this->lastUpdateTime > updateDelay)
{
this->printManeuverTime();
this->lastUpdateTime = millis();
}}
}
}
}
bool MenuTestMode::checkInput() {
if (this->testMode->getBusy()) {
bool MenuTestMode::checkInput()
{
if (this->testMode->getBusy())
{
this->printManeuverTime();
this->maneuverInAction = true;
return false;
}
if (this->maneuverInAction) {
if (this->maneuverInAction)
{
this->maneuverInAction = false;
}
return true;
}
void MenuTestMode::printManeuverTime() {
void MenuTestMode::printManeuverTime()
{
uint8_t maneuverTime = this->testMode->getRemainingManeuverTime();
if (maneuverTime) {
if (maneuverTime)
{
String lineTwo = "";
lineTwo.concat(maneuverTime);
lineTwo.concat(" secs");
this->print("Maneuver time:", lineTwo);
} else {
}
else
{
this->maneuverInAction = false;
this->printMenu();
}
}
MenuTestModeWrapper::MenuTestModeWrapper(MenuTestMode* menu, TestModeFunctionSingle testModeFunction)
: menu {menu},
testModeFunctionSingle {testModeFunction},
testMode {menu->getTestMode()}
MenuTestModeWrapper::MenuTestModeWrapper(MenuTestMode *menu, TestModeFunctionSingle testModeFunction)
: menu{menu},
testModeFunctionSingle{testModeFunction},
testMode{menu->getTestMode()}
{
}
MenuTestModeWrapper::MenuTestModeWrapper(MenuTestMode* menu, TestModeFunctionDouble testModeFunction)
: menu {menu},
testModeFunctionDouble {testModeFunction},
testMode {menu->getTestMode()}
MenuTestModeWrapper::MenuTestModeWrapper(MenuTestMode *menu, TestModeFunctionDouble testModeFunction)
: menu{menu},
testModeFunctionDouble{testModeFunction},
testMode{menu->getTestMode()}
{
}
void MenuTestModeWrapper::action(int16_t* values, uint8_t length) {
void MenuTestModeWrapper::action(int16_t *values, uint8_t length)
{
// This function calls a member function with a pointer
// Very helpful site:
// https://isocpp.org/wiki/faq/pointers-to-members#fnptr-vs-memfnptr-types
bool res = false;
if (length == 2 && static_cast<bool>(this->testModeFunctionDouble)) {
if (length == 2 && static_cast<bool>(this->testModeFunctionDouble))
{
res = (this->testMode->*this->testModeFunctionDouble)(values[0], values[1]);
}
else if (length == 1 && static_cast<bool>(this->testModeFunctionSingle)) {
else if (length == 1 && static_cast<bool>(this->testModeFunctionSingle))
{
res = (this->testMode->*this->testModeFunctionSingle)(values[0]);
}
if (res) {
if (res)
{
this->menu->printManeuverTime();
this->menu->maneuverStarted();
}
@@ -22,8 +22,9 @@
* @brief Interact with the TestMode
*
*/
class MenuTestMode : public MenuControl {
public:
class MenuTestMode : public MenuControl
{
public:
/**
* @brief Construct a new Menu Test Mode object
*
@@ -62,16 +63,16 @@ class MenuTestMode : public MenuControl {
*/
void update() override;
TestMode* getTestMode() const { return this->testMode; }
TestMode *getTestMode() const { return this->testMode; }
void maneuverStarted() { this->maneuverInAction = true; }
private:
private:
void init();
bool checkInput();
DriveManager* driveManager;
TestMode* testMode = nullptr;
Menu* mainMenu = nullptr;
DriveManager *driveManager;
TestMode *testMode = nullptr;
Menu *mainMenu = nullptr;
bool isInit = false;
bool maneuverInAction = false;
@@ -82,16 +83,17 @@ class MenuTestMode : public MenuControl {
typedef bool (TestMode::*TestModeFunctionSingle)(int16_t);
typedef bool (TestMode::*TestModeFunctionDouble)(int16_t, int16_t);
class MenuTestModeWrapper : public MenuIntInputWrapper {
public:
MenuTestModeWrapper(MenuTestMode* menu, TestModeFunctionSingle testModeFunction);
MenuTestModeWrapper(MenuTestMode* menu, TestModeFunctionDouble testModeFunction);
class MenuTestModeWrapper : public MenuIntInputWrapper
{
public:
MenuTestModeWrapper(MenuTestMode *menu, TestModeFunctionSingle testModeFunction);
MenuTestModeWrapper(MenuTestMode *menu, TestModeFunctionDouble testModeFunction);
void action(int16_t* values, uint8_t length) override;
void action(int16_t *values, uint8_t length) override;
private:
MenuTestMode* menu;
TestMode* testMode;
private:
MenuTestMode *menu;
TestMode *testMode;
TestModeFunctionSingle testModeFunctionSingle = nullptr;
TestModeFunctionDouble testModeFunctionDouble = nullptr;
};
@@ -11,24 +11,26 @@
#include "speedometerTest.h"
SpeedometerTest::SpeedometerTest(Speedometer* speedometer)
: speedometer {speedometer}
SpeedometerTest::SpeedometerTest(Speedometer *speedometer)
: speedometer{speedometer}
{
this->speedometer->setDirection(Speedometer::Forward);
}
void SpeedometerTest::printMenu() {
switch (this->state) {
case State::Off :
void SpeedometerTest::printMenu()
{
switch (this->state)
{
case State::Off:
this->print("Press Yes (O)", "to start");
break;
case State::Running :
case State::Running:
this->print("Running, Yes (O)", "to stop");
break;
case State::Finished : {
case State::Finished:
{
String res = "";
res.concat(this->result);
this->print("Result: ", res);
@@ -41,13 +43,15 @@ void SpeedometerTest::printMenu() {
}
}
void SpeedometerTest::left() {
void SpeedometerTest::left()
{
this->no();
}
void SpeedometerTest::no() {
if (this->state == State::Running){
void SpeedometerTest::no()
{
if (this->state == State::Running)
{
speedometer->calibrationMeasurementStop();
}
@@ -55,21 +59,23 @@ void SpeedometerTest::no() {
this->parentMenu->printMenu();
}
void SpeedometerTest::yes() {
switch (this->state) {
case State::Off :
void SpeedometerTest::yes()
{
switch (this->state)
{
case State::Off:
this->state = State::Running;
this->speedometer->calibrationMeasurementStart();
this->printMenu();
break;
case State::Running :
case State::Running:
this->state = State::Finished;
this->result = this->speedometer->calibrationMeasurementStop();
this->printMenu();
break;
case State::Finished :
case State::Finished:
this->state = State::Running;
this->speedometer->calibrationMeasurementStart();
this->printMenu();
@@ -18,12 +18,14 @@
* @brief Tests the wheel encoder.
*
*/
class SpeedometerTest : public MenuControl {
public:
class SpeedometerTest : public MenuControl
{
public:
/**
* @brief The states of the test.
*/
enum State {
enum State
{
Off,
Running,
Finished
@@ -34,7 +36,7 @@ class SpeedometerTest : public MenuControl {
*
* @param speedometer
*/
SpeedometerTest(Speedometer* speedometer);
SpeedometerTest(Speedometer *speedometer);
/**
* @brief Prints the actual state of the test.
@@ -56,8 +58,8 @@ class SpeedometerTest : public MenuControl {
*/
void yes() override;
private:
Speedometer* speedometer;
private:
Speedometer *speedometer;
State state = State::Off;
uint16_t result = 0;
+74 -26
View File
@@ -11,14 +11,36 @@
#include "menuDriveMode.h"
MenuDriveMode::MenuDriveMode(DriveManager* driveManager)
: driveManager {driveManager}
MenuDriveMode::MenuDriveMode(DriveManager *driveManager)
: driveManager{driveManager}
{
}
void MenuDriveMode::left() {
if (static_cast<bool>(this->activeMenu)) {
if (static_cast<bool>(this->activeMenu)) {
MenuDriveMode::~MenuDriveMode()
{
if (this->selfCreatedMenuSpeed)
{
delete this->menuSpeed;
}
}
void MenuDriveMode::addSpeedMenu(MenuIntInput *menuSpeed)
{
if (this->selfCreatedMenuSpeed)
{
delete this->menuSpeed;
this->selfCreatedMenuSpeed = false;
}
this->menuSpeed = menuSpeed;
}
void MenuDriveMode::left()
{
if (static_cast<bool>(this->activeMenu))
{
if (static_cast<bool>(this->activeMenu))
{
this->activeMenu->left();
}
return;
@@ -31,52 +53,65 @@ void MenuDriveMode::left() {
MenuInformationSites::left();
}
void MenuDriveMode::right() {
if (static_cast<bool>(this->activeMenu)) {
void MenuDriveMode::right()
{
if (static_cast<bool>(this->activeMenu))
{
this->activeMenu->right();
return;
}
MenuInformationSites::right();
}
void MenuDriveMode::up() {
if (static_cast<bool>(this->activeMenu)) {
void MenuDriveMode::up()
{
if (static_cast<bool>(this->activeMenu))
{
this->activeMenu->up();
return;
}
MenuInformationSites::up();
}
void MenuDriveMode::down() {
if (static_cast<bool>(this->activeMenu)) {
void MenuDriveMode::down()
{
if (static_cast<bool>(this->activeMenu))
{
this->activeMenu->down();
return;
}
MenuInformationSites::down();
}
void MenuDriveMode::yes() {
if (static_cast<bool>(this->activeMenu)) {
void MenuDriveMode::yes()
{
if (static_cast<bool>(this->activeMenu))
{
this->activeMenu->yes();
return;
}
MenuInformationSites::yes();
}
void MenuDriveMode::no() {
if (static_cast<bool>(this->activeMenu)) {
void MenuDriveMode::no()
{
if (static_cast<bool>(this->activeMenu))
{
this->activeMenu->no();
return;
}
MenuInformationSites::no();
}
void MenuDriveMode::prepareReenterMenu() {
void MenuDriveMode::prepareReenterMenu()
{
this->activeMenu = nullptr;
}
void MenuDriveMode::printMenu() {
if (static_cast<bool>(this->activeMenu)) {
void MenuDriveMode::printMenu()
{
if (static_cast<bool>(this->activeMenu))
{
this->activeMenu->printMenu();
return;
}
@@ -84,37 +119,50 @@ void MenuDriveMode::printMenu() {
MenuInformationSites::printMenu();
}
void MenuDriveMode::init() {
void MenuDriveMode::init()
{
this->activeMenu = nullptr;
}
void MenuDriveMode::activateSpeedMenu() {
if (!this->driveManager->isActive()) {
void MenuDriveMode::activateSpeedMenu()
{
if (!this->driveManager->isActive())
{
return;
}
DrivingSpeeds& speeds = this->driveManager->getDriveModiPtr()->getSpeedsRef();
if (this->selfCreatedMenuSpeed)
{
delete this->menuSpeed;
}
DrivingSpeeds &speeds = this->driveManager->getDriveModiPtr()->getSpeedsRef();
auto *menu = new MenuIntInput(2, new MenuSpeed(speeds));
menu->setMinMax(5, UINT8_MAX);
menu->setEntry(0, "x m/s e-1", driveManager->getDrivingSpeedsRef().x * 10);
menu->setEntry(1, "z rad/s e-1", driveManager->getDrivingSpeedsRef().rot * 10);
this->selfCreatedMenuSpeed = true;
this->addSpeedMenu(menu);
}
void MenuDriveMode::enterSpeedMenu() {
void MenuDriveMode::enterSpeedMenu()
{
this->activeMenu = this->menuSpeed;
this->enterMenu();
}
void MenuDriveMode::enterSensorMenu() {
void MenuDriveMode::enterSensorMenu()
{
this->activeMenu = this->menuSensor;
this->enterMenu();
}
void MenuDriveMode::enterMenu() {
if (!static_cast<bool>(this->activeMenu)) {
void MenuDriveMode::enterMenu()
{
if (!static_cast<bool>(this->activeMenu))
{
return;
}
+42 -11
View File
@@ -20,17 +20,20 @@
* @brief A base class for Menus about DriveModi
*
*/
class MenuDriveMode : public MenuInformationSites {
public:
class MenuDriveMode : public MenuInformationSites
{
public:
/**
* @brief Construct a new Menu Drive Mode object
*
* @param driveManager
*/
MenuDriveMode(DriveManager* driveManager);
MenuDriveMode(DriveManager *driveManager);
void addSensorMenu(MenuSensorData* menuSensor) { this->menuSensor = menuSensor; }
void addSpeedMenu(MenuIntInput* menuSpeed) { this->menuSpeed = menuSpeed; }
~MenuDriveMode();
void addSensorMenu(MenuSensorData *menuSensor) { this->menuSensor = menuSensor; }
void addSpeedMenu(MenuIntInput *menuSpeed);
/**
* @brief Goes back to the parentMenu.
@@ -45,22 +48,50 @@ class MenuDriveMode : public MenuInformationSites {
void prepareReenterMenu() override;
void printMenu() override;
protected:
protected:
void init() override;
/**
* @brief Prepare leaving the menu
*
* Can be overwritten to add extra functionality to safely
* exit the menu. This function is called before the parentMenu
* is printed.
*/
virtual void configureOnLeave() {}
/**
* @brief Creates an own SpeedMenu
*
* This function uses addSpeedMenu() at the end to that the new menu
*/
void activateSpeedMenu();
/**
* @brief Enter a Menu to edit the speeds
*
* To enter this menu it has to be set by addSpeedMenu() or activateSpeedMenu()
*/
void enterSpeedMenu();
/**
* @brief Enter a Menu with the SensorData
*
* To enter this menu it has to be set by addSensorMenu()
*/
void enterSensorMenu();
DriveManager* driveManager;
DriveManager *driveManager;
bool firstPrint = true;
private:
private:
void enterMenu();
MenuControl* activeMenu = nullptr;
MenuSensorData* menuSensor = nullptr;
MenuIntInput* menuSpeed = nullptr;
MenuControl *activeMenu = nullptr;
MenuSensorData *menuSensor = nullptr;
MenuIntInput *menuSpeed = nullptr;
bool selfCreatedMenuSpeed = false;
};
#endif // MENU_DRIVE_MODI_H
+15 -13
View File
@@ -12,7 +12,6 @@
#ifndef AUTOPILOT_H
#define AUTOPILOT_H
#include "navigation.h"
#include "driveModi/Modi/ManualControl/manualControl.h"
@@ -27,9 +26,11 @@ class DirectionChangeSignal;
* switch to automatic drive.
*
*/
class Autopilot : public ManualControl {
public:
enum State {
class Autopilot : public ManualControl
{
public:
enum State
{
InsufficientAccuracy = -2,
NoRoute = -1,
None = 0,
@@ -70,7 +71,7 @@ class Autopilot : public ManualControl {
* @return State
*/
State getState() const { return this->state; }
Navigation* getNavigation() const { return this->navigation; }
Navigation *getNavigation() const { return this->navigation; }
/**
* @brief Tells if there are new informations to display
@@ -84,7 +85,7 @@ class Autopilot : public ManualControl {
void switchLoopMode() { this->loopMode = !this->loopMode; }
bool getLoopMode() const { return this->loopMode; }
private:
private:
void init();
void drive();
void beginRotate();
@@ -96,13 +97,13 @@ class Autopilot : public ManualControl {
void restartLoop();
void afterActivate() override;
Navigation* navigation = nullptr;
Navigation *navigation = nullptr;
CourseCorrection courseCorrection{0, 0};
RouteInfo routeInfo{0, 0};
State state = State::None;
State lastState = State::None;
Navigation::Status lastOrderStatus;
DirectionChangeSignal* directionChangeSignal = nullptr;
DirectionChangeSignal *directionChangeSignal = nullptr;
bool updateDisplay = false;
bool loopMode = false;
@@ -116,14 +117,15 @@ class Autopilot : public ManualControl {
double minRemainingDistance = 0.25;
};
class DirectionChangeSignal : public DirectionChangeWrapper {
public:
DirectionChangeSignal(Autopilot* pilot);
class DirectionChangeSignal : public DirectionChangeWrapper
{
public:
DirectionChangeSignal(Autopilot *pilot);
~DirectionChangeSignal();
void action() override;
private:
Autopilot* pilot;
private:
Autopilot *pilot;
};
#endif // AUTOPILOT_H
@@ -11,12 +11,15 @@
#include "calibrateCompassM.h"
void CalibrateCompassM::setCalibrateCompass(CalibrateCompass *caliCompass) {
if (static_cast<bool>(caliCompass)) {
void CalibrateCompassM::setCalibrateCompass(CalibrateCompass *caliCompass)
{
if (static_cast<bool>(caliCompass))
{
this->caliCompass = caliCompass;
this->addChildComponent(this->caliCompass);
} else if (static_cast<bool>(this->caliCompass)) {
}
else if (static_cast<bool>(this->caliCompass))
{
this->removeChildComponent(this->caliCompass);
this->caliCompass = caliCompass;
}
@@ -1,7 +1,7 @@
/**
* @file calibrateCompassM.h
* @author Alexander Klein (alex@kleiax.de)
* @brief
* @brief Contains a Menu class to calibrate the compass
* @version 0.1
* @date 2023-09-03
*
@@ -16,12 +16,21 @@
#include "driveModi/Modi/ManualControl/manualControl.h"
class CalibrateCompassM : public ManualControl {
public:
void setCalibrateCompass(CalibrateCompass* caliCompass = nullptr);
/**
* @brief A Menu class to interact with CalibrateCompass class
*/
class CalibrateCompassM : public ManualControl
{
public:
/**
* @brief Set the CalibrateCompass object
*
* @param caliCompass
*/
void setCalibrateCompass(CalibrateCompass *caliCompass = nullptr);
private:
CalibrateCompass* caliCompass = nullptr;
private:
CalibrateCompass *caliCompass = nullptr;
};
#endif //CALIBRATE_COMPASS_M_H
#endif // CALIBRATE_COMPASS_M_H
+8 -12
View File
@@ -25,8 +25,9 @@
* you can add a Point everytime you want.
*
*/
class CaptureRoute : public ManualControl {
public:
class CaptureRoute : public ManualControl
{
public:
/**
* @brief Destroy the Capture Route object
*
@@ -34,21 +35,15 @@ class CaptureRoute : public ManualControl {
*/
~CaptureRoute();
// /**
// * @brief Get the Navigation object
// *
// * @return Navigation*
// */
// Navigation* getNavigation() const { return this->navigation; }
/**
* @brief Get the Route Info object
*
* @return RouteInfo
*/
RouteInfo getRouteInfo() const { return this->routeInfo; }
Navigation::Status getLastStatus() const { return this->status; }
Navigation* getNavigation() const { return this->navigation; }
Navigation *getNavigation() const { return this->navigation; }
/**
* @brief Get the distance to the last saved oint
@@ -64,11 +59,12 @@ class CaptureRoute : public ManualControl {
* @return false
*/
bool shouldUpdate();
private:
private:
void run() override;
void afterActivate() override;
Navigation* navigation = nullptr;
Navigation *navigation = nullptr;
RouteInfo routeInfo;
Point lastSavedPoint;
Navigation::Status status = Navigation::Status::Complete;
@@ -13,43 +13,60 @@
#include "driveModi/driveModi.h"
class DirectionChangeWrapper {
public:
class DirectionChangeWrapper
{
public:
virtual void action() = 0;
};
/**
* @brief Drive the Rover with a Joystick
*
* This class gets the x and y value from the PS3 controller
* This class gets the x and y value from the ControlPad
* and map the values to moveControl
*
* @see MoveControl
*/
class ManualControl : public DriveModi {
public:
enum class InputMode : uint8_t {
class ManualControl : public DriveModi
{
public:
/**
* @brief The enum is used to change the interpretation of the joystick data
*/
enum class InputMode : uint8_t
{
Analog,
Digital
};
/**
* @brief Change the InputMode to the opposite
*/
void switchInputMode();
void setInputMode(InputMode mode) { this->inputMode = mode; }
InputMode getInputMode() const { return this->inputMode; }
void setDirectionChangeCallback(DirectionChangeWrapper* callback) { this->directionChangeWrapper = callback; }
/**
* @brief Set the DirectionChangeWrapper object
*
* This callback is used to inform the CalcAzimuth Component about a direction change
*
* @param callback
*/
void setDirectionChangeCallback(DirectionChangeWrapper *callback) { this->directionChangeWrapper = callback; }
uint16_t getDutycycleLeft() const { return this->moveControl->getDutycycleLeft(); }
uint16_t getDutycycleRight() const { return this->moveControl->getDutycycleRight(); }
protected:
protected:
void run() override;
private:
private:
void analogControl();
void digitalControl();
bool lastLoopTurned = false;
DirectionChangeWrapper* directionChangeWrapper = nullptr;
DirectionChangeWrapper *directionChangeWrapper = nullptr;
InputMode inputMode = InputMode::Analog;
};
+24 -12
View File
@@ -15,7 +15,8 @@ void TestMode::run()
if (this->maneuver == Maneuver::Turn)
{
uint16_t delta = abs(this->azimuth - this->getSensorData()->getRealAzimuth());
if (delta > this->degree) {
if (delta > this->degree)
{
this->abort = true;
}
}
@@ -31,7 +32,8 @@ void TestMode::run()
bool TestMode::drive(int16_t cmDistance, int16_t degree)
{
if (this->busy){
if (this->busy)
{
return false;
}
@@ -43,10 +45,12 @@ bool TestMode::drive(int16_t cmDistance, int16_t degree)
// Only left or right
this->moveControl->setSpeed(0);
if (degree < 0){
if (degree < 0)
{
this->moveControl->setRotationSpeed(-this->maxSpeeds.rot);
}
else if (degree > 0){
else if (degree > 0)
{
this->moveControl->setRotationSpeed(this->maxSpeeds.rot);
}
@@ -62,10 +66,12 @@ bool TestMode::drive(int16_t cmDistance, int16_t degree)
// Only forward or backward
this->moveControl->setRotationSpeed(0);
if (cmDistance < 0){
if (cmDistance < 0)
{
this->moveControl->setSpeed(-this->maxSpeeds.x);
}
else if (cmDistance > 0){
else if (cmDistance > 0)
{
this->moveControl->setSpeed(this->maxSpeeds.x);
}
@@ -78,10 +84,12 @@ bool TestMode::drive(int16_t cmDistance, int16_t degree)
{
// forward or backward and left or right
// TODO: Calculate roationspeed
if (cmDistance < 0){
if (cmDistance < 0)
{
this->moveControl->setSpeed(-this->maxSpeeds.x);
}
else if (cmDistance > 0){
else if (cmDistance > 0)
{
this->moveControl->setSpeed(this->maxSpeeds.x);
}
@@ -137,7 +145,8 @@ void TestMode::abortManeuver()
uint8_t TestMode::getRemainingManeuverTime() const
{
if (this->busy){
if (this->busy)
{
return static_cast<uint8_t>((this->maneuverTime - (millis() - this->actionStart)) / 1000);
}
return 0;
@@ -145,13 +154,16 @@ uint8_t TestMode::getRemainingManeuverTime() const
bool TestMode::engineInit(int16_t powerPercentage, int16_t seconds)
{
if (this->busy){
if (this->busy)
{
return false;
}
if (powerPercentage > TestMode::maxPercentage || powerPercentage < -TestMode::maxPercentage){
if (powerPercentage > TestMode::maxPercentage || powerPercentage < -TestMode::maxPercentage)
{
return false;
}
if (seconds < 0){
if (seconds < 0)
{
return false;
}
+9 -1
View File
@@ -26,7 +26,6 @@ class TestMode : public DriveModi
public:
/**
* @brief Different states to test the engine
*
*/
enum Maneuver
{
@@ -38,6 +37,14 @@ public:
Drive
};
/**
* @brief Let the rover drive
*
* @param cmDistance to drive
* @param degree degree to rotate over the hole distance
* @return true
* @return false
*/
bool drive(int16_t cmDistance = 0, int16_t degree = 0);
/**
@@ -89,6 +96,7 @@ public:
* @return false
*/
bool getBusy() const { return this->busy; }
Maneuver getManeuver() const { return this->maneuver; }
Speedometer *getSpeedometerLeft() const { return this->moveControl->getSpeedometerLeft(); }
Speedometer *getSpeedometerRight() const { return this->moveControl->getSpeedometerRight(); }
+13 -10
View File
@@ -20,9 +20,13 @@
#include "component.h"
#include "sensorData.h"
class DriveManager : public Component {
public:
/**
* @brief A class to manage and hold the different DriveModi
*
*/
class DriveManager : public Component
{
public:
/**
* @brief Construct a new Drive Manager object
*
@@ -30,7 +34,7 @@ class DriveManager : public Component {
* @param sensorData
* @param input
*/
DriveManager(MoveControl *moveControl, const SensorData* sensorData, const ControlPadInput *input);
DriveManager(MoveControl *moveControl, const SensorData *sensorData, const ControlPadInput *input);
/**
* @brief Construct a new Drive Manager object
@@ -47,7 +51,7 @@ class DriveManager : public Component {
*
* @param modus
*/
void changeModus(DriveModi* modus = nullptr);
void changeModus(DriveModi *modus = nullptr);
/**
* @brief Get the DriveModi Ptr object
@@ -59,13 +63,13 @@ class DriveManager : public Component {
* @see getDriveModi
* @return DriveModi*
*/
DriveModi* getDriveModiPtr() const { return this->currentModusPtr; }
DrivingSpeeds& getDrivingSpeedsRef() { return this->drivingSpeeds; }
DriveModi *getDriveModiPtr() const { return this->currentModusPtr; }
DrivingSpeeds &getDrivingSpeedsRef() { return this->drivingSpeeds; }
bool isActive() const { return this->currentModusPtr; }
private:
void run() override {};
private:
void run() override{};
void init();
DriveModi *currentModusPtr = nullptr;
@@ -73,5 +77,4 @@ class DriveManager : public Component {
DrivingSpeeds drivingSpeeds = {1, 7};
};
#endif // DRIVE_MANAGER_H
+8 -4
View File
@@ -1,26 +1,30 @@
#include "driveModi.h"
DriveModi::~DriveModi() {
DriveModi::~DriveModi()
{
this->moveControl->setSpeed(0);
this->moveControl->setRotationSpeed(0);
this->moveControl->setDrivingStatus(MoveControl::Status::Stop);
}
void DriveModi::activate(MoveControl* moveControl, ControlPadInput* input, SensorData* sensorData) {
void DriveModi::activate(MoveControl *moveControl, ControlPadInput *input, SensorData *sensorData)
{
this->moveControl = moveControl;
this->input = input;
this->sensorData = sensorData;
this->init();
}
void DriveModi::activate(DriveModiParams params){
void DriveModi::activate(DriveModiParams params)
{
this->moveControl = params.moveControl;
this->input = params.input;
this->sensorData = params.sensorData;
this->init();
}
void DriveModi::init() {
void DriveModi::init()
{
this->moveControl->setDrivingStatus(MoveControl::Status::Drive);
this->loopDelay = DriveModi::defaultDelay;
this->afterActivate();
+35 -13
View File
@@ -17,10 +17,14 @@
#include "controlPadInput.h"
#include "sensorData.h"
struct DriveModiParams {
MoveControl* moveControl;
const ControlPadInput* input;
const SensorData* sensorData;
/**
* @brief The struct contains all objects needed by a DriveMode
*/
struct DriveModiParams
{
MoveControl *moveControl;
const ControlPadInput *input;
const SensorData *sensorData;
};
/**
@@ -29,28 +33,46 @@ struct DriveModiParams {
* This class must be inherited by other classes which want to be
* act as a DriveModi, because the DriveModi structure uses polymorphism.
*/
class DriveModi : public Component {
public:
class DriveModi : public Component
{
public:
virtual ~DriveModi();
const SensorData* getSensorData() const { return this->sensorData; }
const SensorData *getSensorData() const { return this->sensorData; }
void activate(MoveControl* moveControl, ControlPadInput* input, SensorData* sensorData);
/**
* @brief This activates a DriveMode
*
* This function have to be called to provide the DriveMode
* with this objects
*
* @param moveControl
* @param input
* @param sensorData
*/
void activate(MoveControl *moveControl, ControlPadInput *input, SensorData *sensorData);
void activate(DriveModiParams params);
void setSpeeds(DrivingSpeeds speeds) { this->maxSpeeds = speeds; }
DrivingSpeeds getSpeeds() const { return this->maxSpeeds; }
DrivingSpeeds& getSpeedsRef() { return this->maxSpeeds; }
DrivingSpeeds &getSpeedsRef() { return this->maxSpeeds; }
protected:
protected:
/**
* @brief Prepare other things
*
* This function can be overwritten to prepare things
* for the specific DriveModi. This function will be
* called after activate().
*/
virtual void afterActivate() {}
MoveControl *moveControl = nullptr;
DrivingSpeeds maxSpeeds = {1, 7};
const ControlPadInput* input = nullptr;
const SensorData* sensorData = nullptr;
const ControlPadInput *input = nullptr;
const SensorData *sensorData = nullptr;
private:
private:
void init();
static constexpr uint8_t defaultDelay = 40;
+8 -8
View File
@@ -92,14 +92,14 @@ void setup()
lcd->clear();
lcd->noBacklight();
network = new Network(static_cast<const char*>(NetworkConfig::ssid),
static_cast<const char*>(NetworkConfig::password),
network = new Network(static_cast<const char *>(NetworkConfig::ssid),
static_cast<const char *>(NetworkConfig::password),
setIPs());
network->activateEspNow(receiveCallback, sendCallback);
if (NetworkConfig::mqtt)
{
if (network->activateMqtt(static_cast<const char*>(MqttConfig::user),
static_cast<const char*>(MqttConfig::password)))
if (network->activateMqtt(static_cast<const char *>(MqttConfig::user),
static_cast<const char *>(MqttConfig::password)))
{
DebugMqtt::init(network->getMqttClient(), Loglevel::debug);
debugMqtt = new DebugMqtt("Console");
@@ -125,11 +125,11 @@ void setup()
sensorData = new SensorData();
sensorData->enableGnss(spiPort, PinNumbers::gnssSpiCs);
sensorData->enableRealCompass();
sensorData->enableNtrip(static_cast<const char*>(NtripConfig::host),
sensorData->enableNtrip(static_cast<const char *>(NtripConfig::host),
NtripConfig::port,
static_cast<const char*>(NtripConfig::mountPoint),
static_cast<const char*>(NtripConfig::user),
static_cast<const char*>(NtripConfig::password));
static_cast<const char *>(NtripConfig::mountPoint),
static_cast<const char *>(NtripConfig::user),
static_cast<const char *>(NtripConfig::password));
// sensorData->enableGyroscope();
driveManager = new DriveManager(&moveController, sensorData, controlPad->getControlPadDataPtr());