bug fix static in motor und speed

This commit is contained in:
2022-01-29 12:25:06 +01:00
parent 1265cfda5c
commit 9c4c82f8b3
18 changed files with 197 additions and 99 deletions
+4 -2
View File
@@ -16,6 +16,7 @@ DriveManager::DriveManager(MoveControl *moveControl) {
}
void DriveManager::loop() {
this->moveControl->loop();
if (currentModus)
this->currentModus->loop();
}
@@ -31,11 +32,12 @@ void DriveManager::nextModus() {
void DriveManager::changeModus(Modi modus) {
//Set moveControl to a safe state
delete this->currentModus;
this->moveControl->setSpeed(0);
this->moveControl->setRotationspeed(0);
this->moveControl->setDrivingStatus(DrivingStatus::stop);
delete this->currentModus;
switch (modus) {
case Modi::Off:
this->currentModus = nullptr;