SoccerTeam, Stuff from Magdeburg
This commit is contained in:
parent
343397ecf6
commit
f61eb90087
17 changed files with 666 additions and 122 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Reference in a new issue