small fixes

This commit is contained in:
2023-08-07 13:05:42 +02:00
parent 3549af2470
commit 8ed91c4b11
7 changed files with 16 additions and 13 deletions
+6 -8
View File
@@ -119,10 +119,10 @@ void Autopilot::drive() {
void Autopilot::rotate() {
this->moveControl->setSpeed(0);
if (this->courseCorrection.correction > 0)
this->moveControl->setRotationSpeed(this->rotationSpeed);
this->moveControl->setRotationSpeed(-this->rotationSpeed);
else
this->moveControl->setRotationSpeed(-this->rotationSpeed);
this->moveControl->setRotationSpeed(this->rotationSpeed);
}
void Autopilot::checkButtonInput() {
@@ -172,10 +172,8 @@ void Autopilot::askNavigationForOrder() {
}
void Autopilot::selfDriving() {
if (this->lastOrderStatus == Navigation::Status::Updated) {
if (abs(this->courseCorrection.correction) >= this->maxCourseDeviationBerforeAct)
this->rotate();
else
this->drive();
}
if (abs(this->courseCorrection.correction) >= this->maxCourseDeviationBerforeAct)
this->rotate();
else
this->drive();
}