remove most of the defines
This commit is contained in:
@@ -63,7 +63,7 @@ void Navigation::init(Route* route) {
|
||||
caliCompass.loadData();
|
||||
caliCompass.useData();
|
||||
|
||||
this->loopDelay =AZIMUTH_UPDATE_DELAY;
|
||||
Component::loopDelay = Navigation::loopDelay;
|
||||
}
|
||||
|
||||
Navigation::~Navigation() {
|
||||
@@ -168,8 +168,8 @@ Navigation::Status Navigation::addCurrentPosToRoute() {
|
||||
|
||||
// Every Point after the first
|
||||
double distance = this->currentPosition.distanceTo(this->lastPointRouteInsert);
|
||||
if (MIN_DISTANCE_BETWEEN_POINTS <= distance
|
||||
&& MAX_DISTANCE_BETWEEN_POINTS >= distance){
|
||||
if (Navigation::minDisBetweenPoints <= distance
|
||||
&& Navigation::maxDisBetweenPoints >= distance){
|
||||
this->route->addPointToRoute(this->currentPosition);
|
||||
this->lastPointRouteInsert = this->currentPosition;
|
||||
return Status::Updated;
|
||||
|
||||
@@ -23,18 +23,6 @@
|
||||
#include "calibrateCompass.h"
|
||||
#include "component.h"
|
||||
|
||||
/**
|
||||
* @brief The minimal distance between Points
|
||||
*
|
||||
* This is a very critical option. It have to be
|
||||
* around the half accuracy of the positioning system
|
||||
*
|
||||
*/
|
||||
#define MIN_DISTANCE_BETWEEN_POINTS 0.3
|
||||
#define MAX_DISTANCE_BETWEEN_POINTS 10
|
||||
#define MIN_DISTANCE_TO_REACH_POINT 0.5
|
||||
#define AZIMUTH_UPDATE_DELAY 20
|
||||
|
||||
/**
|
||||
* @brief This struct inherits the result of the navigation
|
||||
*
|
||||
@@ -221,6 +209,10 @@ class Navigation : public Component {
|
||||
bool setTargetPoint(Point target);
|
||||
int16_t calculateCourseCorrection(Point& point);
|
||||
|
||||
static constexpr uint8_t loopDelay = 20;
|
||||
static constexpr uint8_t maxDisBetweenPoints = 10;
|
||||
static constexpr float minDisBetweenPoints = 0.3;
|
||||
|
||||
SFE_UBLOX_GNSS* gps;
|
||||
UBX_NAV_PVT_data_t* ubxData = nullptr;
|
||||
Route* route = nullptr;
|
||||
@@ -235,8 +227,6 @@ class Navigation : public Component {
|
||||
Point::Accuracy minAccuracy = Point::Accuracy::twoDigOfCM;
|
||||
CalcAzimuthState calcAzimuthState = CalcAzimuthState::Invalid;
|
||||
|
||||
|
||||
|
||||
bool navigationStarted = false;
|
||||
bool navigationFinished = false;
|
||||
bool isNtripInit = false;
|
||||
|
||||
Reference in New Issue
Block a user