small fixes
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
-> Program underfloorLighting
|
||||
-> Add an beeper
|
||||
-> Program the beeper
|
||||
|
||||
Speedometer buffer ergibt kaum Sinn
|
||||
Abweichung max 25 cm bevor zu ungenau damit nie mehr als 50 cm gesamt.
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#define PWMRES 8
|
||||
#define POWERSTEPS 2 // A total of 20 levels ( 100 / SPEED_STEPS ) * RUN_MOTOR_CONTROL_DELAY = 500ms
|
||||
#define PWMMIN 55
|
||||
#define PWMMAX 90 // Max 98% of 2^PWM_RES
|
||||
#define PWMMAX 94 // Max 98% of 2^PWM_RES
|
||||
|
||||
/**
|
||||
* @brief A class which use PWM to control the power of DC Motor
|
||||
|
||||
@@ -134,6 +134,7 @@ Navigation::Status Navigation::getCourseCorrection(CourseCorrection& correction,
|
||||
if (this->currentPosition.distanceTo(this->lastPointCalcCorrection) < (this->minDistanceToReachPoint / 2.0)
|
||||
&& !forceUpdate) {
|
||||
correction.correction = this->calculateCourseCorrection(this->lastPointCalcCorrection);
|
||||
correction.distance = this->lastPointCalcCorrection.distanceTo(this->targetPoint);
|
||||
return Status::Unchanged;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ void MenuAutopilot::printPage() const {
|
||||
lineTwo = "";
|
||||
switch (this->autopilot->getState()) {
|
||||
case Autopilot::State::InsufficientAccuarcy :
|
||||
lineTwo = "Err: No NTRIP";
|
||||
lineTwo = "Err: LowAccuracy";
|
||||
break;
|
||||
|
||||
case Autopilot::State::NoRoute :
|
||||
|
||||
@@ -119,10 +119,10 @@ void Autopilot::drive() {
|
||||
void Autopilot::rotate() {
|
||||
this->moveControl->setSpeed(0);
|
||||
if (this->courseCorrection.correction > 0)
|
||||
this->moveControl->setRotationSpeed(this->rotationSpeed);
|
||||
this->moveControl->setRotationSpeed(-this->rotationSpeed);
|
||||
else
|
||||
|
||||
this->moveControl->setRotationSpeed(-this->rotationSpeed);
|
||||
this->moveControl->setRotationSpeed(this->rotationSpeed);
|
||||
}
|
||||
|
||||
void Autopilot::checkButtonInput() {
|
||||
@@ -172,10 +172,8 @@ void Autopilot::askNavigationForOrder() {
|
||||
}
|
||||
|
||||
void Autopilot::selfDriving() {
|
||||
if (this->lastOrderStatus == Navigation::Status::Updated) {
|
||||
if (abs(this->courseCorrection.correction) >= this->maxCourseDeviationBerforeAct)
|
||||
this->rotate();
|
||||
else
|
||||
this->drive();
|
||||
}
|
||||
if (abs(this->courseCorrection.correction) >= this->maxCourseDeviationBerforeAct)
|
||||
this->rotate();
|
||||
else
|
||||
this->drive();
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ class Autopilot : public ManualControl {
|
||||
uint32_t lastAutopilotChangeMillis = 0;
|
||||
|
||||
double drivingSpeed = 1;
|
||||
double rotationSpeed = 3;
|
||||
double rotationSpeed = 4.5;
|
||||
double minRemainingDistance = 0.25;
|
||||
};
|
||||
|
||||
|
||||
+2
-2
@@ -187,9 +187,9 @@ void MoveControl::calcTargetWheelSpeed() {
|
||||
\ 1 -b / \ T / \ Xr / */
|
||||
|
||||
// (1 / r) * 1
|
||||
const static double A = 15.82278481;
|
||||
constexpr double A = 15.82278481;
|
||||
// (1 / r) * b
|
||||
const static double B = 2.096518987;
|
||||
constexpr double B = 2.096518987;
|
||||
|
||||
this->wheelspeed_right_target = (A * this->x_speed + B * this->rotation_speed) * (WHEEL_DIAMETER / 2);
|
||||
this->wheelspeed_left_target = (A * this->x_speed + (-B) * this->rotation_speed) * (WHEEL_DIAMETER / 2);
|
||||
|
||||
Reference in New Issue
Block a user