From 98f3cb93f0d212e73a521661337896d648b76071 Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Wed, 9 Aug 2023 15:34:03 +0200 Subject: [PATCH] calc Azimuth finished --- .version_no_increment | 0 include/Version.h | 4 ++-- lib/Navigation/navigation.cpp | 2 ++ src/driveModi/Modi/Autopilot/autopilot.cpp | 2 +- src/driveModi/Modi/Autopilot/autopilot.h | 10 +--------- version | 2 +- 6 files changed, 7 insertions(+), 13 deletions(-) delete mode 100644 .version_no_increment diff --git a/.version_no_increment b/.version_no_increment deleted file mode 100644 index e69de29..0000000 diff --git a/include/Version.h b/include/Version.h index 79e1506..534eccd 100644 --- a/include/Version.h +++ b/include/Version.h @@ -1,9 +1,9 @@ // AUTO GENERATED FILE, DO NOT EDIT #ifndef VERSION - #define VERSION "0.8.21" + #define VERSION "0.8.27" #endif #ifndef BUILD_TIMESTAMP - #define BUILD_TIMESTAMP "2023-08-08 22:55:37.389313" + #define BUILD_TIMESTAMP "2023-08-09 10:33:06.900861" #endif \ No newline at end of file diff --git a/lib/Navigation/navigation.cpp b/lib/Navigation/navigation.cpp index 70ad78c..4a5ec70 100644 --- a/lib/Navigation/navigation.cpp +++ b/lib/Navigation/navigation.cpp @@ -126,6 +126,7 @@ void Navigation::drivingDirectionChange() { if (tmp.isInit() && tmp.isValid()) { this->directionChangeMode = true; this->lastPointDrivingDirectionChange = tmp; + this->calcAzimuthState = CalcAzimuthState::Invalid; } } @@ -200,6 +201,7 @@ void Navigation::updateMagneticDeclination() { || this->lastPointDrivingDirectionChange.distanceTo(this->currentPosition) < 1.0) { this->calcAzimuthState = CalcAzimuthState::Invalid; + this->calcAzimuth = 999; return; } diff --git a/src/driveModi/Modi/Autopilot/autopilot.cpp b/src/driveModi/Modi/Autopilot/autopilot.cpp index c3d413f..e6a9e94 100644 --- a/src/driveModi/Modi/Autopilot/autopilot.cpp +++ b/src/driveModi/Modi/Autopilot/autopilot.cpp @@ -29,8 +29,8 @@ void DirectionChangeSignal::action() { 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->setDirectionChangeCallback(this->directionChangeSignal); this->navigation = navigation; this->init(); } diff --git a/src/driveModi/Modi/Autopilot/autopilot.h b/src/driveModi/Modi/Autopilot/autopilot.h index fa33412..dfbf21c 100644 --- a/src/driveModi/Modi/Autopilot/autopilot.h +++ b/src/driveModi/Modi/Autopilot/autopilot.h @@ -76,15 +76,6 @@ class Autopilot : public ManualControl { */ void loop(); - /** - * @brief Manges the autopilot - * - * If the first Point is near to current location you can turn - * the autopilot on. - * Gets the course correction and decide what to do. - */ - void runAutopilot(); - void restart(); /** @@ -120,6 +111,7 @@ class Autopilot : public ManualControl { void init(); void drive(); void rotate(); + void runAutopilot(); void checkButtonInput(); void askNavigationForOrder(); void selfDriving(); diff --git a/version b/version index 49d791b..bdf3118 100644 --- a/version +++ b/version @@ -1 +1 @@ -0.8.21 \ No newline at end of file +0.8.27 \ No newline at end of file