refactore
all components now have a base class compnent for loop functions
This commit is contained in:
2023-08-18 10:47:35 +02:00
parent 25d37e3970
commit 11d21e2e89
35 changed files with 303 additions and 511 deletions
+1 -30
View File
@@ -47,28 +47,6 @@ class TestMode : public DriveModi {
TestMode(MoveControl *moveControl, Navigation* navigation);
~TestMode();
/**
* @brief Controls the maneuver.
*
* Needed for actions which take a longer time.
* Should be called ever main loop.
*/
void loop() override;
/**
* @brief Set the speed for the Maneuver Drive
*
* @param speed m/s / 100
*/
void setSpeed(int16_t speed);
/**
* @brief Set the rotation speed for the Maneuver Drive
*
* @param speed rad/s / 100
*/
void setRotationSpeed(int16_t speed);
bool drive(int16_t cm = 0, int16_t degree = 0);
/**
@@ -125,28 +103,21 @@ class TestMode : public DriveModi {
Speedometer* getSpeedometerRight() { return this->moveControl->getSpeedometerRight(); }
private:
void run() override;
bool engineInit(int16_t powerPercentage, int16_t seconds);
MoveControl *moveControl;
Navigation* navigation;
Maneuver maneuver = Maneuver::None;
int16_t maneuverValueOne = 0;
int16_t maneuverValueTwo = 0;
double speed = 0;
double rotationSpeed = 0;
bool busy = false;
bool abort = false;
uint8_t delay = 10;
uint16_t azimuth;
int16_t degree;
uint32_t maneuverTime = 0;
uint32_t lastMillis = 0;
uint32_t actionStart = 0;
};
#endif // TEST_MODE_H