- remove NtripReconnect from Autopilot and CaptureRoute

- shiftet moveControl States in the class namespace
- added auto reconeect to NtripClient
- a lot of refactor
This commit is contained in:
2023-05-30 23:40:05 +02:00
parent 98b65c4aec
commit 22eb6788c3
18 changed files with 369 additions and 280 deletions
+15 -5
View File
@@ -29,7 +29,7 @@
* around the half accuracy of the positioning system
*
*/
#define MIN_DISTANCE_BETWEEN_POINTS 0.1
#define MIN_DISTANCE_BETWEEN_POINTS 0.3
#define MIN_DISTANCE_TO_REACH_POINT 0.5
#define AZIMUTH_UPDATE_DELAY 20
@@ -55,6 +55,14 @@ struct CourseCorrection {
*/
class Navigation {
public:
enum Status {
InsufficientAccuracy,
Unchanged,
Updated,
Complete
};
/**
* @brief Construct a new Navigation object and using I2C
*
@@ -123,7 +131,7 @@ class Navigation {
* @return true if new correction data provided
* @return false if route is finished
*/
bool getCourseCorrection(CourseCorrection& correction);
Status getCourseCorrection(CourseCorrection& correction);
/**
* @brief Tries to add the current Position to the route
@@ -133,7 +141,7 @@ class Navigation {
* @return true successful added point
* @return false no point added to route
*/
bool addCurrentPosToRoute();
Status addCurrentPosToRoute();
// TODO: can be deleted?
// bool setPointBeforeTurn();
@@ -189,6 +197,7 @@ class Navigation {
private:
void updateCurrentLocation();
int16_t calculateCourseCorrection();
/**
* @brief Set the next point as target
@@ -215,10 +224,11 @@ class Navigation {
NTRIPClient* ntripClient = nullptr;
QMC5883LCompass* compass;
Point lastPoint;
Point lastPointRouteInsert;
Point lastPointCalcCorrection;
Point targetPoint;
Point currentPosition;
Point beforeTurnPoint;
Point::Accuracy minAccuracy = Point::Accuracy::twoDigOfCM;
bool navigationStarted = false;