autopilot inherits speed from manualControl

spelling
refactor
This commit is contained in:
2023-08-14 15:28:21 +02:00
parent 99dc1709d8
commit c7a19163ff
4 changed files with 22 additions and 21 deletions
@@ -66,20 +66,20 @@ class ManualControl : public DriveModi {
*
* @param maxSpeed in m/s
*/
void setMaxSpeed(double maxSpeed) { max_speed = maxSpeed; }
void increaseMaxSpeed(double increase = 0.1) { max_speed += increase; }
void decreaseMaxSpeed(double increase = 0.1) { max_speed -= increase; }
double getMaxSpeed() { return this->max_speed; }
void setMaxSpeed(double maxForwardSpeed) { maxForwardSpeed = maxForwardSpeed; }
void increaseMaxSpeed(double increase = 0.1) { maxForwardSpeed += increase; }
void decreaseMaxSpeed(double increase = 0.1) { maxForwardSpeed -= increase; }
double getMaxSpeed() { return this->maxForwardSpeed; }
/**
* @brief Set the max rotation
*
* @param maxRotation in rad/s (maybe)
*/
void setMaxRotation(double maxRotation) { max_rotation = maxRotation; }
void increaseMaxRotation(double increase = 0.1) { max_rotation += increase; }
void decreaseMaxRotation(double increase = 0.1) { max_rotation -= increase; }
double getMaxRotation() { return this->max_rotation; }
void setMaxRotation(double maxRotation) { maxRotationSpeed = maxRotation; }
void increaseMaxRotation(double increase = 0.1) { maxRotationSpeed += increase; }
void decreaseMaxRotation(double increase = 0.1) { maxRotationSpeed -= increase; }
double getMaxRotation() { return this->maxRotationSpeed; }
void setCalibrateCompass(CalibrateCompass* val = nullptr) { this->caliCompass = val; }
@@ -94,6 +94,8 @@ class ManualControl : public DriveModi {
protected:
MoveControl *moveControl;
const ControlPadInput* input;
double maxForwardSpeed = 1;
double maxRotationSpeed = 7;
private:
/**
@@ -106,8 +108,6 @@ class ManualControl : public DriveModi {
bool lastLoopTurned = false;
uint8_t delay = 10;
uint32_t lastMillis = 0;
double max_speed = 1;
double max_rotation = 7;
CalibrateCompass* caliCompass = nullptr;
DirectionChangeWrapper* directionChangeWrapper = nullptr;
InputMode inputMode = InputMode::Analog;