⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 goalie.h

📁 robocup源代码2001年清华机器人源代码
💻 H
字号:
/*
    Copyright (C) 2001  Tsinghuaeolus

    Authors : ChenJiang, YaoJinyi, CaiYunpeng, Lishi

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

	If you make any changes or have any comments we would appreciate a 
	message to yjy01@mails.tsinghua.edu.cn.
*/

#ifndef _goalie
#define _goalie
#include "types.h"
#include "Command.h"
#include "Strategy.h"
#include "goingthroughspeed.h"

class PassiveITInfo{
public :
	float IT_rapidness;
	Vector IT_point;
	float IT_waitcycles;
	float IT_cycles;
	AngleDeg turnangle;
};

class DefendInfo{
public :
	Vector OppPos;
	float TolerantTime;
	Vector DefendBase;
};

class Goalie : public GT_speed_utils{
private:
	Command ITcommand;
	float minITcycles;	
	PassiveITInfo PIT_info[60]; 
	int num_PIT_infos;
	Line balltrace;
	Line bottomline;

	Time IT_decision_time;
	Time IT_decision_holdtime;
	

	DefendInfo DEF_info[5];
	int num_opp_considered;
	bool CheckShootSpeed(Vector BallPoint,Vector DefPos);
	bool BallInNarrowAngle();
	bool DefendShootOK();
	bool DefendShoot();
	bool DefendPass();
	bool GoBack();
	void AdjustFacings();
	float L_through_spd;
	float R_through_spd;
	Vector ballpoint;
	Vector closerpost;
	Ray Defendline;
	AngleDeg nextfacing;
	PassiveITInfo mostpromisingIT;

	float GetGothroughSpeed(Ray ballcourse,Vector Playerpos,Line pline);	
	float ballrollingtime(float orgspeed,float dist);
	float ballspeedrequired(float dist,int time);
	float dist_to_goal(Vector pos);
	void proceedball(Vector &ballpos,Vector &ballvel,int cycles);
	void CalcToleranceTime(DefendInfo &definf);
	bool CatchWait();
public:
	Goalie();
	bool Smartgoalie();
	bool GoalieDefense();
	bool Ifcare();
	bool IfOut();
	bool IfOppkickmore();
	void Dawdle();
	void Catchball();
	void Kickaway();
	void DefendMove();
	bool GoalieRunto(Vector point,int deviationdegree,float speed = SP_player_speed_max);
	bool GoalieIntercept();	
	bool OneCycleIT();
	bool GoalieJustKicked;
	
	bool IsShoot();
	bool GetInterceptionInfo(Vector ballpos,Vector ballvel,Vector Selfpos,Vector Selfvel,AngleDeg facing);
	void AddPITinfo(PassiveITInfo& PassiveIT_info);
	Vector GetGuardPoint();
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -