summaryrefslogtreecommitdiffstats
path: root/source/Concept/Framework/modules/executor
diff options
context:
space:
mode:
Diffstat (limited to 'source/Concept/Framework/modules/executor')
-rwxr-xr-xsource/Concept/Framework/modules/executor/navigator.c6
-rwxr-xr-xsource/Concept/Framework/modules/executor/navigator.h15
2 files changed, 18 insertions, 3 deletions
diff --git a/source/Concept/Framework/modules/executor/navigator.c b/source/Concept/Framework/modules/executor/navigator.c
index 7c4618a..8320eca 100755
--- a/source/Concept/Framework/modules/executor/navigator.c
+++ b/source/Concept/Framework/modules/executor/navigator.c
@@ -59,7 +59,7 @@ void Navigator::Drive(float newDirection, float newAngle, float newSpeed, float
//-----------------------------------------------------------------------------
void Navigator::DriveTo(float newX, float newY, float newAngle, float newSpeed, float rotationSpeed)
{
- if(newX < 0 || newY < 0) return;
+ if(newX == EMPTY_FLOAT || newY == EMPTY_FLOAT) return;
Position_Tracker* locationeer = parent->GetModule<Position_Tracker>(IO_POSITION_TRACKER_MAIN);
@@ -125,7 +125,7 @@ bool Navigator::TargetReached()
bool targetReached = false;
- if(!HasTarget() || (distance2d(targetX, targetY, locationeer->GetPositionX(), locationeer->GetPositionY()) < 1.0f))
+ if(!HasTarget() || (distance2d(targetX, targetY, locationeer->GetPositionX(), locationeer->GetPositionY()) < DISTANCE_TOLERANCE))
{
targetReached = true;
}
@@ -230,7 +230,7 @@ void Navigator::CalculateEngines()
vBack = ((float)vBack * (float)((float)this->robotSpeed / (float)speedCorrection)) + this->rotationSpeed;
vRight = ((float)vRight * (float)((float)this->robotSpeed / (float)speedCorrection)) + this->rotationSpeed;
- //(parent->GetModule<Display>(IO_DISPLAY_MAIN))->Print(vLeft,10,2);
+ (parent->GetModule<Display>(IO_DISPLAY_MAIN))->Print(vBack,10,2);
//(parent->GetModule<Display>(IO_DISPLAY_MAIN))->Print(vBack,10,3);
//(parent->GetModule<Display>(IO_DISPLAY_MAIN))->Print(vRight,10,4);
diff --git a/source/Concept/Framework/modules/executor/navigator.h b/source/Concept/Framework/modules/executor/navigator.h
index 53fa74b..989bc04 100755
--- a/source/Concept/Framework/modules/executor/navigator.h
+++ b/source/Concept/Framework/modules/executor/navigator.h
@@ -67,6 +67,21 @@ public:
return (targetX != EMPTY_FLOAT && targetY != EMPTY_FLOAT);
}
+ float GetTargetX()
+ {
+ return targetX;
+ }
+
+ float GetTargetY()
+ {
+ return targetY;
+ }
+
+ float GetDirection()
+ {
+ return direction;
+ }
+
bool HasTargetAngle()
{
return (targetAngle != EMPTY_FLOAT);