summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/modules/executor/navigator.h
diff options
context:
space:
mode:
Diffstat (limited to 'source/Concept/Framework/modules/executor/navigator.h')
-rwxr-xr-xsource/Concept/Framework/modules/executor/navigator.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/source/Concept/Framework/modules/executor/navigator.h b/source/Concept/Framework/modules/executor/navigator.h
index 8da52f6..56e7b8f 100755
--- a/source/Concept/Framework/modules/executor/navigator.h
+++ b/source/Concept/Framework/modules/executor/navigator.h
@@ -11,10 +11,11 @@ public:
{
this->parent = NULL;
this->moduleId = 0;
- this->direction = -1.0f;
- this->targetAngle = -1.0f;
- this->targetX = -1.0f;
- this->targetY = -1.0f;
+ this->correctionCountdown = CYCLES_PER_CORRECTION;
+ this->direction = EMPTY_FLOAT;
+ this->targetAngle = EMPTY_FLOAT;
+ this->targetX = EMPTY_FLOAT;
+ this->targetY = EMPTY_FLOAT;
this->robotSpeed = 0;
this->rotationSpeed = 0;
}
@@ -23,15 +24,17 @@ public:
{
this->parent = NULL;
this->moduleId = navigatorId;
- this->direction = -1.0f;
- this->targetAngle = -1.0f;
- this->targetX = -1.0f;
- this->targetY = -1.0f;
+ this->correctionCountdown = CYCLES_PER_CORRECTION;
+ this->direction = EMPTY_FLOAT;
+ this->targetAngle = EMPTY_FLOAT;
+ this->targetX = EMPTY_FLOAT;
+ this->targetY = EMPTY_FLOAT;
this->robotSpeed = 0;
this->rotationSpeed = 0;
}
protected:
+ uint16 correctionCountdown;
float direction;
float targetAngle;
float targetX;
@@ -54,6 +57,15 @@ public:
{
this->robotSpeed = newSpeed;
}
+
+ void CalculateDirection();
+
+ void CalculateEngines();
+
+ bool HasTarget()
+ {
+ return (targetX != EMPTY_FLOAT && targetY != EMPTY_FLOAT);
+ }
};
#endif