try to work ntrip client

This commit is contained in:
2022-10-24 22:08:19 +02:00
parent ee5bc9129a
commit e01127e3e3
12 changed files with 108 additions and 44 deletions
+2 -2
View File
@@ -83,7 +83,7 @@ void MenuGPS::printPage(uint8_t page) const {
}
if (fixType)
std::cout << "Sats: " << (int) siv
<< "HDOP: " << (int) hdop << std::endl;
<< " HDOP: " << (int) hdop << std::endl;
else
std::cout << "Data isn't valid or no GPS signal" << std::endl;
}
@@ -107,7 +107,7 @@ void MenuGPS::printPage(uint8_t page) const {
}
if (fixType)
std::cout << "Lat: " << lat
<< "Lng: " << lng << std::endl;
<< " Lng: " << lng << std::endl;
else
std::cout << "Data isn't valid or NO GPS signal" << std::endl;
}
+6
View File
@@ -29,8 +29,14 @@ DriveManager::~DriveManager() {
}
void DriveManager::loop() {
DebugTimes moveControlTime;
this->moveControl->loop();
moveControlTime.stopConsol("MoveControlTime", 5);
DebugTimes navigationTime;
this->navigation->loop();
navigationTime.stopConsol("NavigationTime", 5);
if (currentModusPtr)
this->currentModusPtr->loop();
}
+1
View File
@@ -23,6 +23,7 @@
#include "driveModi/driveModi.h"
#include "navigation.h"
#include "networkConfig.h"
#include "debugTimes.h"
// All Drive Modi
#include "driveModi/Modi/ManualControl/manualControl.h"
+8 -2
View File
@@ -29,6 +29,7 @@
#include "network.h"
#include "debugMqtt.h"
#include "battery.h"
#include "debugTimes.h"
#include "menu.h"
#include "menuAction.h"
@@ -125,12 +126,17 @@ void setup() {
void loop() {
if (wifiIsActive) {
DebugTimes wifiTime;
Network::checkWiFi();
Network::checkMQTT();
wifiTime.stopConsol("WiFi-Time", 5);
}
driveManager->loop();
DebugTimes mainBatteryTime;
mainBattery->loop();
mainBatteryTime.stopConsol("MainBatteryTime", 5);
// static uint32_t lastMillis = 0;
// if (millis() - lastMillis > 2000) {
@@ -204,7 +210,7 @@ void i2cScanner() {
std::cout << "I2C device found at address 0x";
if (address<16)
std::cout << "0";
std::cout << std::hex << (int) address << std::endl;
std::cout << std::hex << (int) address << std::dec << std::endl;
// std::cout << (int) address << std::endl;
nDevices++;
}
@@ -212,7 +218,7 @@ void i2cScanner() {
std::cout << "Unknow error at address 0x";
if (address<16)
std::cout << "0";
std::cout << std::hex << (int) address << std::endl;
std::cout << std::hex << (int) address << std::dec << std::endl;
}
}
if (nDevices == 0)
+11 -6
View File
@@ -57,17 +57,22 @@ void MoveControl::loop() {
|| right_motor_time > 50
|| left_speed_time > 50
|| right_speed_time > 50) {
char buf[128];
sprintf(buf, "left M: %d, right M %d, left S %d, right S %d in moveControl::loop\n", left_motor_time, right_motor_time, left_speed_time, right_speed_time);
std::cout << buf;
this->overTimeCounter++;
if (this->overTimeCounter >= this->overTimeMax) {
char buf[128];
sprintf(buf, "left M: %d, right M %d, left S %d, right S %d in moveControl::loop\n",
left_motor_time, right_motor_time, left_speed_time, right_speed_time);
std::cout << buf;
this->overTimeCounter = 0;
}
}
static uint64_t lastMillis = 0;
if (millis() - lastMillis < delay)
if (millis() - this->lastMillis < this->delay)
return;
this->runMoveControl();
lastMillis = millis();
this->lastMillis = millis();
}
void MoveControl::runMoveControl() {