永发信息网

机器人足球比赛程序如何修改

答案:1  悬赏:0  手机版
解决时间 2021-10-19 20:53
机器人足球比赛程序如何修改
最佳答案
不知道你说的是不是这样,改动之后可能会好一点!  #ifndef Strategy_H  #define Strategy_H  // The following ifdef block is the standard way of creating macros which make exporting  // from a DLL simpler. All files within this DLL are compiled with the STRATEGY_EXPORTS  // symbol defined on the command line. this symbol should not be defined on any project  // that uses this DLL. This way any other project whose source files include this file see  // STRATEGY_API functions as being imported from a DLL, wheras this DLL sees symbols  // defined with this macro as being exported.  #ifdef STRATEGY_EXPORTS  #define STRATEGY_API __declspec(dllexport)  #else  #define STRATEGY_API __declspec(dllimport)  #endif  #include <string.h>  #include <stdio.h>  const long PLAYERS_PER_SIDE = 5;  // gameState  const long FREE_BALL = 1;  const long PLACE_KICK = 2;  const long PENALTY_KICK = 3;  const long FREE_KICK = 4;  const long GOAL_KICK = 5;  // whosBall  const long ANYONES_BALL = 0;  const long BLUE_BALL = 1;  const long YELLOW_BALL = 2;  // global variables -- Useful field positions ... maybe???  //预先定义好地称的尺寸信息  const double FTOP = 77.2392; //Field Top Y coordinate  const double FBOT = 6.3730; //Field Bottom y coordinate  const double GTOPY = 49.6801; //Goal Top Y coordinate  const double GBOTY = 33.9320; //Goal Bottom coordinate  const double GRIGHT = 97.3632; //Right Goal Bach coordinate  const double GLEFT = 2.8748; //Left Goal Back coordinate  const double FRIGHTX = 93.4259; //Field Right x coordinate  const double FLEFTX = 6.8118; //Field Left x coordinate  const double OFFSET=4.5;  int max;  int min;  int mid1;  int mid2;  int min1,min2;  int Old_Role;  int Area1,Area2;  double RB_dis[5];  double RB_time[5];  double RB_angle[5];  double TOFFSET1;  double dis[6];  typedef struct //机器人坐标  {  double x, y, z;  } Vector3D;  typedef struct  {  double x, y;  } Vector2D;  typedef struct  {  long left, right, top, bottom;  } Bounds;  typedef struct //机器人信息  {  Vector3D pos; //机器人坐标  double rotation; //机器人方向角  double velocityLeft, velocityRight; //机器人左右轮速  } Robot;  typedef struct //对方机器人定义  {  Vector3D pos; //对方机器人位置坐标  double rotation; //对方机器人方向角  } OpponentRobot;  typedef struct //球信息定义  {  Vector3D pos;  } Ball;  typedef struct  {  double x,y;  } Point;  typedef struct //环境结构变量中边界的定义  {  double left, right, top, bottom; //边界信息  } Bounds1;  typedef struct //环境信息模型  {  Robot home[PLAYERS_PER_SIDE]; //本方机器人数据  OpponentRobot opponent[PLAYERS_PER_SIDE]; //对方机器人数据  Ball currentBall, lastBall, predictedBall; //球的数据  Bounds fieldBounds, goalBounds; //场地信息  long gameState; //比赛状态  long whosBall; //控球方  void *userData; //用户数据  } Environment;  int flagHome1Home2;  typedef void (*MyStrategyProc)(Environment*);  /* MUST BE IMPLEMENTED */  extern "C" STRATEGY_API void Create ( Environment *env ); // 比赛开始时系统调用,用于出市话用户定义的一些数据  extern "C" STRATEGY_API void Strategy ( Environment *env );//比赛过程中系统调用,每秒调用60次,仿真周期为1/60秒  extern "C" STRATEGY_API void Destroy ( Environment *env ); // 比赛结束后系统调用,释放空间  /*  全局指针env:数据的输入和输出均要对改变量进行操作,实现仿真环境与代码之间的通信,例如:要想获  得1号机器人的坐标,只需读取env->home[1].pos即可;设置一号机器人的轮速,只需对env->home[1].velocityLeft,  env->home[1].velocityRight修改  */  #endif // Strategy_H
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
我想见初恋
2016房产税利率是多少?了解下
取环的最佳时间是什么时候
苏教版小学一年级语文下册课文朗读MP3能发给
朋友说有一把木吉他的品牌为巴西产(yade)雅德
福州微博或者微信预定蛋糕的有没有推荐的,谢
sm公司有眼睛小的女明星吗
康佳伴音块LA42051 供电对地的阻值是多少?
怀孕不小心吃到母猪肉怎么办?
怀孕三个多月了,在香港买的“高效孕妇钙片”
魔兽世界突袭螳螂高原任务在哪里接
谁有酷我音乐盒的VIP账号啊 ,求共享,我要下M
美的空调应急开关在哪,可不可以告诉我啊?
情人节送女人什么礼物最好
百度没有尾巴大型犬是什么犬
推荐资讯
设备吊装搬运过程注意事项有哪些?
什么是溶脂减肥溶脂减肥好吗
潍坊厨房装修攻略有哪些?不同档次有什么区别
石家庄的台湾美食节说实话办的有点失败还不如
请问乳胶漆十大品牌有哪些?乳胶漆厂家有哪些
电力变压器是什么原理?
鑫海·飞易达橱柜家居馆怎么去啊,有知道地址
牙齿长黑的东西是什么,很多,怎么样除掉
山西宝太银业商贸有限公司的交易时间是?
汽车玻璃上的油漆颗粒怎么去除,既安全又简单
卷心菜对人体有什么好处呢?
我想写个心理学个案报告,求格式``有范文最好
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?