basicaction.h
来自「FIRA 5V5比赛中一个机器人源代码 本科毕业设计做的」· C头文件 代码 · 共 50 行
H
50 行
// BasicAction.h: interface for the CBasicAction class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BASICACTION_H__7199AA9B_6491_4422_8D6D_53662C8323E4__INCLUDED_)
#define AFX_BASICACTION_H__7199AA9B_6491_4422_8D6D_53662C8323E4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "Strategy.h"
#define ROBOT_RADIUS 7
#define ANTI_CLOCKWISE 0
#define CLOCKWISE 1
class CBasicAction
{
public:
CBasicAction(Environment *env);
void avoidObstacle(Environment *env, int whichRobot,Vector3D targetPoint);
void brake(int robotNo);
double decideRobotFront(double angle);
double findRobotMomentum(int whichRobot);
bool isInBetweenPos(Environment *env, Vector3D firstPosition, Vector3D secondPosition, Vector3D robotPosition, double desireWidth);
bool isJam(Environment *env, int whichRobot);//lex: done in 19-6-2003
bool isOppoDribble(OpponentRobot *Opponent_robot, Ball *ball);//LEX: to detect the opponent drebble the balll or not
bool isPathClear(Environment *env, Vector3D firstPosition, Vector3D secondPosition);
void lexSineTurn(Vector3D destination,int whichRobot);
void orbit(Vector3D orbitPoint,Robot *robot,int whichRobot,int dist,int direction);
void position(Vector3D destination, int whichRobot);
void positionMyro(Vector3D destination,/* double finalSpeed, BOOL speedFlag, double finalAngle, BOOL angleFlag,*/ int whichRobot);
void positionRobotToField(Vector3D destination,int whichRobot,int distanceError,double positionAngle);
void positionRobotToBall(Vector3D destination,Robot *robot,int whichRobot,int distanceError,int positionAngle);
double robotToBallAngle(Robot *robot);
void shootStraight(Robot *robot);
void sineTurn(Vector3D destination,/* double finalSpeed, BOOL SpeedFlag, double finalAngle, BOOL AngleFlag,*/ int whichRobot);
void spin(Robot *robot,int speed,int direction);
void turnAngle(int whichRobot, double desiredAngle);
virtual ~CBasicAction();
Environment *env;
};
#endif // !defined(AFX_BASICACTION_H__7199AA9B_6491_4422_8D6D_53662C8323E4__INCLUDED_)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?