【正文】
.). When the referee calls a penaltykick, the ball will be placed at the relevant penalty kick position (PK) on the playground (Appendix 1). The robot taking the kick shall be 。 When any one of the human members touches the robots without the referee39。 Referee calls goal kick (Law 12) or freeball (Law 13). Law 10 : Free Kick (Appendix 3) When a defender robot intentionally pushes an opponent robot, a free kick will be given to the opposite team (Law .). The ball will be placed at the relevant free kick position (FK) on the playground (Appendix 1). The robot taking the kick shall be placed behind the ball. The attacking team can position its robots freely on the playground. The two defending robots are allowed to be placed at the leftmost and rightmost sides in touch with the front line of goal area and the other defending two robots should be placed in touch with the side line of the penalty area. With the referee39。 Defending with more than three robots in the penalty area shall be penalized by a penaltykick. (A robot is considered to be in the goal area if it is more than 50% inside, as judged by the referee.) Law 9 : Play Interruptions The play shall be interrupted and relocation of robots shall be done by a human operator, only when: 1. The goalkeeper robot should kick out the ball from its goal area (Law 1.(d).) within 10 seconds. The failure to do so will be penalized by giving a penalty kick to the opposite team. 7. It is permitted to push the goalkeeper robot in the goal area, if the ball is between the pushing robot and the goalkeeper. However, pushing the goalkeeper into the goal along with the ball is not allowed. If an attacking robot pushes the goalkeeper along with the ball into the goal or when the opponent robot pushes the goalkeeper directly then the referee shall call goal kick as goalkeeper charging. 3. The ball es out of goal area. 3. After the referee39。 At the mencement of the game, the attacking team will be allowed to position their robots freely in their own area and within the center circle. Then the defending team can place their robots freely in their own area except within the center circle.At the beginning of the first and second halves, and after a goal has been scored, the ball should be kept within the center circle and the ball should be kicked or passed towards the team39。 The duration of a game shall be two equal periods of 5 minutes each, with a half time interval for 10 minutes. An official timekeeper will pause the clock during substitutions, while transporting an injured robot from the field, during timeout and during such situations that deem to be right as per the discretion of the timekeeper. 2. to notify the referee. Each team will be entitled for two timeouts in a game and each shall be of 2 minutes duration. While a match is in progress, at any time the referee whistles the human operator should stop all robots using the munication between the robots and the host puter. (c) Substitutions Two substitutes shall be permitted while a game is in progress. At half time, unlimited substitutions can be made. When a substitution is desired while the game is in progress, the concerned team manager should call 39。s sides should be colored light, except at regions necessarily used for robot functionality, such as those for sensors, wheels and the ball catching mechanism. The robots should wear uniforms and the size of which shall be limited to 8cm X 8cm X 8cm. 2. II.s identification color will change from game to game, and the team color patch used should be detachable. When assigned with one of the 2team colors (blue or yellow), the robots must not have any visible patches of those colors used by an opponent team.Note : The teams are remended to prepare a minimum of 10 different color patches, other than blue and yellow, for individual robot identification I. The size of each robot shall be limited to X X . The height of the RF munication antenna will not be considered in deciding a robot39。 點(diǎn)球球與機(jī)器人擺放原則,其他機(jī)器人都在另外半場(chǎng)點(diǎn)球的判斷:結(jié)合以上三個(gè)條件起來(lái)就可以判斷是否在罰自由球。 case GOAL_KICK: //發(fā)生點(diǎn)球時(shí)的策略 MoonAttack ( amp。 } break。 break。envhome [1], env )。 case PLACE_KICK: //發(fā)生墜球時(shí)的策略 //由二號(hào)小車(chē)發(fā)球 MoonAttack ( amp。envhome [4], env )。 MoonFollowOpponent ( amp。envopponent [2] )。envhome [0], env )。envopponent [4] )。envhome [2], amp。 switch (envgameState) { case 0: // default 缺省情況下的策略 //三個(gè)機(jī)器人進(jìn)行追逐對(duì)方的策略 MoonFollowOpponent ( amp。 case PENALTY_KICK: break。envhome[2], 125, 125 )。//讓小車(chē)2沿直線跑到Y(jié)軸與機(jī)器人位置相等X軸為60這個(gè)點(diǎn)去。envhome[1], env,60)。 case FREE_KICK: break。//讓小車(chē)1守門(mén),并且跟據(jù)球的Y軸的位置的移動(dòng)而移動(dòng) break。 case GOAL_KICK: break。 case FREE_BALL: break。 }}3. 讓小車(chē)跟著球跑switch (envgameState) { case 0: Position(amp。 case PLACE_KICK: break。envhome[1], 50, 60)。 case PENALTY_KICK: break。//讓小車(chē)2沿直線跑到Y(jié)軸與機(jī)器人位置相等X軸為60這個(gè)點(diǎn)去。envhome[1], env,60)。 env = env + dy。 } Velocity(robot, vl, vr)。 vr = (int)( vc * ( / ( + exp( * d_e)) ) + Ka * theta_e)。amp。 abs(theta_e) 40) Ka = 。 if (theta_e 80) theta_e = 80。 else if (d_e 20) Ka = 23. / 90.。 while (theta_e 180) theta_e += 360。 dy == 0) desired_angle = 90。 dy = y robot。 } Velocity (robot, vl, vr)。 if (abs(theta_e) 50) { vl = (int)(9./ * (double) theta_e)。 while (theta_e 180) theta_e = 360。下面是一些基本的動(dòng)作函數(shù)://設(shè)置機(jī)器人左右輪的速度void Velocity ( Robot *robot, int vl, int vr ){ robotvelocityLeft = vl。//跟隨對(duì)方球員void Velocity ( Robot *robot, int vl, int vr )。//機(jī)器人向小球移動(dòng)方法void Defend ( Robot *robot, Environment *env, double low, double high )。void PredictBall ( Environment *env )。也就是我們的每個(gè)處理周期為1/60秒,在每次調(diào)用時(shí),系統(tǒng)通過(guò)Environment * env這個(gè)指針向我們傳遞當(dāng)前的系統(tǒng)的運(yùn)行信息,然后我們通過(guò)運(yùn)算,然后設(shè)置我方所有機(jī)器人的左右輪轉(zhuǎn)速,依此來(lái)控制機(jī)器人進(jìn)行足球比賽。 //當(dāng)前游戲的狀態(tài) long whosBall。 //我方機(jī)器人數(shù)組 OpponentRobot opponent[PLAYERS_P