processor board is an Atmel ATMega64 with 64k of flash memory and supports up to eight digital IO devices. The communications board is a Bluetooth Wireless bidirectional board transmitting in the 2.4GHz range over a distance of up to 100m and at a rate of 115kb/s.
3.3
Robot Soccer Engine
The Robot Soccer Engine (RSE) is a software package that was supplied by Merlin Sys- tems Corp. Ltd. and provides all the interfaces necessary to set up and control up to five individual Miabot Pro BT robots simultaneously. These include robot identification, pitch mapping and allocation of COM ports for the Bluetooth Comms package. The RSE starts and stops the robots and displays the image received from the attached camera whilst the robots are on the robot soccer pitch. As the name suggests it was primarily designed to enable micro robots to play robot soccer. The process that is used by the Robot Soccer Engine is as follows. The Robot Soccer Engine receives frame pictures from the camera via the Fire-i API. Each frame is processed by the ProcessImage routine, and current robot and ball positions are calculated. The ProcessImage routine passes RobotPositions to the User Defined Strategy routine. The User Defined Strategy is where MoveTo commands are calculated for each of the robots, according to the strategy loaded at the start of the game. When completed, the User Defined Strategy calls the Dispatcher rou- tine. The Dispatcher routine packages the commands into messages for each robot. The messages are then sent via the Bluetooth Comms package to the corresponding robots. The MoveTo messages are processed and actioned on the robots, so that the time spent in RSE processing is a minimum. This is shown in Figure 3.2. However in order to en- able the Robot Soccer Engine to control and report data from the practical experiments modifications and enhancements had to be made, over and above those made to get the Robot Soccer Engine to the FIRA competition standard. These included introducing stop watch facilities for timing events, a Bluetooth channel read utility, and writing data to a file for subsequent processing. Identification of individual robots was achieved by placing coloured caps on the top surface of the micro robots. In MiroSot matches the two teams
Command Image Pixels
FireWire
Robot Position Robot MoveTo Dispatcher
User Camera Robots Bluetooth Computer Process Image Strategy Defined
Figure 3.2: Robot Soccer Engine Overview
are identified by either a blue or a yellow colour on a cap. In order to run the practical experiments under the control of the Robot Soccer Engine all the robots had the same team colour caps. The actual team colour used was not important as the Robot Soccer Engine has a team colour definition option. Usually the team colour cap selected to run the practical experiments was the blue cap set. In the FIRA rules for robot soccer the ball has to be a standard golf ball coloured orange. However it is not a requirement that an individual player is required to be identified. If the players are identified, the identifying colours must not be blue, yellow or orange. The Robot Soccer Engine uses a set of caps which are labelled P1 - P5. These are colour coded so that the Robot Soccer Engine can identify each robot. A three colour Hue Saturation Intensity (HSI) system is used with
two different sized patch squares for each player. The large patch is 33mm2and the small
patch 23mm2. The team patch is the same size as the large patch. The Robot Soccer
Engine requires the team colours blue and yellow; and the player colours magenta, green and cyan, and the ball colour orange to be defined before the game starts. The actual hues are entered as ranges against the required colours. To complete the identification the minimum and maximum blob size in screen pixels for each patch must be entered into the Robot Soccer Engine. This is used to ensure that a colour patch has been correctly identi- fied. However the greater the range in the blob size, the slower the identification process. The reason for having a three blob identification system over a two blob system is that when the robots get close or collide they are still identifiable. In our practical experiments
3.3. Robot Soccer Engine 83
Player Large Small Role
P1 Green Green Goalkeeper
P2 Cyan Cyan Defender
P3 Magenta Magenta Left
P4 Magenta Cyan Right
P5 Cyan Magenta Attacker
Table 3.1: Player Identification and Role
Colour Hue Sat
Blue 144 120
Yellow 40 240
Magenta 200 240
Green 96 120
Cyan 120 120
Table 3.2: Colour Definition at Intensity of 120
the loss or swapping of identity rarely occurred and was quickly corrected if it did. During a game the Robot Soccer Engine provides information about each player on the camera image screen. This is a confidence measure of the identity of a player. The range is 0-99 where 99 is the most confident prediction of identity. Whilst a game is being played the values reported are about 80. The player identification is given in Table 3.1.
In order to determine the most recognisable blob colours for the Robot Soccer Engine image processing system, a series of experiments were carried out. A set of colour charts of small patch (23mm x 23mm) squares were printed out on a colour printer. The colours were generated for Hue within Saturation within Intensity. Only two Intensity values of 120 and 136 where used. The Saturations used were 60 - 360 in steps of 60. The Hues were 8 - 360 in steps of 8. The colour chart blobs were labelled on the back with their HSI values. The charts were then cut up into blobs and then put under the cameras and the Hue values read off using the camera image screen. Various camera aperture settings were tested, and the most robust colour values are given in Table 3.2. Two sets of five player identification caps were then generated according to the colour combinations in Table 3.1, one set for the Blue team and the other set for the Yellow team. The player cap for the Blue team goalkeeper, Player P1, is shown in Figure 3.3. The RSE requires the pitch to be defined on the camera image screen. The user clicks on the corners of the pitch
Figure 3.3: Robot Player Caps
image from which the corner pixel values are obtained. This frames the pitch in terms of the camera image. The position of the robots within the pitch can then be calculated by the Robot Soccer Engine image processor. Within the User Defined Strategy, the pitch is held in a pitch array of dimension 80 x 100, giving a coverage of 22.5mm x 22mm per pitch element. Whilst working on pitch definition it was discovered that the cameras did not have lens spherical aberration correction. Further investigation showed that there was no parallax correction for the micro robots. This had minimal effect at the centre of the pitch, but in the goal area the error was about 42mm, or over half the micro robots body. I modified the Robot Soccer Engine to handle both these issues.
The Robot Soccer Engine image processor sub system scans the latest camera frame and detects the location of the coloured blobs in the image. The centre of each blob is calculated and then grouped according to the blob colours defined for each player. If the centres lie within a given distance and correspond to a known player colour configuration the three blob image is given a player number. The centre of the player is then calculated. The surface containing the charging port is considered to be the back of the micro robot and the small blob is always placed above it on the cap. The angle that the centre of the small blob makes to the centre of the robot in pitch axes determines the orientation of the micro robot. The whole image is scanned and all the home team robots are located and their orientations found within the previously defined pitch. The x,y positions of the robots are reported to the other subsystems in units of millimetre and the orientation is in degrees. If the Robot Soccer Engine is being used in a competitive match, the position of the ball is calculated as is the position of the opposing team. If a non Robot Soccer Engine cap system is used then only the mandatory team blob is available and this is taken to be the centre of the opposition robot.
3.3. Robot Soccer Engine 85 With the Robot Soccer Engine application running on the computer, by turning the micro robot on a Bluetooth COMMs channel is allocated to the robot. For each active robot, the COM port number of the micro robot is entered against the player number. There is a facility on the Robot Soccer Engine to test that the allocation of the robot player is correct, by rotating the robot that the COM port is connected to.
The final feature of the Robot Soccer Engine is a facility to alter the motor character- istics of the micro robots by changing the internal PID controller parameters. The PID controller operates on the error between the Robot Soccer Engines demanded wheel ve- locity and the actual wheel velocity of the robot. The PID values can only be changed when the robots are not being controlled by the Robot Soccer Engine. Also the PID pa- rameters are applied to all of the robots. This reduces the facility as the Goalkeeper is required to have a very fast response time when under attack, due to the small distances between it and the ball. This is usually achieved by having a very high Integral action parameter and a different Proportion value. Consequently the Goalkeeper robot has to have these values loaded separately.
The Robot Soccer Engine has a predefined hook to access a file called strategy.dll. The strategy.dll is generated from a C++ Strategy project file that contains strategy.cpp. The strategy.cpp file contains all the commands that the user has programmed to control the robots. Within the Strategy project file is the movement.cpp file that contains all the primitive commands that were programmed to move the robot. By using the primitives from the strategy.cpp the user can generate an infinite number of strategies using from one to five robots simultaneously.
However during the experiments various problems were encounted and solved. Ini- tially the laboratory was equipped with venetian blinds. We found that the Robot Soccer Engine could not locate the robots and they went out of control, characterised by a high- speed spin. The problem was resolved by using blackout curtains to exclude external light, and installing strip lighting above the pitch to provide an even and consistent light source at the surface of the pitch. After this was done the problem did not manifest itself. After running the Robot Soccer Engine for a series of ten soccer games each lasting for 10 minutes, it was observed that the team which was using the MicroPix Firewire C640 camera won more games than the team using the MicroPix Firewire C1024 camera by
six to two with two drawn. The teams were swapped over in a second series of games again the team using the MicroPix Firewire C640 camera won more games, by seven to one with two drawn. The conclusion that was drawn is that the camera with the faster frame rate enabled a better performance to be obtained from the team it was controlling. So it was decided that the MicroPix Firewire C640 camera would be used in preference to the MicroPix Firewire C1024 camera when conducting experiments and competitions involving a single team. Over the series of games the robots sustained a high level of damage due to collisions. Tyres were thrown off or got jammed between the wheel and the chassis. The main axles became loose and wheels fell off. This lead to improvements being made in the design and manufacture process, such as stub axles being introduced and tighter tyres being used. There was no damage sustained by the robot electronics, however some of the battery connections became loose and turned off one of the motors so the robot went round in a circle.