driveManager gets now the object

This commit is contained in:
2023-09-04 15:25:56 +02:00
parent 6a76470f45
commit befbd898cc
23 changed files with 63 additions and 156 deletions
+3 -40
View File
@@ -12,38 +12,14 @@
#ifndef DRIVE_MANAGER_H
#define DRIVE_MANAGER_H
#include <Arduino.h>
#include <SPI.h>
#include "moveControl.h"
#include "driveModi/driveModi.h"
#include "navigation.h"
#include "config.h"
#include "networkConfig.h"
#include "debugTimes.h"
#include "controlPadInput.h"
#include "component.h"
#include "sensorData.h"
// All Drive Modi
#include "driveModi/Modi/ManualControl/manualControl.h"
#include "driveModi/Modi/CaptureRoute/captureRoute.h"
#include "driveModi/Modi/Autopilot/autopilot.h"
#include "driveModi/Modi/TestMode/testMode.h"
/**
* @brief An enum to choose the DriveMode
*
*/
enum class Modi {
Off,
ManualControl,
CalibrateCompass,
CaptureRoute,
Autopilot,
TestMode
};
class DriveManager : public Component {
public:
/**
@@ -70,14 +46,7 @@ class DriveManager : public Component {
*
* @param modus
*/
void changeModus(Modi modus);
/**
* @brief Get the Navigation object
*
* @return Navigation*
*/
Navigation* getNavigation() const {return this->navigation;}
void changeModus(DriveModi* modus = nullptr);
/**
* @brief Get the DriveModi Ptr object
@@ -91,20 +60,14 @@ class DriveManager : public Component {
*/
DriveModi* getDriveModiPtr() const { return this->currentModusPtr; }
/**
* @brief Get the DriveModi enum
*
* @return Modi
*/
Modi getDriveModi() const { return this->currentModus; }
bool isActive() const { return this->currentModusPtr; }
private:
void run() override {};
void init();
Modi currentModus = Modi::Off;
DriveModi *currentModusPtr = nullptr;
Navigation* navigation;
DriveModiParams driveModiParams;
};