autopilot inherits speed from manualControl
spelling refactor
This commit is contained in:
@@ -139,12 +139,15 @@ void Autopilot::init() {
|
||||
this->courseCorrection.correction = 0;
|
||||
this->courseCorrection.distance = 0;
|
||||
this->updateDisplay = true;
|
||||
|
||||
this->maxRotationSpeed = 4.5;
|
||||
this->maxForwardSpeed = 1;
|
||||
}
|
||||
|
||||
void Autopilot::drive() {
|
||||
this->moveControl->setRotationSpeed(0);
|
||||
if (this->courseCorrection.distance >= this->minRemainingDistance)
|
||||
this->moveControl->setSpeed(this->drivingSpeed);
|
||||
this->moveControl->setSpeed(this->maxForwardSpeed);
|
||||
else
|
||||
this,moveControl->setSpeed(0);
|
||||
}
|
||||
@@ -158,9 +161,9 @@ void Autopilot::beginRotate() {
|
||||
|
||||
this->moveControl->setSpeed(0);
|
||||
if (this->courseCorrection.correction > 0)
|
||||
this->moveControl->setRotationSpeed(-this->rotationSpeed);
|
||||
this->moveControl->setRotationSpeed(-this->maxRotationSpeed);
|
||||
else
|
||||
this->moveControl->setRotationSpeed(this->rotationSpeed);
|
||||
this->moveControl->setRotationSpeed(this->maxRotationSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user