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
+8 -8
View File
@@ -37,9 +37,9 @@ bool TestMode::drive(int16_t cm, int16_t degree) {
this->moveControl->setSpeed(0);
if (degree < 0)
this->moveControl->setRotationSpeed(-this->maxRotationSpeed);
this->moveControl->setRotationSpeed(-this->maxSpeeds.rot);
else if (degree > 0)
this->moveControl->setRotationSpeed(this->maxRotationSpeed);
this->moveControl->setRotationSpeed(this->maxSpeeds.rot);
this->azimuth = this->getSensorData()->getRealAzimuth();
this->degree = degree;
@@ -53,11 +53,11 @@ bool TestMode::drive(int16_t cm, int16_t degree) {
this->moveControl->setRotationSpeed(0);
if (cm < 0)
this->moveControl->setSpeed(-this->maxForwardSpeed);
this->moveControl->setSpeed(-this->maxSpeeds.x);
else if (cm > 0)
this->moveControl->setSpeed(this->maxForwardSpeed);
this->moveControl->setSpeed(this->maxSpeeds.x);
this->maneuverTime = (uint32_t) (((double) abs(cm) / 100.0) / this->maxForwardSpeed) * 1000;
this->maneuverTime = (uint32_t) (((double) abs(cm) / 100.0) / this->maxSpeeds.x) * 1000;
this->busy = true;
this->maneuver = Maneuver::Drive;
return true;
@@ -65,11 +65,11 @@ bool TestMode::drive(int16_t cm, int16_t degree) {
//forward or backward and left or right
// TODO: Calculate roationspeed
if (cm < 0)
this->moveControl->setSpeed(-this->maxForwardSpeed);
this->moveControl->setSpeed(-this->maxSpeeds.x);
else if (cm > 0)
this->moveControl->setSpeed(this->maxForwardSpeed);
this->moveControl->setSpeed(this->maxSpeeds.x);
this->maneuverTime = (uint32_t) (((double) cm / 100.0) / this->maxForwardSpeed) * 1000;
this->maneuverTime = (uint32_t) (((double) cm / 100.0) / this->maxSpeeds.x) * 1000;
this->busy = true;
this->maneuver = Maneuver::Drive;
return true;