diff --git a/doc/Notes and TODOs/TODO allgemein.txt b/doc/Notes and TODOs/TODO allgemein.txt index 5c8fa8a..03df2c4 100644 --- a/doc/Notes and TODOs/TODO allgemein.txt +++ b/doc/Notes and TODOs/TODO allgemein.txt @@ -1,5 +1,3 @@ - -> Document the battery pack lib -> Program underfloorLighting - -> Program battery pack tracking -> Add an beeper -> Program the beeper diff --git a/include/moveControl.h b/include/moveControl.h index cd89eca..c342ce9 100644 --- a/include/moveControl.h +++ b/include/moveControl.h @@ -170,7 +170,7 @@ class MoveControl { uint8_t delay = 20; uint8_t overTimeCounter = 0; - uint8_t overTimeMax = 10; + uint8_t overTimeMax = 100; int8_t rawPowerLeft = 0; int8_t rawPowerRight = 0; uint32_t lastMillis = 0; diff --git a/include/moveControlConfig.h b/include/moveControlConfig.h index 4b7f01a..f4ace03 100644 --- a/include/moveControlConfig.h +++ b/include/moveControlConfig.h @@ -13,14 +13,14 @@ #define M_DIR_11 12 #define M_DIR_12 27 #define M_PWM_1 13 - #define M_ENCODE_1A 33 - #define M_ENCODE_1B 32 + #define M_ENCODE_1A 32 + #define M_ENCODE_1B 33 //Right Motor #define M_DIR_21 23 #define M_DIR_22 14 #define M_PWM_2 22 - #define M_ENCODE_2A 26 - #define M_ENCODE_2B 25 + #define M_ENCODE_2A 25 + #define M_ENCODE_2B 26 // PID config #define PID_OUT_MIN -100 diff --git a/lib/Battery/battery.cpp b/lib/Battery/battery.cpp index 1ab0021..3ea195e 100644 --- a/lib/Battery/battery.cpp +++ b/lib/Battery/battery.cpp @@ -55,6 +55,7 @@ void Battery::calculateBatteryPercent() { if (this->batteryVoltage <= this->capacityVoltages[i]) break; } + if (i == 0) { if (this->batteryVoltage > 6) std::cout << "Critical low battery!" << std::endl; diff --git a/lib/Navigation/navigation.cpp b/lib/Navigation/navigation.cpp index de94a88..f83fe87 100644 --- a/lib/Navigation/navigation.cpp +++ b/lib/Navigation/navigation.cpp @@ -65,7 +65,7 @@ void Navigation::init(Route* route) { Wire.write(0x0b); Wire.write(0x01); Wire.endTransmission(); - this->compass->setMode(0x01,0x04,0x10,0X00); + this->compass->setMode(0x01,0x0C,0x10,0X00); } Navigation::~Navigation() { diff --git a/lib/Navigation/navigation.h b/lib/Navigation/navigation.h index 130f840..b75cd2f 100644 --- a/lib/Navigation/navigation.h +++ b/lib/Navigation/navigation.h @@ -29,7 +29,7 @@ * */ #define MIN_DISTANCE_BETWEEN_POINTS 0.1 -#define AZIMUTH_UPDATE_DELAY 200 +#define AZIMUTH_UPDATE_DELAY 20 /** * @brief This struct inherits the result of the navigation diff --git a/lib/Speedometer/speedometer.h b/lib/Speedometer/speedometer.h index 194c16c..0cbbd01 100644 --- a/lib/Speedometer/speedometer.h +++ b/lib/Speedometer/speedometer.h @@ -12,6 +12,7 @@ #ifndef SPEEDOMETER_H #define SPEEDOMETER_H +#include #include #include diff --git a/platformio.ini b/platformio.ini index fae01a6..5a42444 100644 --- a/platformio.ini +++ b/platformio.ini @@ -18,7 +18,7 @@ upload_speed = 921600 monitor_port = COM3 monitor_filters = esp32_exception_decoder lib_deps = - madhephaestus/ESP32Encoder@^0.4.0 + madhephaestus/ESP32Encoder@^0.10.1 jvpernis/PS3 Controller Host@^1.1.0 sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.7 knolleary/PubSubClient@^2.8 diff --git a/src/moveControl.cpp b/src/moveControl.cpp index 43d1507..ab64b20 100644 --- a/src/moveControl.cpp +++ b/src/moveControl.cpp @@ -107,7 +107,7 @@ void MoveControl::setDrivingStatus(DrivingStatus status) { } void MoveControl::setSpeed(double speed) { - if (speed < 0.2 && speed > -0.2) + if (speed < 0.1 && speed > -0.1) this->x_speed = 0; else this->x_speed = speed;