-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNavigation.h
More file actions
executable file
·88 lines (75 loc) · 2.33 KB
/
Navigation.h
File metadata and controls
executable file
·88 lines (75 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef NAVIGATION_H
#define NAVIGATION_H
#include <string>
#include <cmath>
#include <fstream>
#include <string>
#include <iostream>
#include <mutex>
#include "GPSParser.h"
#include "PaulNovackGlobals.h"
#include "GPSUtils.h"
#include "json.hpp"
#include "AppConfig.h"
#include "mySQLConnectionPool.h"
using json = nlohmann::json;
using namespace std;
namespace PaulNovack {
class GPSParser;
class Navigation {
public:
Navigation();
Navigation(AppConfig& config);
Navigation(const Navigation& orig);
virtual ~Navigation();
int ReadDestination();
void CalculateNavigation();
void SetGPSData(
float latitude,
float longitude,
float heading,
float speedKnots,
float speedMPH,
bool goBackSecondsSpeedCalculation,
string hdop,
string pdop);
void setGPSParser(GPSParser& gpsParser);
void setGPSUtils(GPSUtils& gpsUtils);
GPSParser* _gpsParser = nullptr;
GPSUtils* _gu = nullptr;
AppConfig* _config = nullptr;
TurnData getTurnData();
void setConfig(AppConfig& config);
NavData getNavData();
void setDestination(float Latitude, float Longitude);
private:
static const int MAX_SIZE = 300;
LatLong latLongArray[MAX_SIZE];
void pushLocationHistoryToFront(const LatLong& element);
float calculateBearing(float lat1, float lon1, float lat2, float lon2);
float degreesToRadians(float degrees);
float calculateDistance(float lat1, float lon1, float lat2, float lon2);
mutex nav_mutex;
float _latitude;
float _longitude;
float _heading;
float _destHeading;
float _destLatitude;
float _destLongitude;
float _rHTurn;
float _lHTurn;
string _turnDirection;
float _turnDegrees;
int _stepsPerCorrection;
float _speedKnots;
float _speedMPH;
float _headingDeviation;
float _milesToDestination;
int _goBackSecondsSpeedCalculation;
bool _usingGoBackSecondsSpeedCalculation;
string _hdop;
string _pdop;
//MySQLConnectionPool& connectionPool; // Reference to MySQLConnectionPool
};
}
#endif // NAVIGATION_H