Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
479a3d171e | ||
|
|
a5bfbc3df9 | ||
|
|
4251eda946 | ||
|
|
27a0a2ca7b | ||
|
|
73fde34e48 | ||
|
|
87743c8e67 | ||
|
|
c866bc0d60 | ||
|
|
dbb646b5a5 | ||
|
|
dd304cf787 | ||
|
|
717daef21e | ||
|
|
16e04afebd | ||
|
|
f227a2f569 | ||
|
|
9b6889b68c | ||
|
|
155975df33 |
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"files.insertFinalNewline": true,
|
"files.insertFinalNewline": true,
|
||||||
|
"editor.wordWrap": "on",
|
||||||
"cSpell.ignoreWords": [
|
"cSpell.ignoreWords": [
|
||||||
"ledc",
|
"ledc",
|
||||||
"write"
|
"write"
|
||||||
@@ -132,6 +133,7 @@
|
|||||||
"Doxygen",
|
"Doxygen",
|
||||||
"Dutycycle",
|
"Dutycycle",
|
||||||
"gast",
|
"gast",
|
||||||
|
"gnss",
|
||||||
"GNSS",
|
"GNSS",
|
||||||
"GPGGA",
|
"GPGGA",
|
||||||
"HSPI",
|
"HSPI",
|
||||||
@@ -140,9 +142,12 @@
|
|||||||
"kleiax",
|
"kleiax",
|
||||||
"Lebennig",
|
"Lebennig",
|
||||||
"microcontroller",
|
"microcontroller",
|
||||||
|
"Mqtt",
|
||||||
"MQTT",
|
"MQTT",
|
||||||
"NMEA",
|
"NMEA",
|
||||||
"NMEAGPGGA",
|
"NMEAGPGGA",
|
||||||
|
"ntrip",
|
||||||
|
"Ntrip",
|
||||||
"NTRIP",
|
"NTRIP",
|
||||||
"pcnt",
|
"pcnt",
|
||||||
"pidl",
|
"pidl",
|
||||||
@@ -150,6 +155,8 @@
|
|||||||
"Punica",
|
"Punica",
|
||||||
"RHEDE",
|
"RHEDE",
|
||||||
"Rtcm",
|
"Rtcm",
|
||||||
|
"sapos",
|
||||||
|
"SAPOS",
|
||||||
"Schalke",
|
"Schalke",
|
||||||
"Soln",
|
"Soln",
|
||||||
"Systeminformation",
|
"Systeminformation",
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Autonomer Rover
|
||||||
|
Testfahrt auf Youtube: https://youtu.be/GigIyo-vghE?si=jhProl1DQFUrcz7w
|
||||||
|
|
||||||
|
# Beschreibung
|
||||||
|
Vollständige Softwarelösung und Hardwareerweiterungen für einen Rover mit Skid-Antrieb. Das System wurde in C++ geschrieben und es wurden erweiterte Konzepte der Objektorientierung wie Polymorphie eingesetzt. Die Datenhaltung wurde erfolgreich von der Logik getrennt, hierfür wurde unter anderem eine API mit Express.js implementiert. Hardwareseitig wurde PWM für die Motorsteuerung, IC2 für verschiedene Sensoren und SPI für das GNSS-Modul eingesetzt. Zusätzlich wurden Encoder an den Motoren verbaut, um diese präzise zu steuern. Überdies wurde eine RTK-Referenzstation geplant und umgesetzt, dafür wurde die Antenne, ein weiteres GNSS-Modul und ein Embedded-Server installiert und konfiguriert. Durch das Zusammenspiel dieser Systeme kann der Rover Routen im niedrigen einstelligen Zentimeterbereich aufzeichnen und abfahren.
|
||||||
@@ -44,7 +44,7 @@ PROJECT_NUMBER =
|
|||||||
# for a project that appears at the top of each page and should give viewer a
|
# for a project that appears at the top of each page and should give viewer a
|
||||||
# quick idea about the purpose of the project. Keep the description short.
|
# quick idea about the purpose of the project. Keep the description short.
|
||||||
|
|
||||||
PROJECT_BRIEF = "A small verhicle which should be drive a route with GPS"
|
PROJECT_BRIEF = "A small verhicle which should be drive a route with GNNS and RTK"
|
||||||
|
|
||||||
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
|
# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
|
||||||
# in the documentation. The maximum height of the logo should not exceed 55
|
# in the documentation. The maximum height of the logo should not exceed 55
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
Maybe:
|
Maybe:
|
||||||
-> Time Measurement in component interface
|
-> Time Measurement in component interface
|
||||||
-> Time warnings
|
-> Time warnings
|
||||||
|
-> Blocking Battery Function in Battery class
|
||||||
|
- Callback function for output and shutdown things
|
||||||
|
|
||||||
Do later:
|
Do later:
|
||||||
-> Program underfloorLighting
|
-> Program underfloorLighting
|
||||||
@@ -32,16 +34,12 @@ Do later:
|
|||||||
- navigation
|
- navigation
|
||||||
- autopilot
|
- autopilot
|
||||||
|
|
||||||
|
Have to:
|
||||||
|
-> check new distance calculation between points
|
||||||
|
-> check new course calculation between points
|
||||||
|
-> menu route data und ui disconnecten
|
||||||
|
-> use routeCache in captureRoute and autopilot
|
||||||
|
-> make ntrip client useable without user and password
|
||||||
|
-> understand gyroscope offsets
|
||||||
|
|
||||||
Do now:
|
|
||||||
Code:
|
|
||||||
Fernbedienung!
|
|
||||||
|
|
||||||
Latex:
|
|
||||||
Anhang: Liste mit allen Komponenten und Kurzbeschreibung
|
|
||||||
Unterschied funktionale und nicht funktionale Anforderungen
|
|
||||||
Overfull H-Boxen
|
|
||||||
Test Motor, Zeiten kontrolieren. Wenn einfach so dann bezug auf fehler bei Timing und freeRtos
|
|
||||||
Was mit den nicht erfüllten Anforderungen machen?
|
|
||||||
Hardware doppelt erklärt
|
|
||||||
|
|
||||||
|
|||||||
|
After Width: | Height: | Size: 8.8 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 4.1 MiB |
|
After Width: | Height: | Size: 7.0 MiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 419 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 7.6 MiB |
|
After Width: | Height: | Size: 648 KiB |
|
After Width: | Height: | Size: 445 KiB |
|
After Width: | Height: | Size: 17 KiB |
|
After Width: | Height: | Size: 2.4 MiB |
|
After Width: | Height: | Size: 772 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 84 KiB |
@@ -14,16 +14,18 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define HW1
|
#define ZUHAUSE
|
||||||
|
#define SAPOS_NI
|
||||||
|
// #define RTK2GO
|
||||||
|
|
||||||
#ifdef HOTSPOT
|
#ifdef HOTSPOT
|
||||||
namespace NetworkConfig
|
namespace NetworkConfig
|
||||||
{
|
{
|
||||||
const char ssid[] = "Kleiax Handy";
|
const char ssid[] = "Nubsi";
|
||||||
const char password[] = "12345677";
|
const char password[] = "12345677";
|
||||||
const char ip[] = "192.168.43.4";
|
const char ip[] = "192.168.72.7";
|
||||||
const char subnet[] = "255.255.255.0";
|
const char subnet[] = "255.255.255.0";
|
||||||
const char gateway[] = "192.168.43.1";
|
const char gateway[] = "192.168.72.228";
|
||||||
const char dns[] = "8.8.8.8";
|
const char dns[] = "8.8.8.8";
|
||||||
const bool mqtt = false;
|
const bool mqtt = false;
|
||||||
}
|
}
|
||||||
@@ -56,6 +58,19 @@ namespace NetworkConfig
|
|||||||
}
|
}
|
||||||
#endif // RHEDE
|
#endif // RHEDE
|
||||||
|
|
||||||
|
#ifdef ZUHAUSE
|
||||||
|
namespace NetworkConfig
|
||||||
|
{
|
||||||
|
const char ssid[] = "Tuedelkram";
|
||||||
|
const char password[] = "3!Kaesehoch";
|
||||||
|
const char ip[] = "192.168.178.13";
|
||||||
|
const char subnet[] = "255.255.255.0";
|
||||||
|
const char gateway[] = "192.168.178.1";
|
||||||
|
const char dns[] = "8.8.8.8";
|
||||||
|
const bool mqtt = false;
|
||||||
|
}
|
||||||
|
#endif // ZUHAUSE
|
||||||
|
|
||||||
namespace MqttConfig
|
namespace MqttConfig
|
||||||
{
|
{
|
||||||
const char server[] = "192.168.1.7";
|
const char server[] = "192.168.1.7";
|
||||||
@@ -64,13 +79,28 @@ namespace MqttConfig
|
|||||||
const char password[] = "p?{$_~5%hBM7wrcFkr55KWr#";
|
const char password[] = "p?{$_~5%hBM7wrcFkr55KWr#";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef RTK2GO
|
||||||
namespace NtripConfig
|
namespace NtripConfig
|
||||||
{
|
{
|
||||||
const char host[] = "rtk2go.com";
|
const char host[] = "rtk2go.com";
|
||||||
const uint16_t port = 2101;
|
const uint16_t port = 2101;
|
||||||
// const char mountPoint[] = "GER-Dortmund";
|
const char mountPoint[] = "GER-Dortmund";
|
||||||
// const char mountPoint[] = "GER-Papenburg";
|
// const char mountPoint[] = "GER-Papenburg";
|
||||||
const char mountPoint[] = "Rtkramerntrip";
|
// const char mountPoint[] = "Rtkramerntrip";
|
||||||
const char user[] = "alklein1@gmx.de";
|
const char user[] = "alklein1@gmx.de";
|
||||||
const char password[] = "none";
|
const char password[] = "none";
|
||||||
|
const bool sendOwnPosition = false;
|
||||||
}
|
}
|
||||||
|
#endif // RTK2GO
|
||||||
|
|
||||||
|
#ifdef SAPOS_NI
|
||||||
|
namespace NtripConfig
|
||||||
|
{
|
||||||
|
const char host[] = "sapos-ni-ntrip.de";
|
||||||
|
const uint16_t port = 2101;
|
||||||
|
const char mountPoint[] = "VRS_3_4G_NI";
|
||||||
|
const char user[] = "ni_FHDo01";
|
||||||
|
const char password[] = "ALdx-1-3e49";
|
||||||
|
const bool sendOwnPosition = true;
|
||||||
|
}
|
||||||
|
#endif // RTK2GO
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ void Component::loop()
|
|||||||
(*it)->loop();
|
(*it)->loop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this->runAsChild();F
|
this->runAsChild();
|
||||||
|
|
||||||
if (this->onlyChilds)
|
if (this->onlyChilds)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
* If the component is deactivated the call of loop() ha no effect
|
* If the component is deactivated the call of loop() ha no effect
|
||||||
*/
|
*/
|
||||||
void deactivate() { this->active = false; }
|
void deactivate() { this->active = false; }
|
||||||
void activate() { this->active = false; }
|
void activate() { this->active = true; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
LcdWrapper::LcdWrapper(LiquidCrystal_I2C *lcd)
|
LcdWrapper::LcdWrapper(LiquidCrystal_I2C *lcd)
|
||||||
: lcd{lcd}, changed{false}
|
: lcd{lcd}, changed{false}
|
||||||
{
|
{
|
||||||
this->clear();
|
// this->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LcdWrapper::run()
|
void LcdWrapper::run()
|
||||||
|
|||||||
@@ -194,6 +194,7 @@ void MotorControl::setRealPower(int8_t power)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ledcWrite(this->pwmChannel, pwm_val);
|
ledcWrite(this->pwmChannel, pwm_val);
|
||||||
|
std::cout << "MotorControl::serRealPower - pwm: " << static_cast<int>(pwm_val) << std::endl;
|
||||||
this->dutycycle = pwm_val;
|
this->dutycycle = pwm_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ struct CourseCorrection
|
|||||||
/**
|
/**
|
||||||
* @brief This class navigate an object
|
* @brief This class navigate an object
|
||||||
*
|
*
|
||||||
* The class use the given Route and the gps device
|
* The class use the given Route and the gnss device
|
||||||
* to tell the driver in which direction he have to
|
* to tell the driver in which direction he have to
|
||||||
* be drive and the distance to the next checkpoint.
|
* be drive and the distance to the next checkpoint.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -11,9 +11,13 @@
|
|||||||
|
|
||||||
#include "ntripClient.h"
|
#include "ntripClient.h"
|
||||||
|
|
||||||
NTRIPClient::NTRIPClient(SFE_UBLOX_GNSS *gps, const char *host, uint16_t port, const char *mountPoint, const char *user, const char *password)
|
NTRIPClient::NTRIPClient(SFE_UBLOX_GNSS *gnss, const char *host, uint16_t port, const char *mountPoint, const char *user, const char *password)
|
||||||
: gps{gps}, port{port}, host{host}, mountPoint{mountPoint}, user{user}, password{password}, ntripClient{new WiFiClient}, state{NTRIPClientStates::closeConnection}
|
: gnss{gnss}, port{port}, ntripClient{new WiFiClient}, state{NTRIPClientStates::closingConnection}
|
||||||
{
|
{
|
||||||
|
strcpy(this->host, host);
|
||||||
|
strcpy(this->mountPoint, mountPoint);
|
||||||
|
strcpy(this->user, user);
|
||||||
|
strcpy(this->password, password);
|
||||||
Component::loopDelay = NTRIPClient::loopDelay;
|
Component::loopDelay = NTRIPClient::loopDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,10 +30,10 @@ void NTRIPClient::run()
|
|||||||
{
|
{
|
||||||
switch (this->state)
|
switch (this->state)
|
||||||
{
|
{
|
||||||
case NTRIPClientStates::openConnection:
|
case NTRIPClientStates::openingConnection:
|
||||||
if (!this->activated)
|
if (!this->activated)
|
||||||
{
|
{
|
||||||
this->state = NTRIPClientStates::closeConnection;
|
this->state = NTRIPClientStates::closingConnection;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,33 +41,34 @@ void NTRIPClient::run()
|
|||||||
if (this->beginClient())
|
if (this->beginClient())
|
||||||
{
|
{
|
||||||
std::cout << "Connected to the NTRIP caster!" << std::endl;
|
std::cout << "Connected to the NTRIP caster!" << std::endl;
|
||||||
this->state = NTRIPClientStates::pushData;
|
this->state = NTRIPClientStates::pushingData;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cout << "Failed!" << std::endl;
|
std::cout << "Failed!" << std::endl;
|
||||||
this->state = NTRIPClientStates::wait;
|
this->state = NTRIPClientStates::waiting;
|
||||||
|
this->lastReconnectTime = millis();
|
||||||
this->activated = false;
|
this->activated = false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NTRIPClientStates::pushData:
|
case NTRIPClientStates::pushingData:
|
||||||
if (!processConnection() || !this->activated)
|
if (!processConnection() || !this->activated)
|
||||||
{
|
{
|
||||||
this->state = NTRIPClientStates::closeConnection;
|
this->state = NTRIPClientStates::closingConnection;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NTRIPClientStates::closeConnection:
|
case NTRIPClientStates::closingConnection:
|
||||||
std::cout << "Closing the connection to the NTRIP caster..." << std::endl;
|
std::cout << "Closing the connection to the NTRIP caster..." << std::endl;
|
||||||
this->closeConnection();
|
this->closeConnection();
|
||||||
state = NTRIPClientStates::wait;
|
state = NTRIPClientStates::waiting;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NTRIPClientStates::wait:
|
case NTRIPClientStates::waiting:
|
||||||
if (this->activated)
|
if (this->activated)
|
||||||
{
|
{
|
||||||
this->state = NTRIPClientStates::openConnection;
|
this->state = NTRIPClientStates::openingConnection;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -76,7 +81,7 @@ void NTRIPClient::run()
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
std::cout << "Wrong state in NTRIPClient.cpp..." << std::endl;
|
std::cout << "Wrong state in NTRIPClient.cpp..." << std::endl;
|
||||||
this->state = NTRIPClientStates::closeConnection;
|
this->state = NTRIPClientStates::closingConnection;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -86,14 +91,14 @@ void NTRIPClient::runAsChild()
|
|||||||
this->pushGPGGA();
|
this->pushGPGGA();
|
||||||
}
|
}
|
||||||
|
|
||||||
void NTRIPClient::gpsConfiguration()
|
void NTRIPClient::gnssConfiguration()
|
||||||
{
|
{
|
||||||
this->gps->setSPIOutput(COM_TYPE_UBX | COM_TYPE_NMEA);
|
this->gnss->setSPIOutput(COM_TYPE_UBX | COM_TYPE_NMEA);
|
||||||
this->gps->setPortInput(COM_PORT_SPI, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3);
|
this->gnss->setPortInput(COM_PORT_SPI, COM_TYPE_UBX | COM_TYPE_NMEA | COM_TYPE_RTCM3);
|
||||||
// Set the differential mode - ambiguities are fixed whenever possible
|
// Set the differential mode - ambiguities are fixed whenever possible
|
||||||
this->gps->setDGNSSConfiguration(SFE_UBLOX_DGNSS_MODE_FIXED);
|
this->gnss->setDGNSSConfiguration(SFE_UBLOX_DGNSS_MODE_FIXED);
|
||||||
this->gps->setMainTalkerID(SFE_UBLOX_MAIN_TALKER_ID_GP);
|
this->gnss->setMainTalkerID(SFE_UBLOX_MAIN_TALKER_ID_GP);
|
||||||
this->gps->enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_SPI, 10);
|
this->gnss->enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_SPI);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NTRIPClient::setActivated(bool state)
|
bool NTRIPClient::setActivated(bool state)
|
||||||
@@ -145,29 +150,71 @@ bool NTRIPClient::beginClient()
|
|||||||
std::cout << "Requesting NTRIP Data from mount point " << this->mountPoint << std::endl;
|
std::cout << "Requesting NTRIP Data from mount point " << this->mountPoint << std::endl;
|
||||||
|
|
||||||
// Generate the server request (GET)
|
// Generate the server request (GET)
|
||||||
snprintf(static_cast<char *>(serverRequest),
|
if (this->useNtripRev1)
|
||||||
this->bufferSize,
|
{
|
||||||
static_cast<const char *>("GET /%s HTTP/1.0\r\nUser-Agent: NTRIP SparkFun u-blox Client v1.0\r\n"),
|
snprintf(static_cast<char *>(serverRequest),
|
||||||
this->mountPoint);
|
this->bufferSize,
|
||||||
|
static_cast<const char *>("GET /%s HTTP/1.0\r\nHost: %s:%u\r\nUser-Agent: NTRIP KleiaxNtripClient/0.1\r\nAccept: */*\r\nConnection: close\r\n"),
|
||||||
|
this->mountPoint,
|
||||||
|
this->host,
|
||||||
|
this->port);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
snprintf(static_cast<char *>(serverRequest),
|
||||||
|
this->bufferSize,
|
||||||
|
static_cast<const char *>("GET /%s HTTP/1.1\r\nHost: %s:%u\r\nNtrip-Version: Ntrip/2.0\r\nUser-Agent: NTRIP KleiaxNtripClient/0.1\r\nAccept: */*\r\nConnection: close\r\n"),
|
||||||
|
this->mountPoint,
|
||||||
|
this->host,
|
||||||
|
this->port);
|
||||||
|
}
|
||||||
|
|
||||||
// Credentials
|
// Add own Position if activated
|
||||||
const uint8_t userCredentialsLength = strlen(this->user) + strlen(this->password) + 2;
|
if (this->transmitLocation && !this->useNtripRev1)
|
||||||
auto *userCredentials = new char[userCredentialsLength];
|
{
|
||||||
snprintf(static_cast<char *>(userCredentials), userCredentialsLength, static_cast<const char *>("%s:%s"), this->user, this->password);
|
std::cout << "NTRIPClient::beginClient - Add own position to server request." << std::endl;
|
||||||
|
auto *data = new NMEA_GGA_data_t;
|
||||||
|
const uint8_t res = this->gnss->getLatestNMEAGPGGA(data);
|
||||||
|
if (res > 0) // valid data
|
||||||
|
{
|
||||||
|
char positionUpdate[this->bufferSizePushGPGGA];
|
||||||
|
snprintf(static_cast<char *>(positionUpdate),
|
||||||
|
this->bufferSizePushGPGGA,
|
||||||
|
static_cast<const char *>("Ntrip-GGA: %s"),
|
||||||
|
data->nmea);
|
||||||
|
strncat(static_cast<char *>(serverRequest), static_cast<const char *>(positionUpdate), this->bufferSize);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout << "NTRIPClient::beginClient - No valid data to send position to caster." << std::endl;
|
||||||
|
}
|
||||||
|
delete data;
|
||||||
|
|
||||||
std::cout << "Sending credentials: " << userCredentials << std::endl;
|
this->lastGPGGAPushTime = millis();
|
||||||
|
}
|
||||||
|
|
||||||
// Encode
|
if (this->user && this->password)
|
||||||
const base64 base;
|
{
|
||||||
const String strEncodedCredentials = base64::encode(userCredentials);
|
// Credentials
|
||||||
delete userCredentials;
|
const uint8_t userCredentialsLength = strlen(this->user) + strlen(this->password) + 2;
|
||||||
char encodedCredentials[strEncodedCredentials.length() + 1];
|
auto *userCredentials = new char[userCredentialsLength];
|
||||||
strEncodedCredentials.toCharArray(static_cast<char *>(encodedCredentials), sizeof(encodedCredentials));
|
snprintf(static_cast<char *>(userCredentials), userCredentialsLength, static_cast<const char *>("%s:%s"), this->user, this->password);
|
||||||
|
|
||||||
snprintf(credentials, sizeof(credentials), static_cast<const char *>("Authorization: Basic %s\r\n"), static_cast<const char *>(encodedCredentials));
|
std::cout << "Sending credentials: " << userCredentials << std::endl;
|
||||||
|
|
||||||
|
// Encode
|
||||||
|
const base64 base;
|
||||||
|
const String strEncodedCredentials = base64::encode(userCredentials);
|
||||||
|
delete userCredentials;
|
||||||
|
char encodedCredentials[strEncodedCredentials.length() + 1];
|
||||||
|
strEncodedCredentials.toCharArray(static_cast<char *>(encodedCredentials), sizeof(encodedCredentials));
|
||||||
|
|
||||||
|
snprintf(credentials, sizeof(credentials), static_cast<const char *>("Authorization: Basic %s\r\n"), static_cast<const char *>(encodedCredentials));
|
||||||
|
|
||||||
|
// Add the encoded credentials to the server request
|
||||||
|
strncat(static_cast<char *>(serverRequest), static_cast<const char *>(credentials), this->bufferSize);
|
||||||
|
}
|
||||||
|
|
||||||
// Add the encoded credentials to the server request
|
|
||||||
strncat(static_cast<char *>(serverRequest), static_cast<const char *>(credentials), this->bufferSize);
|
|
||||||
strncat(static_cast<char *>(serverRequest), static_cast<const char *>("\r\n"), this->bufferSize);
|
strncat(static_cast<char *>(serverRequest), static_cast<const char *>("\r\n"), this->bufferSize);
|
||||||
|
|
||||||
std::cout << static_cast<const char *>("serverRequest size: ")
|
std::cout << static_cast<const char *>("serverRequest size: ")
|
||||||
@@ -273,7 +320,7 @@ bool NTRIPClient::processConnection()
|
|||||||
if (rtcmCount > 0)
|
if (rtcmCount > 0)
|
||||||
{
|
{
|
||||||
this->lastReceivedRtcmTime = millis();
|
this->lastReceivedRtcmTime = millis();
|
||||||
this->gps->pushRawData(static_cast<uint8_t *>(rtcmData), rtcmCount);
|
this->gnss->pushRawData(static_cast<uint8_t *>(rtcmData), rtcmCount);
|
||||||
// std::cout << "Pushed " << rtcmCount << " RTCM bytes to ZED." << std::endl;
|
// std::cout << "Pushed " << rtcmCount << " RTCM bytes to ZED." << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -317,7 +364,7 @@ void NTRIPClient::checkAutoReconnect()
|
|||||||
|
|
||||||
void NTRIPClient::pushGPGGA()
|
void NTRIPClient::pushGPGGA()
|
||||||
{
|
{
|
||||||
if (!this->transmitLocation && !this->activated)
|
if ((!this->transmitLocation || !this->activated) || !this->ntripClient->connected())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -328,21 +375,26 @@ void NTRIPClient::pushGPGGA()
|
|||||||
}
|
}
|
||||||
this->lastGPGGAPushTime = millis();
|
this->lastGPGGAPushTime = millis();
|
||||||
|
|
||||||
if (!this->ntripClient->connected())
|
|
||||||
{
|
|
||||||
std::cout << "Failed to pushing GGA to server: " << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto *data = new NMEA_GGA_data_t;
|
auto *data = new NMEA_GGA_data_t;
|
||||||
const uint8_t res = this->gps->getLatestNMEAGPGGA(data);
|
const uint8_t res = this->gnss->getLatestNMEAGPGGA(data);
|
||||||
if (res == 2)
|
if (res > 0) // 2 means fresh data
|
||||||
{
|
{
|
||||||
this->ntripClient->print(reinterpret_cast<const char *>(data));
|
char positionUpdate[this->bufferSizePushGPGGA];
|
||||||
|
snprintf(static_cast<char *>(positionUpdate),
|
||||||
|
this->bufferSizePushGPGGA,
|
||||||
|
static_cast<const char *>("%s"),
|
||||||
|
data->nmea);
|
||||||
|
this->ntripClient->write(positionUpdate, strlen(positionUpdate));
|
||||||
|
std::cout << "Position update: " << positionUpdate << std::endl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::cout << "NTRIPClient::pushGPGGA - No valid data to send position to caster." << std::endl;
|
||||||
}
|
}
|
||||||
delete data;
|
delete data;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NTRIPClient::isConnected()
|
bool NTRIPClient::isConnected()
|
||||||
{
|
{
|
||||||
return this->state == NTRIPClientStates::pushData;
|
return this->state == NTRIPClientStates::pushingData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,10 +27,10 @@
|
|||||||
*/
|
*/
|
||||||
enum NTRIPClientStates
|
enum NTRIPClientStates
|
||||||
{
|
{
|
||||||
openConnection,
|
openingConnection,
|
||||||
pushData,
|
pushingData,
|
||||||
closeConnection,
|
closingConnection,
|
||||||
wait,
|
waiting,
|
||||||
notAvailable
|
notAvailable
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -47,21 +47,21 @@ public:
|
|||||||
/**
|
/**
|
||||||
* @brief Construct a new NTRIPClient object
|
* @brief Construct a new NTRIPClient object
|
||||||
*
|
*
|
||||||
* @param gps The Gnss module
|
* @param gnss The Gnss module
|
||||||
* @param host
|
* @param host
|
||||||
* @param port
|
* @param port
|
||||||
* @param mountPoint
|
* @param mountPoint
|
||||||
* @param user
|
* @param user
|
||||||
* @param password
|
* @param password
|
||||||
*/
|
*/
|
||||||
NTRIPClient(SFE_UBLOX_GNSS *gps, const char *host, uint16_t port, const char *mountPoint, const char *user, const char *password);
|
NTRIPClient(SFE_UBLOX_GNSS *gnss, const char *host, uint16_t port, const char *mountPoint, const char *user = nullptr, const char *password = nullptr);
|
||||||
~NTRIPClient();
|
~NTRIPClient();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Configure the Gnss module to accept correction data
|
* @brief Configure the Gnss module to accept correction data
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void gpsConfiguration();
|
void gnssConfiguration();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Activate or deactivate the location transmission
|
* @brief Activate or deactivate the location transmission
|
||||||
@@ -82,6 +82,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool setActivated(bool state);
|
bool setActivated(bool state);
|
||||||
void setAutoReconnect(bool state);
|
void setAutoReconnect(bool state);
|
||||||
|
void useOutdatedNtripRev1 (bool rev1 = false ) { this->useNtripRev1 = rev1; }
|
||||||
|
|
||||||
bool isConnected();
|
bool isConnected();
|
||||||
|
|
||||||
@@ -103,13 +104,14 @@ private:
|
|||||||
bool processConnection();
|
bool processConnection();
|
||||||
void checkAutoReconnect();
|
void checkAutoReconnect();
|
||||||
|
|
||||||
SFE_UBLOX_GNSS *gps;
|
SFE_UBLOX_GNSS *gnss;
|
||||||
WiFiClient *ntripClient;
|
WiFiClient *ntripClient;
|
||||||
NTRIPClientStates state = NTRIPClientStates::notAvailable;
|
NTRIPClientStates state = NTRIPClientStates::notAvailable;
|
||||||
|
|
||||||
bool transmitLocation = false;
|
bool transmitLocation = false;
|
||||||
bool activated = true;
|
bool activated = true;
|
||||||
bool autoReconnect = false;
|
bool autoReconnect = false;
|
||||||
|
bool useNtripRev1 = false;
|
||||||
|
|
||||||
uint8_t reconnectAttemps = 0;
|
uint8_t reconnectAttemps = 0;
|
||||||
uint16_t port;
|
uint16_t port;
|
||||||
@@ -118,15 +120,17 @@ private:
|
|||||||
uint32_t lastGPGGAPushTime = 0;
|
uint32_t lastGPGGAPushTime = 0;
|
||||||
uint32_t lastReconnectTime = 0;
|
uint32_t lastReconnectTime = 0;
|
||||||
|
|
||||||
const char *host;
|
static const uint8_t connectionDataLength = 32;
|
||||||
const char *mountPoint;
|
char host[connectionDataLength];
|
||||||
const char *user;
|
char mountPoint[connectionDataLength];
|
||||||
const char *password;
|
char user[connectionDataLength];
|
||||||
|
char password[connectionDataLength];
|
||||||
const uint8_t maxReconnectAttemps = 10;
|
const uint8_t maxReconnectAttemps = 10;
|
||||||
const uint16_t reconnectDelayTime = 1000;
|
const uint16_t reconnectDelayTime = 5000;
|
||||||
const uint16_t timeOut = 10000;
|
const uint16_t timeOut = 10000;
|
||||||
const uint16_t bufferSize = 512;
|
const uint16_t bufferSize = 512;
|
||||||
const uint16_t pushGPGGATime = 10000;
|
const uint16_t bufferSizePushGPGGA = 128;
|
||||||
|
const uint16_t pushGPGGATime = 5000;
|
||||||
|
|
||||||
static constexpr uint8_t loopDelay = 20;
|
static constexpr uint8_t loopDelay = 20;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -56,14 +56,29 @@ bool Point::operator==(const Point &rhs) const
|
|||||||
|
|
||||||
double Point::distanceTo(const Coordinates &point) const
|
double Point::distanceTo(const Coordinates &point) const
|
||||||
{
|
{
|
||||||
const Coordinates begin = this->coordinates;
|
// Old implementation
|
||||||
const Coordinates end = point;
|
// const Coordinates begin = this->coordinates;
|
||||||
|
// const Coordinates end = point;
|
||||||
|
|
||||||
const double lat = (begin.lat + end.lat) / 2 * ROUTE_DEGREE_TO_RADIANT;
|
// const double lat = (begin.lat + end.lat) / 2 * ROUTE_DEGREE_TO_RADIANT;
|
||||||
const double dy = ROUTE_DISTANCE_BETWEEN_LATITUDE * (begin.lat - end.lat);
|
// const double dy = ROUTE_DISTANCE_BETWEEN_LATITUDE * (begin.lat - end.lat);
|
||||||
const double dx = ROUTE_DISTANCE_BETWEEN_LATITUDE * cos(lat) * (begin.lon - end.lon);
|
// const double dx = ROUTE_DISTANCE_BETWEEN_LATITUDE * cos(lat) * (begin.lon - end.lon);
|
||||||
|
|
||||||
return sqrt(dx * dx + dy * dy);
|
// return sqrt(dx * dx + dy * dy);
|
||||||
|
|
||||||
|
double latStart = this->toRad(this->coordinates.lat);
|
||||||
|
double lonStart = this->toRad(this->coordinates.lon);
|
||||||
|
double latEnd = this->toRad(point.lat);
|
||||||
|
double lonEnd = this->toRad(point.lon);
|
||||||
|
|
||||||
|
const double earthRadius = 6371.0; //km
|
||||||
|
double cartesianX_1 = cos(latStart) * lonStart * earthRadius;
|
||||||
|
double cartesianY_1 = latStart * earthRadius;
|
||||||
|
double cartesianX_2 = cos(latEnd) * lonEnd * earthRadius;
|
||||||
|
double cartesianY_2 = latEnd * earthRadius;
|
||||||
|
|
||||||
|
return sqrt(pow(cartesianX_2 - cartesianX_1, 2)
|
||||||
|
+ pow(cartesianY_2 - cartesianY_1, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
double Point::distanceTo(const Point &point) const
|
double Point::distanceTo(const Point &point) const
|
||||||
@@ -73,13 +88,24 @@ double Point::distanceTo(const Point &point) const
|
|||||||
|
|
||||||
int16_t Point::courseTo(const Coordinates &point) const
|
int16_t Point::courseTo(const Coordinates &point) const
|
||||||
{
|
{
|
||||||
const Coordinates begin = this->coordinates;
|
// const Coordinates begin = this->coordinates;
|
||||||
const Coordinates end = point;
|
// const Coordinates end = point;
|
||||||
|
|
||||||
const double phi = log(tan(end.lat * ROUTE_DEGREE_TO_RADIANT / 2 + M_PI / 4) / tan(begin.lat * ROUTE_DEGREE_TO_RADIANT / 2 + M_PI / 4));
|
// const double phi = log(tan(end.lat * ROUTE_DEGREE_TO_RADIANT / 2 + M_PI / 4) / tan(begin.lat * ROUTE_DEGREE_TO_RADIANT / 2 + M_PI / 4));
|
||||||
const double lon = (begin.lon * ROUTE_DEGREE_TO_RADIANT - end.lon * ROUTE_DEGREE_TO_RADIANT);
|
// const double lon = (begin.lon * ROUTE_DEGREE_TO_RADIANT - end.lon * ROUTE_DEGREE_TO_RADIANT);
|
||||||
|
|
||||||
return static_cast<int16_t>(atan2(lon, phi) / ROUTE_DEGREE_TO_RADIANT) * -1;
|
// return static_cast<int16_t>(atan2(lon, phi) / ROUTE_DEGREE_TO_RADIANT) * -1;
|
||||||
|
|
||||||
|
double latStart = this->toRad(this->coordinates.lat);
|
||||||
|
double lonStart = this->toRad(this->coordinates.lon);
|
||||||
|
double latEnd = this->toRad(point.lat);
|
||||||
|
double lonEnd = this->toRad(point.lon);
|
||||||
|
|
||||||
|
double y = sin(lonEnd - lonStart) * cos(latEnd);
|
||||||
|
double x = cos(latStart) * sin(latEnd) - sin(latStart) * cos(latEnd) * cos(lonEnd - lonStart);
|
||||||
|
double theta = atan2(y, x);
|
||||||
|
|
||||||
|
return static_cast<int16_t>(this->toDeg(theta)) % 360;
|
||||||
}
|
}
|
||||||
|
|
||||||
int16_t Point::courseTo(const Point &point) const
|
int16_t Point::courseTo(const Point &point) const
|
||||||
|
|||||||
@@ -131,6 +131,17 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void init(uint32_t horizontalAccuracy, uint32_t creationTime);
|
void init(uint32_t horizontalAccuracy, uint32_t creationTime);
|
||||||
|
double toRad (double degree) const
|
||||||
|
{
|
||||||
|
constexpr double radFactor = M_PI / 180.0;
|
||||||
|
return degree * radFactor;
|
||||||
|
};
|
||||||
|
|
||||||
|
double toDeg(double radiant) const
|
||||||
|
{
|
||||||
|
constexpr double degFactor = 180.0 / M_PI;
|
||||||
|
return radiant * degFactor;
|
||||||
|
};
|
||||||
|
|
||||||
Accuracy accuracy = Accuracy::none;
|
Accuracy accuracy = Accuracy::none;
|
||||||
Coordinates coordinates{0, 0};
|
Coordinates coordinates{0, 0};
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
#include "route.h"
|
#include "route.h"
|
||||||
|
|
||||||
|
Route Route::routeCache = Route();
|
||||||
|
|
||||||
void Route::addPointToRoute(Point point)
|
void Route::addPointToRoute(Point point)
|
||||||
{
|
{
|
||||||
this->points.push_back(point);
|
this->points.push_back(point);
|
||||||
@@ -88,6 +90,7 @@ Point Route::getPreviousPoint()
|
|||||||
this->currentPoint--;
|
this->currentPoint--;
|
||||||
return *this->it;
|
return *this->it;
|
||||||
}
|
}
|
||||||
|
|
||||||
return point;
|
return point;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,3 +101,7 @@ RouteInfo Route::getRouteInfo()
|
|||||||
info.currentPoint = this->currentPoint;
|
info.currentPoint = this->currentPoint;
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Route& Route::getRouteCache() {
|
||||||
|
return Route::routeCache;
|
||||||
|
}
|
||||||
|
|||||||
@@ -100,12 +100,16 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool getStarted() const { return this->started; }
|
bool getStarted() const { return this->started; }
|
||||||
|
|
||||||
|
static Route& getRouteCache();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint16_t currentPoint = 0;
|
uint16_t currentPoint = 0;
|
||||||
bool started = false;
|
bool started = false;
|
||||||
|
|
||||||
std::list<Point> points;
|
std::list<Point> points;
|
||||||
std::list<Point>::iterator it;
|
std::list<Point>::iterator it;
|
||||||
|
|
||||||
|
static Route routeCache;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ROUTE_H
|
#endif // ROUTE_H
|
||||||
|
|||||||
@@ -25,11 +25,12 @@ SensorData::~SensorData()
|
|||||||
delete this->ntripClient;
|
delete this->ntripClient;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SensorData::enableNtrip(String host, uint16_t port, String mountPoint, String user, String password)
|
void SensorData::enableNtrip(String host, uint16_t port, String mountPoint, String user, String password, bool sendOwnPosition)
|
||||||
{
|
{
|
||||||
this->ntripClient = new NTRIPClient(this->gnss, host.c_str(), port, mountPoint.c_str(), user.c_str(), password.c_str());
|
this->ntripClient = new NTRIPClient(this->gnss, host.c_str(), port, mountPoint.c_str(), user.c_str(), password.c_str());
|
||||||
this->ntripClient->gpsConfiguration();
|
this->ntripClient->gnssConfiguration();
|
||||||
this->ntripClient->loop();
|
this->ntripClient->loop();
|
||||||
|
this->ntripClient->setTransmitLocation(sendOwnPosition);
|
||||||
this->ntripClient->setActivated(false);
|
this->ntripClient->setActivated(false);
|
||||||
this->isNtripInit = true;
|
this->isNtripInit = true;
|
||||||
this->addChildComponent(this->ntripClient);
|
this->addChildComponent(this->ntripClient);
|
||||||
@@ -89,7 +90,7 @@ void SensorData::enableGyroscope()
|
|||||||
this->gyroscope->initialize();
|
this->gyroscope->initialize();
|
||||||
if (!this->gyroscope->testConnection())
|
if (!this->gyroscope->testConnection())
|
||||||
{
|
{
|
||||||
std::cout << "SensorData::enableGyroscope: Gyroskop is not conntected. Freeze!" << std::endl;
|
std::cout << "SensorData::enableGyroscope: Gyroscope is not connected. Freeze!" << std::endl;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -107,7 +108,7 @@ void SensorData::enableGyroscope()
|
|||||||
{
|
{
|
||||||
this->gyroscope->CalibrateAccel(6);
|
this->gyroscope->CalibrateAccel(6);
|
||||||
this->gyroscope->CalibrateGyro(6);
|
this->gyroscope->CalibrateGyro(6);
|
||||||
this->gyroscope->PrintActiveOffsets();
|
// this->gyroscope->PrintActiveOffsets();
|
||||||
this->gyroscope->setDMPEnabled(true);
|
this->gyroscope->setDMPEnabled(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -264,7 +265,7 @@ void SensorData::initGnss()
|
|||||||
std::cout << "u-blox protocol version: " << static_cast<int>(versionHigh) << "." << static_cast<int>(versionLow) << std::endl;
|
std::cout << "u-blox protocol version: " << static_cast<int>(versionHigh) << "." << static_cast<int>(versionLow) << std::endl;
|
||||||
|
|
||||||
this->gnss->setSPIOutput(COM_TYPE_UBX);
|
this->gnss->setSPIOutput(COM_TYPE_UBX);
|
||||||
this->gnss->enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_SPI, 10);
|
this->gnss->enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_SPI);
|
||||||
this->gnss->setUSBOutput(COM_TYPE_UBX | COM_TYPE_NMEA);
|
this->gnss->setUSBOutput(COM_TYPE_UBX | COM_TYPE_NMEA);
|
||||||
this->gnss->setAutoPVTcallbackPtr(&(SensorData::savePVTdata));
|
this->gnss->setAutoPVTcallbackPtr(&(SensorData::savePVTdata));
|
||||||
// SensorData::setOutputStatusPrintPVTdata(true);
|
// SensorData::setOutputStatusPrintPVTdata(true);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
|
#include <SparkFun_u-blox_GNSS_Arduino_Library.h>
|
||||||
#include <QMC5883LCompass.h>
|
#include <QMC5883LCompass.h>
|
||||||
#include <MPU6050_6Axis_MotionApps20.h>
|
#include <MPU6050_6Axis_MotionApps612.h>
|
||||||
#include "calcAzimuth.h"
|
#include "calcAzimuth.h"
|
||||||
#include "ntripClient.h"
|
#include "ntripClient.h"
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ public:
|
|||||||
SensorData();
|
SensorData();
|
||||||
~SensorData();
|
~SensorData();
|
||||||
|
|
||||||
void enableNtrip(String host, uint16_t port, String mountPoint, String user, String password);
|
void enableNtrip(String host, uint16_t port, String mountPoint, String user, String password, bool sendOwnPosition = false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Enable the gnss module over spi
|
* @brief Enable the gnss module over spi
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ upload_speed = 921600
|
|||||||
; monitor_port = COM6
|
; monitor_port = COM6
|
||||||
lib_deps =
|
lib_deps =
|
||||||
https://git.kleiax.de/PlatformIO-Libs/SparkFunGNSS.git
|
https://git.kleiax.de/PlatformIO-Libs/SparkFunGNSS.git
|
||||||
|
https://git.kleiax.de/PlatformIO-Libs/Menu.git
|
||||||
knolleary/PubSubClient@^2.8
|
knolleary/PubSubClient@^2.8
|
||||||
br3ttb/PID@^1.2.1
|
br3ttb/PID@^1.2.1
|
||||||
marcoschwartz/LiquidCrystal_I2C@^1.1.4
|
marcoschwartz/LiquidCrystal_I2C@^1.1.4
|
||||||
@@ -49,14 +50,3 @@ description = A Rover who should be drive a route by gps.
|
|||||||
;
|
;
|
||||||
;
|
;
|
||||||
;
|
;
|
||||||
;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
;
|
|
||||||
#
|
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ void MenuSensorData::printPage() const
|
|||||||
lineOne = "UNKNOWN";
|
lineOne = "UNKNOWN";
|
||||||
}
|
}
|
||||||
const NTRIPClientStates status = this->sensorData->getNtripState();
|
const NTRIPClientStates status = this->sensorData->getNtripState();
|
||||||
if (status == NTRIPClientStates::pushData)
|
if (status == NTRIPClientStates::pushingData)
|
||||||
{
|
{
|
||||||
lineTwo.concat("enabled");
|
lineTwo.concat("enabled");
|
||||||
}
|
}
|
||||||
@@ -150,3 +150,28 @@ void MenuSensorData::printPage() const
|
|||||||
|
|
||||||
this->print(lineOne, lineTwo);
|
this->print(lineOne, lineTwo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MenuSensorData::runCommand()
|
||||||
|
{
|
||||||
|
switch (this->getCurrentPage())
|
||||||
|
{
|
||||||
|
case 5:
|
||||||
|
{
|
||||||
|
NTRIPClient* client = this->sensorData->getNtripClient();
|
||||||
|
NTRIPClientStates state = client->getClientState();
|
||||||
|
if (state == NTRIPClientStates::pushingData)
|
||||||
|
{
|
||||||
|
client->deactivate();
|
||||||
|
}
|
||||||
|
else if (state == NTRIPClientStates::waiting)
|
||||||
|
{
|
||||||
|
client->activate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void printPage() const override;
|
void printPage() const override;
|
||||||
|
void runCommand() override;
|
||||||
|
|
||||||
SensorData *sensorData;
|
SensorData *sensorData;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ void MenuAutopilot::printPage() const
|
|||||||
const uint8_t carrSoln = gpsData->flags.bits.carrSoln;
|
const uint8_t carrSoln = gpsData->flags.bits.carrSoln;
|
||||||
lineOne = "GNSS: ";
|
lineOne = "GNSS: ";
|
||||||
|
|
||||||
if (status == NTRIPClientStates::pushData)
|
if (status == NTRIPClientStates::pushingData)
|
||||||
{
|
{
|
||||||
if (carrSoln == 0)
|
if (carrSoln == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ void MenuCaptureRoute::printPage() const
|
|||||||
NTRIPClientStates status = this->captureRoute->getSensorData()->getNtripClient()->getClientState();
|
NTRIPClientStates status = this->captureRoute->getSensorData()->getNtripClient()->getClientState();
|
||||||
lineOne = "NTRIP Client is";
|
lineOne = "NTRIP Client is";
|
||||||
|
|
||||||
if (status == NTRIPClientStates::pushData)
|
if (status == NTRIPClientStates::pushingData)
|
||||||
{
|
{
|
||||||
lineTwo = "enabled";
|
lineTwo = "enabled";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ void Autopilot::run()
|
|||||||
this->selfDriving();
|
this->selfDriving();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SelfDrivingRotate:
|
case State::SelfDrivingRotate:
|
||||||
this->checkButtonInput();
|
this->checkButtonInput();
|
||||||
this->rotate();
|
this->rotate();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -129,8 +129,9 @@ void setup()
|
|||||||
NtripConfig::port,
|
NtripConfig::port,
|
||||||
static_cast<const char *>(NtripConfig::mountPoint),
|
static_cast<const char *>(NtripConfig::mountPoint),
|
||||||
static_cast<const char *>(NtripConfig::user),
|
static_cast<const char *>(NtripConfig::user),
|
||||||
static_cast<const char *>(NtripConfig::password));
|
static_cast<const char *>(NtripConfig::password),
|
||||||
// sensorData->enableGyroscope();
|
NtripConfig::sendOwnPosition);
|
||||||
|
sensorData->enableGyroscope();
|
||||||
driveManager = new DriveManager(&moveController, sensorData, controlPad->getControlPadDataPtr());
|
driveManager = new DriveManager(&moveController, sensorData, controlPad->getControlPadDataPtr());
|
||||||
|
|
||||||
char wifiIndicator = 'X';
|
char wifiIndicator = 'X';
|
||||||
|
|||||||