Skip to content

AIWC Development Guide Cpp P3

Chansol Hong edited this page Aug 7, 2019 · 6 revisions

Previous Page - Section 3 - Development Guide (C++) (2/3)


Section 3 - Player Program Development Guide (C++)

In AI World Cup, the data provided by the simulation program are pre-modified in a way that you do not need to consider whether you are Team A or Team B. All coordinates and images are rotated by π and the robot marker colors are swapped to make your team Red and located on the left side of the field. You can always assume that your team is Red and located on the left side whether you are Team A or Team B, or whether it is first half or second half. In case of AI Commentator and AI Reporter, the data sent are identical to the data sent to Team A.

4) Robot Control Signal

The robots can move with two wheels attached on their sides (2-2 Soccer Robot Dimensions). The wheel control method ‘set_wheel()’ method can be called by the player program to request the simulation program to set the wheel velocities to desired values. As the input, the method takes an array of 10 double-precision floating-point values. Each value corresponds to each robot’s left or right wheel’s velocity in m/s.

Robot Control Signal Array
Index Data Type Description
[0] double Linear wheel velocity of GK's left wheel
[1] double Linear wheel velocity of GK's right wheel
[2] double Linear wheel velocity of D1's left wheel
[3] double Linear wheel velocity of D1's right wheel
[4] double Linear wheel velocity of D2's left wheel
[5] double Linear wheel velocity of D2's right wheel
[6] double Linear wheel velocity of F1's left wheel
[7] double Linear wheel velocity of F1's right wheel
[8] double Linear wheel velocity of F2's left wheel
[9] double Linear wheel velocity of F2's right wheel

Once the wheel velocities are requested, the simulator program keeps the same wheel velocities until one of followings happens:

① The player program sends a new set of wheel velocities. In this case, the wheel velocities are updated accordingly.

② The game enters in special states such as kick-off, corner kick, penalty kick and goal kick. In this case, the wheel velocities of all robots are set to zero. Then, the wheel velocities of the robot that is allowed to move in the state can be updated again when the special state begins. The wheel velocities of remaining robots can be updated again when the special state ends.

③ The robot is sent out from the field. In this case, that robot’s wheel velocities are set to zero. The wheel velocities can be updated again when the robot returns to the field.

5) Commentate

An AI Commentator program can send a comment using method 'commentate()'. The supervisor program will display recent 3 comments received from the AI Commentator program with timestamps attached. As the input, the method takes a string. For actual usage, please refer to commentator_skeleton.cpp.

6) Report

An AI Reporter program can submit a report using method 'report()'. At the end of the game, the supervisor will save the most recent report received from the AI Reporter in a text file. As the input, the method takes a vector of strings. For actual usage, please refer to reporter_skeleton.cpp. Since only the most recent report is taken into account, the AI Reporter only needs to submit a report once when the game is finished even though you may submit as many as reports by using 'report()' method multiple times.


END OF DOCUMENT

Return to AI World Cup Wiki Main Page