robotstruct.h

来自「路径规划源程序」· C头文件 代码 · 共 53 行

H
53
字号
#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 + =
减小字号Ctrl + -
显示快捷键?