finished speed and sensor menu in modes

This commit is contained in:
2023-09-29 11:30:13 +02:00
parent d7357d4f95
commit 45264c6481
17 changed files with 96 additions and 78 deletions
+4 -21
View File
@@ -39,34 +39,17 @@ class DriveModi : public Component {
void activate(MoveControl* moveControl, ControlPadInput* input, SensorData* sensorData);
void activate(DriveModiParams params);
/**
* @brief Set the max speed
*
* @param maxSpeed in m/s
*/
void setMaxSpeed(double maxForwardSpeed) { maxForwardSpeed = maxForwardSpeed; }
void increaseMaxSpeed(double increase = 0.1) { maxForwardSpeed += increase; }
void decreaseMaxSpeed(double increase = 0.1) { maxForwardSpeed -= increase; }
double getMaxSpeed() const { return this->maxForwardSpeed; }
/**
* @brief Set the max rotation
*
* @param maxRotation in rad/s (maybe)
*/
void setMaxRotation(double maxRotation) { maxRotationSpeed = maxRotation; }
void increaseMaxRotation(double increase = 0.1) { maxRotationSpeed += increase; }
void decreaseMaxRotation(double increase = 0.1) { maxRotationSpeed -= increase; }
double getMaxRotation() const { return this->maxRotationSpeed; }
void setSpeeds(DrivingSpeeds speeds) { this->maxSpeeds = speeds; }
DrivingSpeeds getSpeeds() const { return this->maxSpeeds; }
DrivingSpeeds& getSpeedsRef() { return this->maxSpeeds; }
protected:
virtual void afterActivate() {}
MoveControl *moveControl;
DrivingSpeeds maxSpeeds = {1, 7};
const ControlPadInput* input;
const SensorData* sensorData;
double maxForwardSpeed = 1;
double maxRotationSpeed = 7;
private:
void init();