refactor - change constants

This commit is contained in:
2023-01-18 10:33:47 +01:00
parent 801a474b49
commit 97495338d7
9 changed files with 11 additions and 11 deletions
-2
View File
@@ -1,5 +1,3 @@
-> Document the battery pack lib
-> Program underfloorLighting -> Program underfloorLighting
-> Program battery pack tracking
-> Add an beeper -> Add an beeper
-> Program the beeper -> Program the beeper
+1 -1
View File
@@ -170,7 +170,7 @@ class MoveControl {
uint8_t delay = 20; uint8_t delay = 20;
uint8_t overTimeCounter = 0; uint8_t overTimeCounter = 0;
uint8_t overTimeMax = 10; uint8_t overTimeMax = 100;
int8_t rawPowerLeft = 0; int8_t rawPowerLeft = 0;
int8_t rawPowerRight = 0; int8_t rawPowerRight = 0;
uint32_t lastMillis = 0; uint32_t lastMillis = 0;
+4 -4
View File
@@ -13,14 +13,14 @@
#define M_DIR_11 12 #define M_DIR_11 12
#define M_DIR_12 27 #define M_DIR_12 27
#define M_PWM_1 13 #define M_PWM_1 13
#define M_ENCODE_1A 33 #define M_ENCODE_1A 32
#define M_ENCODE_1B 32 #define M_ENCODE_1B 33
//Right Motor //Right Motor
#define M_DIR_21 23 #define M_DIR_21 23
#define M_DIR_22 14 #define M_DIR_22 14
#define M_PWM_2 22 #define M_PWM_2 22
#define M_ENCODE_2A 26 #define M_ENCODE_2A 25
#define M_ENCODE_2B 25 #define M_ENCODE_2B 26
// PID config // PID config
#define PID_OUT_MIN -100 #define PID_OUT_MIN -100
+1
View File
@@ -55,6 +55,7 @@ void Battery::calculateBatteryPercent() {
if (this->batteryVoltage <= this->capacityVoltages[i]) if (this->batteryVoltage <= this->capacityVoltages[i])
break; break;
} }
if (i == 0) { if (i == 0) {
if (this->batteryVoltage > 6) if (this->batteryVoltage > 6)
std::cout << "Critical low battery!" << std::endl; std::cout << "Critical low battery!" << std::endl;
+1 -1
View File
@@ -65,7 +65,7 @@ void Navigation::init(Route* route) {
Wire.write(0x0b); Wire.write(0x0b);
Wire.write(0x01); Wire.write(0x01);
Wire.endTransmission(); Wire.endTransmission();
this->compass->setMode(0x01,0x04,0x10,0X00); this->compass->setMode(0x01,0x0C,0x10,0X00);
} }
Navigation::~Navigation() { Navigation::~Navigation() {
+1 -1
View File
@@ -29,7 +29,7 @@
* *
*/ */
#define MIN_DISTANCE_BETWEEN_POINTS 0.1 #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 * @brief This struct inherits the result of the navigation
+1
View File
@@ -12,6 +12,7 @@
#ifndef SPEEDOMETER_H #ifndef SPEEDOMETER_H
#define SPEEDOMETER_H #define SPEEDOMETER_H
#include <Arduino.h>
#include <cstdint> #include <cstdint>
#include <ESP32Encoder.h> #include <ESP32Encoder.h>
+1 -1
View File
@@ -18,7 +18,7 @@ upload_speed = 921600
monitor_port = COM3 monitor_port = COM3
monitor_filters = esp32_exception_decoder monitor_filters = esp32_exception_decoder
lib_deps = lib_deps =
madhephaestus/ESP32Encoder@^0.4.0 madhephaestus/ESP32Encoder@^0.10.1
jvpernis/PS3 Controller Host@^1.1.0 jvpernis/PS3 Controller Host@^1.1.0
sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.7 sparkfun/SparkFun u-blox GNSS Arduino Library@^2.2.7
knolleary/PubSubClient@^2.8 knolleary/PubSubClient@^2.8
+1 -1
View File
@@ -107,7 +107,7 @@ void MoveControl::setDrivingStatus(DrivingStatus status) {
} }
void MoveControl::setSpeed(double speed) { void MoveControl::setSpeed(double speed) {
if (speed < 0.2 && speed > -0.2) if (speed < 0.1 && speed > -0.1)
this->x_speed = 0; this->x_speed = 0;
else else
this->x_speed = speed; this->x_speed = speed;