a lot of bullshit

This commit is contained in:
2021-12-14 19:22:06 +01:00
parent 1fc5a75f33
commit cd29191bb4
27 changed files with 703 additions and 551 deletions
+72
View File
@@ -0,0 +1,72 @@
/**
* @file driveManager.cpp
* @author Alexander Klein (alex@kleiax.de)
* @brief Implemention of the class driveManager.h.
* @version 0.1
* @date 2021-12-14
*
* @copyright Copyright (c) 2021
*
*/
#include "driveModi/driveManager.h"
DriveManager::DriveManager(MoveControl *moveControl) {
this->moveControl = moveControl;
}
void DriveManager::loop() {
this->currentModus->loop();
this->moveControl->loop();
}
void DriveManager::runDriveManager() {
}
void DriveManager::nextModus() {
}
void DriveManager::changeModus(Modi modus) {
//Set moveControl to a safe state
this->moveControl->setSpeed(0);
this->moveControl->setRotationspeed(0);
this->moveControl->setDrivingStatus(DrivingStatus::stop);
delete this->currentModus;
switch (modus) {
case Modi::Off:
this->currentModus = nullptr;
break;
case Modi::ManualControl: {
ManualControl *ptr = new ManualControl;
ptr->init(this->moveControl);
this->currentModus = ptr;
}
break;
case Modi::CaptureRoute:
this->currentModus = nullptr;
break;
case Modi::Autopilot:
this->currentModus = nullptr;
break;
case Modi::ConsolControl:
this->currentModus = nullptr;
break;
case Modi::TestMode:
this->currentModus = nullptr;
break;
default:
this->currentModus = nullptr;
break;
}
}