76 lines
1.8 KiB
C++
76 lines
1.8 KiB
C++
/**
|
|
* @file driveManager.h
|
|
* @author Alexander Klein (alex@kleiax.de)
|
|
* @brief Contains a class to switch the DriveModi
|
|
* @version 0.1
|
|
* @date 2021-12-14
|
|
*
|
|
* @copyright Copyright (c) 2021
|
|
*
|
|
*/
|
|
|
|
#ifndef DRIVE_MANAGER_H
|
|
#define DRIVE_MANAGER_H
|
|
|
|
#include "moveControl.h"
|
|
#include "driveModi/driveModi.h"
|
|
#include "navigation.h"
|
|
#include "config.h"
|
|
#include "controlPadInput.h"
|
|
#include "component.h"
|
|
#include "sensorData.h"
|
|
|
|
class DriveManager : public Component {
|
|
public:
|
|
/**
|
|
* @brief Construct a new Drive Manager object
|
|
*
|
|
* Creates a Navigation object
|
|
*
|
|
* @param moveControl
|
|
*/
|
|
DriveManager(MoveControl *moveControl, const SensorData* sensorData, const ControlPadInput *input);
|
|
DriveManager(DriveModiParams params);
|
|
|
|
/**
|
|
* @brief Destroy the Drive Manager object
|
|
*
|
|
*/
|
|
~DriveManager();
|
|
|
|
/**
|
|
* @brief Change the DriveModi to a specific value
|
|
*
|
|
* Sets MoveControl to a safe state, delete the last
|
|
* DriveModi and than set the new DriveModi
|
|
*
|
|
* @param modus
|
|
*/
|
|
void changeModus(DriveModi* modus = nullptr);
|
|
|
|
/**
|
|
* @brief Get the DriveModi Ptr object
|
|
*
|
|
* This is a pointer to the Object of the current DriveMode.
|
|
* If you know which DriveMode is active, you can cast this
|
|
* pointer to it.
|
|
*
|
|
* @see getDriveModi
|
|
* @return DriveModi*
|
|
*/
|
|
DriveModi* getDriveModiPtr() const { return this->currentModusPtr; }
|
|
|
|
|
|
bool isActive() const { return this->currentModusPtr; }
|
|
|
|
private:
|
|
void run() override {};
|
|
void init();
|
|
|
|
DriveModi *currentModusPtr = nullptr;
|
|
DriveModiParams driveModiParams;
|
|
};
|
|
|
|
|
|
#endif // DRIVE_MANAGER_H
|