SAMPLE_TEAM.launcher_pb

The module is designed by team Robokit of Phystech Lyceum and team Starkit of MIPT under mentorship of Azer Babaev. The module is designed for strategy of soccer game by forward and goalkeeper.

Module Contents

Functions

init_gcreceiver(team, player, is_goalkeeper)

The function creates and object receiver of Game Controller messages. Game Controller messages are broadcasted to

player_super_cycle(falling, team_id, robot_color, player_number, SIMULATION, current_work_directory, robot, pause, logger)

The function is called player_super_cycle because during game player can change several roles. Each role

SAMPLE_TEAM.launcher_pb.init_gcreceiver(team, player, is_goalkeeper)[source]

The function creates and object receiver of Game Controller messages. Game Controller messages are broadcasted to teams and to referee. Format of messages can be seen in module gamestate.py. Messages from Game Controller contains Robot info, Team info and Game state info. usage of function:

object: receiver = init_gcreceiver(int: team, int: player, bool: is_goalkeeper)
team - number of team id. For junior competitions it is recommended to use unique id

for team in range 60 - 127

player - number of player displayed at his trunk is_goalkeeper - True if player is appointed to play role of goalkeeper

SAMPLE_TEAM.launcher_pb.player_super_cycle(falling, team_id, robot_color, player_number, SIMULATION, current_work_directory, robot, pause, logger)[source]

The function is called player_super_cycle because during game player can change several roles. Each role appointed to player put it into cycle connected to playing it’s role. Cycles of roles are defined in strategy.py module. player_super_cycle is cycle of cycles. For example player playing role of ‘forward’ can change role to ‘penalty_shooter’ after main times and extra times of game finished. In some situations you may decide to switch roles between forward player and goalkeeper. Usage:

player_super_cycle(object: falling, int: team_id, str: robot_color, int: player_number, int: SIMULATION,

Path_object: current_work_directory, object: robot, object: pause)

falling - class object which contains int: falling.Flag which is used to deliver information about falling from

low level logic to high level logic. falling.Flag can take 0 - nothing happend, 1 -falling on stomach, -1 - falling face up, 2 - falling to left, -2 - falling to right, 3 - exit from playing fase

team_id - can take value from 60 to 127 robot_color - can be ‘red’ or ‘blue’ player_number - can be from 1 to 5, with 1 to be assigned to goalkeeper SIMULATION - used for definition of simulation enviroment. value 4 is used for Webots simulation,

value 2 is used for playing in real robot

current_work_directory - is Path type object robot - object of class which is used for communication between robot model in simulation and controller

program. In case of external controller program ‘ProtoBuf’ communication manager is used. ‘ProtoBuf’ - is protocol developed by Google.

pause - object of class Pause which contains pause.Flag boolean variable. It is used to transfer pressing

pause button on player’s dashboard event to player’s high level logic.