58 lines
1.2 KiB
C++
58 lines
1.2 KiB
C++
/**
|
|
* @file testMode.h
|
|
* @author Alexander Klein (alex@kleiax.de)
|
|
* @brief
|
|
* @version 0.1
|
|
* @date 2022-09-08
|
|
*
|
|
* @copyright Copyright (c) 2022
|
|
*
|
|
*/
|
|
#ifndef TEST_MODE_H
|
|
#define TEST_MODE_H
|
|
|
|
#include "moveControl.h"
|
|
#include "driveModi/driveModi.h"
|
|
|
|
class TestMode : public DriveModi {
|
|
public:
|
|
TestMode(MoveControl *MoveControl);
|
|
~TestMode();
|
|
|
|
void loop() override;
|
|
|
|
void setSpeed(int16_t speed);
|
|
void setRotationSpeed(int16_t speed);
|
|
|
|
bool drive(int16_t cm = 0, int16_t degree = 0);
|
|
|
|
bool leftEngine(int16_t powerPercentage, int16_t seconds);
|
|
bool rightEngine(int16_t powerPercentage, int16_t seconds);
|
|
bool bothEngine(int16_t powerPercentage, int16_t seconds);
|
|
|
|
void abortManeuver();
|
|
|
|
uint8_t getRemainingManeuverTime();
|
|
bool getBusy() const { return this->busy; }
|
|
|
|
private:
|
|
bool engineInit(int16_t powerPercentage, int16_t seconds);
|
|
|
|
MoveControl *moveControl;
|
|
|
|
double speed = 0;
|
|
double rotationSpeed = 0;
|
|
|
|
bool busy = false;
|
|
bool abort = false;
|
|
|
|
uint8_t delay = 10;
|
|
|
|
uint32_t maneuverTime = 0;
|
|
uint32_t lastMillis = 0;
|
|
uint32_t actionStart = 0;
|
|
|
|
};
|
|
|
|
#endif // TEST_MODE_H
|