fixed a bug that caused navigation not to stop
This commit is contained in:
@@ -128,7 +128,7 @@ bool Navigation::getCourseCorrection(CourseCorrection& correction) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Check if I need a new Point
|
// Check if I need a new Point
|
||||||
if (distance < MIN_DISTANCE_TO_REACH_POINT && !this->preventNextPoint) {
|
if (distance < MIN_DISTANCE_TO_REACH_POINT && this->preventNextPoint == false) {
|
||||||
if (!this->nextPoint()) {
|
if (!this->nextPoint()) {
|
||||||
this->navigationFinished = true;
|
this->navigationFinished = true;
|
||||||
this->navigationStarted = false;
|
this->navigationStarted = false;
|
||||||
@@ -199,7 +199,7 @@ bool Navigation::nextPoint() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Navigation::setTargetPoint(Point target) {
|
bool Navigation::setTargetPoint(Point target) {
|
||||||
if (target.isValid()) {
|
if (target.isInit()) {
|
||||||
this->targetPoint = target;
|
this->targetPoint = target;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#define MIN_DISTANCE_BETWEEN_POINTS 0.1
|
#define MIN_DISTANCE_BETWEEN_POINTS 0.1
|
||||||
#define MIN_DISTANCE_TO_REACH_POINT 3 // TODO: Only for testing!
|
#define MIN_DISTANCE_TO_REACH_POINT 0.5
|
||||||
#define AZIMUTH_UPDATE_DELAY 20
|
#define AZIMUTH_UPDATE_DELAY 20
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user