From f61eb900879fe941460a284ff9e4681b0958b944 Mon Sep 17 00:00:00 2001 From: sicarius Date: Mon, 26 Feb 2007 21:25:01 +0000 Subject: SoccerTeam, Stuff from Magdeburg --- source/Concept/Framework/modules/executor/navigator.c | 6 +++--- source/Concept/Framework/modules/executor/navigator.h | 15 +++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'source/Concept/Framework/modules/executor') 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(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(IO_DISPLAY_MAIN))->Print(vLeft,10,2); + (parent->GetModule(IO_DISPLAY_MAIN))->Print(vBack,10,2); //(parent->GetModule(IO_DISPLAY_MAIN))->Print(vBack,10,3); //(parent->GetModule(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); -- cgit v1.2.3