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

📄 global.h

📁 浙江大学 RoboCup3D 2006 源代码
💻 H
字号:
/*************************************************************************** *   Copyright (C) 2004 - 2006 by ZJUBase                                  *
 *                                National Lab of Industrial Control Tech. * *                                Zhejiang University, China               * *                                                                         * *   Achievements of ZJUBase in RoboCup Soccer 3D Simulation League:       *
 *    In RoboCup championship,                                             *
 *      - June 2006 - 3rd place in RoboCup 2006, Bremen, Germany (lost     * *        the semi-final with a coin toss)                                 *
 *      - July 2005 - 3rd place in RoboCup 2005, Osaka, Japan (share the   * *        3rd place with team Caspian)                                     *
 *    In RoboCup local events,                                             *
 *      - April 2006 - 2nd place in RoboCup Iran Open 2006, Tehran, Iran   * *        (lost the final with a coin toss)                                *
 *      - December 2005 - 2nd place in AI Games 2005, Isfahan, Iran        *
 *      - July 2005 - champion in China Robot Competition 2005, Changzhou, * *        China                                                            *
 *      - October 2004 - champion in China Soccer Robot Competition 2004,  * *        Guangzhou, China                                                 *
*                                                                         * *   Team members:                                                         *
 *    Currently the team leader is,                                        * *           Hao JIANG (jianghao@iipc.zju.edu.cn; riveria@gmail.com)       *
 *    In the next season, the leader will be                               * *           Yifeng ZHANG (yfzhang@iipc.zju.edu.cn)                        *
 *    ZJUBase 3D agent is created by                                       * *           Dijun LUO (djluo@iipc.zju.edu.cn)                             *
 *    All the members who has ever contributed:                            * *           Jun JIANG                                                     *
 *           Xinfeng DU (xfdu@iipc.zju.edu.cn)                             *
 *           Yang ZHOU (yzhou@iipc.zju.edu.cn)                             *
 *           Zhipeng YANG                                                  *
 *           Xiang FAN                                                     *
 *                                                                         *
 *   Team Manager:                                                          *
 *      Ms. Rong XIONG (rxiong@iipc.zju.edu.cn)                            *
 *                                                                         *
 *   If you met any problems or you have something to discuss about        * *   ZJUBase. Please feel free to contact us through EMails given below.   * *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * *   This program 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 General Public License for more details.                          * *                                                                         * *   You should have received a copy of the GNU General Public License     * *   along with this program; if not, write to the                         * *   Free Software Foundation, Inc.,                                       * *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             * ***************************************************************************/#ifndef GLOBAL_H
#define GLOBAL_H

#pragma warning (disable :4786)
#include "soccertypes.h"
#include "Utils.h"
#include "SoccerCommand.h"
#include <string>
#include <vector>

#define X(x) (Situation::SS->mFieldLength*(x)/200.0)
#define Y(y) (Situation::SS->mFieldWidth*(y)/200.0)

using namespace std;

typedef struct tagPlayerInfo{
	Vector3		pos;
	Vector3		vel;
	Dist		dist2ball;
	Angle		ang2ball;
	Dist		dist2me;
	Angle		ang2me;
	int			number;
}PlayerInfo;


class HearMsg
{
public:
	bool isBallSeen;
	Vector3 ballPos;
	Vector3 ballVel;
	double our[11][3], opp[11][3];
	int action[3];
};

typedef struct tagWM{
	//======================
	int			myNumber;
	Vector3		myPos;
	Vector3		myVel;
	Vector3		nextPos;
	Vector3		nextVel;

	//=======================
	Vector3	    ballPos;
	Vector3	    ballVel;
	Vector3	    nextBallPos;
	double      myPanAngle;
	double      myTiltAngle;

	//=======================
	Vector3		ourPos[11];
	Vector3		oppPos[11];
	Vector3		ourVel[11];
	Vector3		oppVel[11];

	//=======================
	TPlayMode	pm;
	int			mSensationCount;
	Cycle		subCycle;
	_Time		currentTime;
	int			simTime;
	int			notifyTime;

	int 			noball;

	int			noour[11];
	int			noopp[11];
	int			noflag[8];
	
	//=======================

	int			collisionFlag;

	//=======================
	HearMsg 		hearMsg;
}WM;



typedef vector<SoccerCommand> CommandList;



typedef vector<CommandList> CommandQueue;



typedef struct tagGlobal{
	char strTeamName[20];
	WM			wm;

	//========================
	PlayerInfo	our[11];
	PlayerInfo	opp[11];

	//========================
	CommandList			commands[COMMAND_MAX];
	int			nCommand;

	//========================
	Vector3		driveF;

} Global;

extern void ShowLine(double x1,double y1,double z1,double x2,double y2,double z2,char *str, ...);
extern void ShowLine(Vector3 p1,Vector3 p2,char *str, ...);
extern void ShowLine(Vector3 p0,double dist,double ang,char *str, ...);
extern void ShowCircle(double x,double y,double r,char *str, ...);
extern void ShowCircle(Vector3 p0,double r,char *str, ...);
extern void ShowSphere(double x,double y,double z,double r,char *str, ...);
extern void ShowRect(double x1,double y1,double x2,double y2,char *str, ...);
extern void ShowPie(double x,double y,double r,double ang1,double ang2,char *str, ...);
extern void ShowMessage(char* str,...);
extern void ShowWM();
extern void Paint();
extern Global global;
extern Global global_previous[POINT_MAX];
extern vector<string> strDebug;
extern vector<string> geoDebug;

#endif

⌨️ 快捷键说明

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