doxygen finished
This commit is contained in:
@@ -15,7 +15,8 @@ void TestMode::run()
|
||||
if (this->maneuver == Maneuver::Turn)
|
||||
{
|
||||
uint16_t delta = abs(this->azimuth - this->getSensorData()->getRealAzimuth());
|
||||
if (delta > this->degree) {
|
||||
if (delta > this->degree)
|
||||
{
|
||||
this->abort = true;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +32,8 @@ void TestMode::run()
|
||||
|
||||
bool TestMode::drive(int16_t cmDistance, int16_t degree)
|
||||
{
|
||||
if (this->busy){
|
||||
if (this->busy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -43,10 +45,12 @@ bool TestMode::drive(int16_t cmDistance, int16_t degree)
|
||||
// Only left or right
|
||||
this->moveControl->setSpeed(0);
|
||||
|
||||
if (degree < 0){
|
||||
if (degree < 0)
|
||||
{
|
||||
this->moveControl->setRotationSpeed(-this->maxSpeeds.rot);
|
||||
}
|
||||
else if (degree > 0){
|
||||
else if (degree > 0)
|
||||
{
|
||||
this->moveControl->setRotationSpeed(this->maxSpeeds.rot);
|
||||
}
|
||||
|
||||
@@ -62,10 +66,12 @@ bool TestMode::drive(int16_t cmDistance, int16_t degree)
|
||||
// Only forward or backward
|
||||
this->moveControl->setRotationSpeed(0);
|
||||
|
||||
if (cmDistance < 0){
|
||||
if (cmDistance < 0)
|
||||
{
|
||||
this->moveControl->setSpeed(-this->maxSpeeds.x);
|
||||
}
|
||||
else if (cmDistance > 0){
|
||||
else if (cmDistance > 0)
|
||||
{
|
||||
this->moveControl->setSpeed(this->maxSpeeds.x);
|
||||
}
|
||||
|
||||
@@ -78,10 +84,12 @@ bool TestMode::drive(int16_t cmDistance, int16_t degree)
|
||||
{
|
||||
// forward or backward and left or right
|
||||
// TODO: Calculate roationspeed
|
||||
if (cmDistance < 0){
|
||||
if (cmDistance < 0)
|
||||
{
|
||||
this->moveControl->setSpeed(-this->maxSpeeds.x);
|
||||
}
|
||||
else if (cmDistance > 0){
|
||||
else if (cmDistance > 0)
|
||||
{
|
||||
this->moveControl->setSpeed(this->maxSpeeds.x);
|
||||
}
|
||||
|
||||
@@ -137,7 +145,8 @@ void TestMode::abortManeuver()
|
||||
|
||||
uint8_t TestMode::getRemainingManeuverTime() const
|
||||
{
|
||||
if (this->busy){
|
||||
if (this->busy)
|
||||
{
|
||||
return static_cast<uint8_t>((this->maneuverTime - (millis() - this->actionStart)) / 1000);
|
||||
}
|
||||
return 0;
|
||||
@@ -145,13 +154,16 @@ uint8_t TestMode::getRemainingManeuverTime() const
|
||||
|
||||
bool TestMode::engineInit(int16_t powerPercentage, int16_t seconds)
|
||||
{
|
||||
if (this->busy){
|
||||
if (this->busy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (powerPercentage > TestMode::maxPercentage || powerPercentage < -TestMode::maxPercentage){
|
||||
if (powerPercentage > TestMode::maxPercentage || powerPercentage < -TestMode::maxPercentage)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (seconds < 0){
|
||||
if (seconds < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user