From 147eea1f92585799433d3d9ef18d29f3cafc040a Mon Sep 17 00:00:00 2001 From: Alexander Klein Date: Mon, 14 Aug 2023 07:11:03 +0200 Subject: [PATCH] some code quality --- doc/Notes and TODOs/TODO allgemein.txt | 4 ++++ doc/latexSnippet.cpp | 9 +++++++++ lib/Navigation/navigation.h | 3 +++ src/driveModi/Modi/ManualControl/manualControl.cpp | 4 ++-- 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 doc/latexSnippet.cpp diff --git a/doc/Notes and TODOs/TODO allgemein.txt b/doc/Notes and TODOs/TODO allgemein.txt index 03df2c4..31466a6 100644 --- a/doc/Notes and TODOs/TODO allgemein.txt +++ b/doc/Notes and TODOs/TODO allgemein.txt @@ -1,3 +1,7 @@ -> Program underfloorLighting -> Add an beeper -> Program the beeper + + Capture Route Punkte auch nicht zu weit auseinander + Autopilot Funktionen zum einstellen der Geschwindigkeiten + Speedometer zweiter Buffer mit auslesezeiten, weil sonst Sinnlos da kein zeitliche Refernez zu berechnen vorhanden diff --git a/doc/latexSnippet.cpp b/doc/latexSnippet.cpp new file mode 100644 index 0000000..ac4c65b --- /dev/null +++ b/doc/latexSnippet.cpp @@ -0,0 +1,9 @@ +void KomponenteA::loop() { + this->komponenteB->loop(); + this->komponenteC->loop(); + + if (millis() - this->lastMillis < this->delayMillis) + return; + + this->doSomething(); +} diff --git a/lib/Navigation/navigation.h b/lib/Navigation/navigation.h index 56f4366..4f2e9ff 100644 --- a/lib/Navigation/navigation.h +++ b/lib/Navigation/navigation.h @@ -122,6 +122,7 @@ class Navigation { double increaseMinDistanceToReachPoint() { return this->minDistanceToReachPoint += 0.1; } double decreaseMinDistanceToReachPoint() { return this->minDistanceToReachPoint -= 0.1; } + // TODO: Dokumentation korrigieren. /** * @brief Get the Course Correction object * @@ -133,6 +134,8 @@ class Navigation { */ Status getCourseCorrection(CourseCorrection& correction, bool forceUpdate = false); + + // TODO: Dokumentation korrigieren. /** * @brief Tries to add the current Position to the route * diff --git a/src/driveModi/Modi/ManualControl/manualControl.cpp b/src/driveModi/Modi/ManualControl/manualControl.cpp index 385f06b..5ce8dc9 100644 --- a/src/driveModi/Modi/ManualControl/manualControl.cpp +++ b/src/driveModi/Modi/ManualControl/manualControl.cpp @@ -43,9 +43,9 @@ void ManualControl::runManualControl() { // std::cout << "x: " << (int) x << " y: " << (int) y << std::endl; // } - double value_per_step = this->max_speed * 2 / 256; + double value_per_step = this->max_speed * 2 / UINT8_MAX; this->moveControl->setSpeed(-y * value_per_step); - value_per_step = this->max_rotation * 2 / 256; + value_per_step = this->max_rotation * 2 / UINT8_MAX; this->moveControl->setRotationSpeed(x * value_per_step); }