- added calc azimuth to autopilot menu

- getters in navigation for calc azimuth
- wrapper for manualControl for automatic orintaion change
This commit is contained in:
2023-08-08 22:59:28 +02:00
parent 620812b5f8
commit f236d98be2
7 changed files with 73 additions and 10 deletions
+20 -2
View File
@@ -12,13 +12,31 @@
#include "driveModi/Modi/Autopilot/autopilot.h"
#include "autopilot.h"
DirectionChangeSignal::DirectionChangeSignal(Navigation* navigation) {
this->navigation = navigation;
this->action();
}
DirectionChangeSignal::~DirectionChangeSignal() {
navigation->dissableCalcAzimuth();
}
void DirectionChangeSignal::action() {
this->navigation->drivingDirectionChange();
}
Autopilot::Autopilot(MoveControl* moveControl, const ControlPadInput *input, Navigation* navigation)
: ManualControl(moveControl, input) {
this->setInputMode(ManualControl::InputMode::Digital);
this->setDirectionChangeCallback(this->directionChangeSignal);
this->directionChangeSignal = new DirectionChangeSignal(navigation);
this->navigation = navigation;
this->init();
}
Autopilot::~Autopilot() {
delete this->directionChangeSignal;
// this->navigation->getNTRIPClient()->setActivated(false);
}
@@ -121,8 +139,8 @@ void Autopilot::rotate() {
if (this->courseCorrection.correction > 0)
this->moveControl->setRotationSpeed(-this->rotationSpeed);
else
this->moveControl->setRotationSpeed(this->rotationSpeed);
this->moveControl->setRotationSpeed(this->rotationSpeed);
this->navigation->drivingDirectionChange();
}
void Autopilot::checkButtonInput() {