doxygen finished
This commit is contained in:
@@ -4,53 +4,70 @@
|
||||
* @brief A small class to drive the Rover by the controller joystick.
|
||||
* @version 0.1
|
||||
* @date 2021-12-13
|
||||
*
|
||||
*
|
||||
* @copyright Copyright (c) 2021
|
||||
*
|
||||
*
|
||||
*/
|
||||
#ifndef MANUAL_CONTROL_H
|
||||
#define MANUAL_CONTROL_H
|
||||
|
||||
#include "driveModi/driveModi.h"
|
||||
|
||||
class DirectionChangeWrapper {
|
||||
public:
|
||||
virtual void action() = 0;
|
||||
class DirectionChangeWrapper
|
||||
{
|
||||
public:
|
||||
virtual void action() = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Drive the Rover with a Joystick
|
||||
*
|
||||
* This class gets the x and y value from the PS3 controller
|
||||
*
|
||||
* This class gets the x and y value from the ControlPad
|
||||
* and map the values to moveControl
|
||||
*
|
||||
*
|
||||
* @see MoveControl
|
||||
*/
|
||||
class ManualControl : public DriveModi {
|
||||
public:
|
||||
enum class InputMode : uint8_t {
|
||||
Analog,
|
||||
Digital
|
||||
};
|
||||
class ManualControl : public DriveModi
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief The enum is used to change the interpretation of the joystick data
|
||||
*/
|
||||
enum class InputMode : uint8_t
|
||||
{
|
||||
Analog,
|
||||
Digital
|
||||
};
|
||||
|
||||
void switchInputMode();
|
||||
void setInputMode(InputMode mode) { this->inputMode = mode; }
|
||||
InputMode getInputMode() const { return this->inputMode; }
|
||||
void setDirectionChangeCallback(DirectionChangeWrapper* callback) { this->directionChangeWrapper = callback; }
|
||||
/**
|
||||
* @brief Change the InputMode to the opposite
|
||||
*/
|
||||
void switchInputMode();
|
||||
void setInputMode(InputMode mode) { this->inputMode = mode; }
|
||||
InputMode getInputMode() const { return this->inputMode; }
|
||||
|
||||
uint16_t getDutycycleLeft() const { return this->moveControl->getDutycycleLeft(); }
|
||||
uint16_t getDutycycleRight() const { return this->moveControl->getDutycycleRight(); }
|
||||
/**
|
||||
* @brief Set the DirectionChangeWrapper object
|
||||
*
|
||||
* This callback is used to inform the CalcAzimuth Component about a direction change
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
void setDirectionChangeCallback(DirectionChangeWrapper *callback) { this->directionChangeWrapper = callback; }
|
||||
|
||||
protected:
|
||||
void run() override;
|
||||
uint16_t getDutycycleLeft() const { return this->moveControl->getDutycycleLeft(); }
|
||||
uint16_t getDutycycleRight() const { return this->moveControl->getDutycycleRight(); }
|
||||
|
||||
private:
|
||||
void analogControl();
|
||||
void digitalControl();
|
||||
protected:
|
||||
void run() override;
|
||||
|
||||
bool lastLoopTurned = false;
|
||||
DirectionChangeWrapper* directionChangeWrapper = nullptr;
|
||||
InputMode inputMode = InputMode::Analog;
|
||||
private:
|
||||
void analogControl();
|
||||
void digitalControl();
|
||||
|
||||
bool lastLoopTurned = false;
|
||||
DirectionChangeWrapper *directionChangeWrapper = nullptr;
|
||||
InputMode inputMode = InputMode::Analog;
|
||||
};
|
||||
|
||||
#endif // MANUAL_CONTROL_H
|
||||
|
||||
Reference in New Issue
Block a user