small fixes

This commit is contained in:
2023-08-07 13:05:42 +02:00
parent 3549af2470
commit 8ed91c4b11
7 changed files with 16 additions and 13 deletions
+4
View File
@@ -1,3 +1,7 @@
-> Program underfloorLighting -> Program underfloorLighting
-> Add an beeper -> Add an beeper
-> Program the beeper -> Program the beeper
Speedometer buffer ergibt kaum Sinn
Abweichung max 25 cm bevor zu ungenau damit nie mehr als 50 cm gesamt.
+1 -1
View File
@@ -21,7 +21,7 @@
#define PWMRES 8 #define PWMRES 8
#define POWERSTEPS 2 // A total of 20 levels ( 100 / SPEED_STEPS ) * RUN_MOTOR_CONTROL_DELAY = 500ms #define POWERSTEPS 2 // A total of 20 levels ( 100 / SPEED_STEPS ) * RUN_MOTOR_CONTROL_DELAY = 500ms
#define PWMMIN 55 #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 * @brief A class which use PWM to control the power of DC Motor
+1
View File
@@ -134,6 +134,7 @@ Navigation::Status Navigation::getCourseCorrection(CourseCorrection& correction,
if (this->currentPosition.distanceTo(this->lastPointCalcCorrection) < (this->minDistanceToReachPoint / 2.0) if (this->currentPosition.distanceTo(this->lastPointCalcCorrection) < (this->minDistanceToReachPoint / 2.0)
&& !forceUpdate) { && !forceUpdate) {
correction.correction = this->calculateCourseCorrection(this->lastPointCalcCorrection); correction.correction = this->calculateCourseCorrection(this->lastPointCalcCorrection);
correction.distance = this->lastPointCalcCorrection.distanceTo(this->targetPoint);
return Status::Unchanged; return Status::Unchanged;
} }
@@ -43,7 +43,7 @@ void MenuAutopilot::printPage() const {
lineTwo = ""; lineTwo = "";
switch (this->autopilot->getState()) { switch (this->autopilot->getState()) {
case Autopilot::State::InsufficientAccuarcy : case Autopilot::State::InsufficientAccuarcy :
lineTwo = "Err: No NTRIP"; lineTwo = "Err: LowAccuracy";
break; break;
case Autopilot::State::NoRoute : case Autopilot::State::NoRoute :
+6 -8
View File
@@ -119,10 +119,10 @@ void Autopilot::drive() {
void Autopilot::rotate() { void Autopilot::rotate() {
this->moveControl->setSpeed(0); this->moveControl->setSpeed(0);
if (this->courseCorrection.correction > 0) if (this->courseCorrection.correction > 0)
this->moveControl->setRotationSpeed(this->rotationSpeed); this->moveControl->setRotationSpeed(-this->rotationSpeed);
else else
this->moveControl->setRotationSpeed(-this->rotationSpeed); this->moveControl->setRotationSpeed(this->rotationSpeed);
} }
void Autopilot::checkButtonInput() { void Autopilot::checkButtonInput() {
@@ -172,10 +172,8 @@ void Autopilot::askNavigationForOrder() {
} }
void Autopilot::selfDriving() { void Autopilot::selfDriving() {
if (this->lastOrderStatus == Navigation::Status::Updated) { if (abs(this->courseCorrection.correction) >= this->maxCourseDeviationBerforeAct)
if (abs(this->courseCorrection.correction) >= this->maxCourseDeviationBerforeAct) this->rotate();
this->rotate(); else
else this->drive();
this->drive();
}
} }
+1 -1
View File
@@ -132,7 +132,7 @@ class Autopilot : public ManualControl {
uint32_t lastAutopilotChangeMillis = 0; uint32_t lastAutopilotChangeMillis = 0;
double drivingSpeed = 1; double drivingSpeed = 1;
double rotationSpeed = 3; double rotationSpeed = 4.5;
double minRemainingDistance = 0.25; double minRemainingDistance = 0.25;
}; };
+2 -2
View File
@@ -187,9 +187,9 @@ void MoveControl::calcTargetWheelSpeed() {
\ 1 -b / \ T / \ Xr / */ \ 1 -b / \ T / \ Xr / */
// (1 / r) * 1 // (1 / r) * 1
const static double A = 15.82278481; constexpr double A = 15.82278481;
// (1 / r) * b // (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_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); this->wheelspeed_left_target = (A * this->x_speed + (-B) * this->rotation_speed) * (WHEEL_DIAMETER / 2);