- added data validation in calibrate compass

- activatre auto load calibration data
- give possibility to force update in navigation getCourseCorrection
- added drive mode for compass calibration
- removed compass calibration manualControl
This commit is contained in:
2023-05-31 12:48:41 +02:00
parent e0d6853961
commit 38c8a58988
10 changed files with 263 additions and 71 deletions
@@ -11,12 +11,10 @@
#include "menuManualDrive.h"
MenuManualControl::MenuManualControl(DriveManager* driveManager) : MenuDriveMode(driveManager) {
this->caliCompass = new CalibrateCompass(this->driveManager->getNavigation()->getCompass());
}
MenuManualControl::~MenuManualControl() {
delete this->caliCompass;
this->manualControl->setCalibrateCompass();
}
void MenuManualControl::printPage() const {
@@ -61,32 +59,10 @@ void MenuManualControl::printPage() const {
lineOne = "Dutycycle Right:";
lineTwo.concat(this->manualControl->getDutycycleRight());
break;
case 7:
switch (this->caliCompass->getState()) {
case CalibrateCompass::State::Ready :
lineOne = "Start compass";
lineTwo = "calibration";
break;
case CalibrateCompass::State::Calibrating :
lineOne = "Calibrating...";
lineTwo = "Move around";
break;
case CalibrateCompass::State::Finished:
lineOne = "Calibration";
lineTwo = "finished";
break;
default:
break;
}
break;
case 8:
lineOne = "Save compass";
lineTwo = "data in flash";
lineOne = "Azimuth:";
lineTwo.concat(this->driveManager->getNavigation()->getAzimuth());
break;
default:
@@ -101,7 +77,7 @@ void MenuManualControl::init() {
this->firstPrint = false;
this->driveManager->changeModus(Modi::ManualControl);
this->manualControl = (ManualControl*) this->driveManager->getDriveModiPtr();
this->setCountPages(9);
this->setCountPages(8);
this->updateDelay = 500;
}
@@ -123,27 +99,6 @@ void MenuManualControl::runCommand() const {
case 4:
this->manualControl->increaseMaxRotation();
break;
case 7:
switch (this->caliCompass->getState()) {
case CalibrateCompass::State::Ready :
this->manualControl->setCalibrateCompass(this->caliCompass);
this->caliCompass->start();
break;
case CalibrateCompass::State::Finished:
this->manualControl->setCalibrateCompass();
this->caliCompass->useData();
this->caliCompass->reset();
break;
default:
break;
}
break;
case 8:
this->caliCompass->saveData();
default:
break;