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

📄 robotstruct.h

📁 InnovLabSimu在vc++下实现
💻 H
字号:
#ifndef ROBOT_STRUCT_H
#define ROBOT_STRUCT_H
namespace personal_RobotParmspace
{
#define ROBOTS 7
	/**额外添加的部分机器人参数,为速度估计准备**/
#define ROBOT_WHEEL_DIS 550//机器人左右轮距单位为毫米
#define OrientationBase 1.57079632679490//机器人当前朝向在机器人坐标系中的角度,单位弧度
	/*********************************/
	enum Role{attacker,assistAttackerOne,assistAttackerTwo,defender,assistDefenderOne,assistDefenderTwo,goalKeeper};
	/*enum State{normal,special};*/
	enum State{normal,kickOutBoundary,defendOutBoundary,kickCornerBall,defendCornerBall,kickGoleBall,defendGoleBall,
		kickBeforDoorPoint,defendBeforeDoorPoint,deadBall,stop,kickFreeBall,defendFreeBall};
	enum GameState{blue_Kickoff='K',blue_FreeKick='F',blue_CornerKick='C',blue_GoaledTheTarget='G',blue_ThrowIn='T',blue_PenaltyKick='P',
		Yellow_Kickoff='k',Yellow_FreeKick='f',Yellow_CornerKick='c',Yellow_GoaledTheTarget='g',Yellow_ThrowIn='t',Yellow_PenaltyKick='p',
		StartGame='s',StopGame='o',DroppedBall='d',Endhalf='e',InRunning='i'};//输入为O时返回StopGame

	typedef struct Robot 
	{
		Role role;
		float translationX;
		float translationZ;
		float rotation;
	}Robot;
	typedef struct Ball 
	{
		float translationX;
		float translationZ;
	}Ball;
	typedef struct SpecialObs 
	{
		bool exist;
		float translationX;
		float translationZ;//此结构体存储开场发球时把球当作障碍物时球的坐标
	}SpecialObs;
	typedef struct Position 
	{
		float translationX;
		float translationZ;
	}Position;
	typedef struct WorldInfo 
	{
		State stateInfo;//决定是正常比赛状态还是裁判状态
		Robot robotInfo[ROBOTS];
		Ball ballInfo;
		int area;
		Position leaderPos;
		SpecialObs specialObsInfo;
	}WorldInfo;

}

#endif

⌨️ 快捷键说明

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