gps now over spi

This commit is contained in:
2022-12-09 14:10:57 +01:00
parent 599f176622
commit f14992c040
26 changed files with 974 additions and 225 deletions
+8 -27
View File
@@ -18,7 +18,6 @@
#include <SPI.h>
#include "route.h"
#include "navigationUtils.h"
#include "NTRIPClient.h"
/**
@@ -64,7 +63,7 @@ class Navigation {
*
* @param route with which to navigate
*/
Navigation(SPIClass spiPort, uint8_t csPin, Route* route = nullptr);
Navigation(SPIClass* spiPort, uint8_t csPin, Route* route = nullptr);
/**
* @brief Destroy the Navigation object
@@ -132,6 +131,8 @@ class Navigation {
* @return SFE_UBLOX_GNSS*
*/
SFE_UBLOX_GNSS* getGPS() { return this->gps; }
static void printPVTdata(UBX_NAV_PVT_data_t *ubxDataStruct);
static void setOutputStatusPrintPVTdata(bool status);
/**
* @brief Returns the NTRIPClient object
@@ -151,12 +152,7 @@ class Navigation {
RouteInfo getRouteInfo() const { return this->route->getRouteInfo(); }
private:
/**
* @brief Returns the current Location
*
* @return Point
*/
Point currentLocation();
void updateCurrentLocation();
/**
* @brief Set the next point as target
@@ -175,24 +171,6 @@ class Navigation {
*/
bool setTargetPoint(Point target);
/**
* @brief Calculate the distance between to points
*
* @param p1 point 1
* @param p2 point 2
* @return double distance in meter
*/
static double distanceBetween(Point p1, Point p2);
/**
* @brief Calculates the course from point1 to point2
*
* @param p1 point 1
* @param p2 point 2
* @return double degree north = 0° west = 270°
*/
static double courseTo(Point p1, Point p2);
void init(Route* route);
SFE_UBLOX_GNSS* gps;
@@ -201,6 +179,7 @@ class Navigation {
Point lastPoint;
Point targetPoint;
Point currentPosition;
bool navigationStarted = false;
bool navigationFinished = false;
@@ -211,9 +190,11 @@ class Navigation {
char* user;
char* password;
uint8_t timeToWait = 5;
uint8_t timeToWait = 200;
uint16_t port;
uint32_t lastMillis = 0;
static bool outputStatusPrintPVTdata;
};
#endif // NAVIGATION_H