コード例 #1
0
ファイル: GoalieURJC.cpp プロジェクト: abellagonzalo/go2012
bool GoalieURJC::Despeje2Block0_transition_code(void)
{
//BUILDER COMMENT. DO NOT REMOVE. begin Despeje2Block0_transition_code
	Pose2D robotpos;

	if(_WorldState->getReliability()>0.3)
	{
		robotpos = _WorldState->getPosition();
		HPoint2D ball_position;

	if(_BallDetector->ballmodel->elapsedTimeSinceLastObs > ObjectState::LONG_TIME)
	{
		return true;
	}

	ObjectState* balls = _BallDetector->getObj();
	Vector2<double> pos = balls->getPositionInRelativeCoordinates();

	static Vector2<double> posabs = Pose2D::relative2FieldCoord(robotpos, pos.x, pos.y);

	if ((posabs.x>-2000.0) || (fabs(posabs.y)>1500.0))
		return true;
	else
		return false;
	}else
	{
		return true;
	}
//BUILDER COMMENT. DO NOT REMOVE. end Despeje2Block0_transition_code
}
コード例 #2
0
ファイル: GoalieURJC.cpp プロジェクト: abellagonzalo/go2012
bool GoalieURJC::Block2Despeje0_transition_code(void)
{
//BUILDER COMMENT. DO NOT REMOVE. begin Block2Despeje0_transition_code
return false;

	Pose2D robotpos;
	if(_WorldState->getReliability()>0.5)
	{
		robotpos = _WorldState->getPosition();
		HPoint2D ball_position;

		if(_BallDetector->ballmodel->elapsedTimeSinceLastObs < ObjectState::LONG_TIME)
		{
			ObjectState* balls = _BallDetector->getObj();
			Vector2<double> pos = balls->getPositionInRelativeCoordinates();

			static Vector2<double> posabs = Pose2D::relative2FieldCoord(robotpos, pos.x, pos.y);

			if ((posabs.x<-2200.0) && (fabs(posabs.y)<1200.0))
				return true;
			else
				return false;
		}else
		{
			//cerr<<"No veo la pelota"<<endl;
			return false;
		}
	}else
		return false;

//BUILDER COMMENT. DO NOT REMOVE. end Block2Despeje0_transition_code
}