zwischenstand, ich habe Lust mache jetzt weiter :)

This commit is contained in:
2022-01-12 15:21:53 +01:00
parent 29a636060c
commit be6f20d96b
10 changed files with 181 additions and 118 deletions
+39 -44
View File
@@ -1,58 +1,53 @@
#ifndef ROUTE_H
#define ROUTE_H
// #ifndef ROUTE_H
// #define ROUTE_H
#include <cstdint>
#include <list>
#include <TinyGPS++.h>
#include <Arduino.h>
// #include <cstdint>
// #include <list>
// #include <TinyGPS++.h>
// #include <Arduino.h>
#include "motorControl.h"
#include "speedometer.h"
#include "debugMqtt.h"
#include "config.h"
// #include "motorControl.h"
// #include "speedometer.h"
// #include "debugMqtt.h"
// #include "config.h"
struct Point{
double lat = 0;
double lon = 0;
bool operator==(const Point& rhs) const {
return this->lat == rhs.lat && this->lon == rhs.lon;
}
};
// struct Point{
// double lat = 0;
// double lon = 0;
// bool operator==(const Point& rhs) const {
// return this->lat == rhs.lat && this->lon == rhs.lon;
// }
// };
class Route {
public:
Route();
// class Route {
// public:
// Route();
void runRoute();
// void runRoute();
void addPointToRoute(Point point);
void addCurrentLocationToRoute();
void delRoute();
void resetRoute();
// void addPointToRoute(Point point);
// void addCurrentLocationToRoute();
// void delRoute();
// void resetRoute();
Point startRoute();
Point getNextPoint();
uint16_t getNumberOfPoints();
// Point startRoute();
// Point getNextPoint();
// uint16_t getNumberOfPoints();
static double getDis(Point point_1, Point point_2);
// static double getDis(Point point_1, Point point_2);
private:
bool nearlySameLocation(Point p1, Point p2);
// private:
// bool nearlySameLocation(Point p1, Point p2);
std::list<Point> points;
std::list<Point>::iterator it;
Point currentLocation;
// std::list<Point> points;
// std::list<Point>::iterator it;
// Point currentLocation;
uint16_t count_points = 0;
// uint16_t count_points = 0;
bool route_started = false;
bool route_finished = false;
// bool route_started = false;
// bool route_finished = false;
// };
TinyGPSPlus gps;
DebugMqtt *debug;
};
#endif // ROUTE_H
// #endif // ROUTE_H