Skip to content

AIWC Development Guide Python P3

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

Previous Page - Section 3 - Development Guide (Python) (2/3)


Section 3 - Player Program Development Guide (Python)

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

In AI World Cup, 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 to the method, a list of 10 float values should be provided. Each value corresponds to each robot’s left or right wheel’s velocity in m/s.

Robot Control Signal List
Index Data Type Description
[0] float Linear wheel velocity of GK's left wheel
[1] float Linear wheel velocity of GK's right wheel
[2] float Linear wheel velocity of D1's left wheel
[3] float Linear wheel velocity of D1's right wheel
[4] float Linear wheel velocity of D2's left wheel
[5] float Linear wheel velocity of D2's right wheel
[6] float Linear wheel velocity of F1's left wheel
[7] float Linear wheel velocity of F1's right wheel
[8] float Linear wheel velocity of F2's left wheel
[9] float 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 'set_comment()'. 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.py.

6) Report

An AI Reporter program can submit a report using method 'set_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 an array of strings. For actual usage, please refer to reporter_skeleton.py. 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 'set_report()' method multiple times.


END OF DOCUMENT

Return to AI World Cup Wiki Main Page