Rules

Changes

For a quick run-down of the changes from the Winter 2016 rules to the current rules check out our blog post: Updates to the rules for the Summer 2017 series.

The Competition

The Formula Pi series is an autonomous robotics competition based around the Raspberry Pi. There are different classes which involve different programming skills and a wide range of ages. It aims to advance autonomous robotics and to give a fun and challenging competition that improves coding and STEM education.

The competition will be split into two classes which will be run along side each other for this season. The main class is named the Formula Pi - Grand Pi class, this uses our older YetiBorg equipped with a Raspberry Pi Zero. The new faster class is named the Formula Pi - Monster class, which uses our new MonsterBorg equipped with a Raspberry Pi 3.

Both competitions use club robots, which are robots that we own and maintain. You cannot use your own robot in the Grand Pi or Monster competition as we want to make sure each robot is evenly matched.

Competitors write code and submit code to be run on the club robots for the competition. Code may be sent from anywhere in the world via either our ftp site, or by sending an SD-card via traditional mail.

The testing and racing will be live streamed for all people to view. The live stream will also be viewable after the event on YouTube.

There are deadlines as to when we need to have received the code for it to be used in the racing. The summer season starts April for testing and ends July. Winter season starts October for testing, and finishes January. Please see the Formula Pi Winter and Summer series competition dates for more details on event dates.

Cost to enter either competition for one season is £37 + shipping which includes a YetiLid. Last entry for the summer season is 30th April. Last entry date is 31st October for the winter season.

With a paid entry, you will be supplied with a competitor number with a YetiLid. The YetiLid will include a number to stick on, this number should be clearly displayed on the number section of the lid so we can identify the robots as they cross the start/finish. The remainder of the YetiLid you may decorate as you like, however, offensive, political, religious or tasteless messages will not be used and we may replace your lid with a sponsors' lid.

Do not decorate or mark the number section except with your competitor number. You must supply both the code and the YetiLid to race. Entry fees must be paid to race.

If you have not supplied us with your decorated YetiLid, but we do have your code, we may:

  1. Not run your entry at all
  2. Run your entry with one of our standard lids
  3. Place a sponsors' lids on your designated robot

Race Classes

At the moment there are two classes in Formula Pi. Both classes share the same rules, just using different robots. The Formula Pi is a set of timed races judged by laps completed. In the future we may add additional classes.

Class Pi Model Battery Controller Motors Other
Grand Pi
10 minutes
Pi Zero 9V PP3 ZeroBorg 4x 180 rpm Uses house robots only. Winners code released each year Winners Trophy and prizes.
Monster
10 minutes
Pi 3 10x 1.2V AAs ThunderBorg 4x 300 rpm Uses house robots only. Winners code released each year Winners Trophy and prizes.

The top 10 competitors will be given red numbers instead of black if they compete in the next season's competition.

The track

The first track for the series will be the PiBorg circuit, which is approximately 22m (72ft) long. On the edges of the track are rubber skirting - approx. 100mm (4") high, and is approx. 150mm (6") high in places. The rubber is 10mm (~3/8") thick to absorb impacts. The width of the track is ~2.4m (8ft). The track is separated into 6 lanes of approximately 305mm (12") wide, in a particular colour sequence.

In clockwise driving orientation, the ordering is from left to right with respect to the camera view: Red, Blue, Red, Green, Blue, Green. Normal orientation will be clockwise for the series, although there may be specialty races in the opposite direction.

The start bays are placed on the transition between colours. At starting time, all robots are to be within these start bays, and facing directly forwards. It is not permitted to angle the robots at start.

The timing is via a Laser and a diode at the start finish line. There is also a camera at the start line to be used for control of jump starts.

The stop/go instruction is via 5x20mm Red and 5x20mm Green LEDs. These LED's are approximately 1.8m (6ft) forward of the start line and are pointed directly at the front of the start bays, to enable maximum exposure on the Pi Camera. The lighting sequence will be Green, held for at least 5 seconds, then Red, held for randomly between 2 seconds and 30 seconds, then Green again. At the second green event, the race is live and it is permitted for the robots to begin racing.

Live broadcast

The series will be covered with our video cameras, and the stream will be available to watch online both live and at a later date. There will be a live commentary, so information about you/your team/strategy should be sent with the registration document.

The Robots

We will supply the robots for both the Grand Pi and Monster competitions. The robots in each class have approximately equal speeds, torque, turning abilities and friction.

They will be calibrated by the following methods.

  • On a fresh battery, we will record the time taken from two points in the track across a laser timing rig. The ZeroBorgs and ThunderBorgs we are using will have slightly altered PIC code, which allows us to set the maximum power level. This will be dropped down to the point where the top speed matches a pre-determined value. When the ZeroBorg or ThunderBorg is commanded to 100% over I2C, it will put the motors to this calibrated power level.
  • Drive on all 4 wheels will be set to 100%. The deviation from a straight line will be recorded over 10m. If the deviation is more than a pre-determined value, the robot will be mechanically altered to rectify.
  • The camera will take an image of a grid in front of it. If the image deviates by more than a pre-determined value, the camera position will be altered.
  • The batteries are kept as a matched set. They will be tested from time to time. If there is a deviation in batteries by more than a pre-determined value, it will be replaced with an equivalent performing battery.

Each YetiBorg has a Raspberry Pi Zero V2, a V2 Raspberry Pi Camera, a ZeroBorg KS2 soldered, 4x 180 rpm motors and four large wheels, their house batteries will be POWEREX 300 mAh PP3.

Each MonsterBorg has a Raspberry Pi 3, a V2 Raspberry Pi Camera, a ThunderBorg with ThunderBorg Lid, 4x 300 rpm motors and four giant wheels, their house batteries will be 10x GP 2700 AAs.

The robots will not have any WiFi / Bluetooth/ internet connection. All code must come from the SD card.

The only data input allowed is that of the Raspberry Pi camera. However any data seen by the camera may be used in any way you see fit.

Race formats

Testing

There will be a total of six testing rounds throughout the season:

  • An early testing round first
  • One before each race round
  • One before finals week for the top ten in each class

Each testing round will consist of:

  1. A single entry robot starting in the central lane
  2. Two minutes boot-up time before the lights
  3. Standard race lights sequence
  4. Lap timer as used in the elimination heats
  5. Two minutes of running time

You will be able to see how your designated robot reacts to the lights and how it runs around the track. You cannot submit code updates or values to tweak live. No results from the testing round are used in the competition. This is purely for your own testing and validation purposes. To participate in a testing round you must submit new code before the round's submission deadline on the Friday before.

Heats

The heats have a point scoring system which rewards consistency. For example, a result in the first two heats of 1st and 5th is less points than 2nd and 4th, which is less points than 3rd and 3rd.

There will be four heats. Each heat will run as a 10 minute race between five robots. If all five robots are deemed unable to move, the race is declared stopped. Positions are taken from the number of laps completed and the order in which they crossed the line.

Points for each heat are awarded as following:

First place: 15 points
Second place: 14 points
Third place: 11 points
Fourth place: 7 points
Fifth place: 2 points (at least 5 laps completed)
Single lap completed: 1 point
Not completed a single lap/jumped start: 0 points.

Both the position and total laps completed will be recorded, and from this information, a leaderboard will be generated based on firstly the total amount of points, and then based on completed laps from all heats.

Here is an example of the leaderboard:

Leaderboard position Competitor number Points Laps
1 52 75 50
2 13 75 48
3 5 69 49
4 22 69 45
5 3 62 51
6 12 62 43
7 7 62 41
8 2 60 41
9 21 59 38
10 11 59 36
11 1 59 35
12 9 59 33
13 16 57 34
... ... ... ...

In the event of a mechanical failure in heats:

  1. The stewards may choose to ignore the mechanically failing competitors result and place the competitor into another heat (OR)
  2. The stewards may choose to award points based on the following criteria
    1. Higher points for better avoidance of crashes
    2. Higher points for better handling performance and recovery
    3. Points proportional to expected positions
    4. Points proportional to running position before the failure
    5. Performance in previous heats may be taken into consideration

Whether there was a mechanical failure or not is determined entirely by the stewards. Stewards' decisions are final.

To participate in a race round you must submit new code before the round's submission deadline on the Friday before. We will not run the previously submitted code from other rounds so make sure you submit your code before each race week!

Elimination rounds

The elimination rounds have a scoring system which favours fastest average lap speeds

The top ten competitors from the heats leaderboard will be shuffled and will compete in one of two separate 10 lap (or up to 6 minutes) races called elimination rounds. In these rounds, points are not awarded, instead the best 7 lap times are added together to give a total.

In the event of a mechanical failure in elimination rounds or finals, no compensation will be awarded. If less than 7 laps were completed successfully 60 seconds will be added for each missing lap time. These lap times will be combined to give the elimination round results. The top five competitors will compete in the final.

The alloted 6 minutes will start from lights "GO". The first lap time is determined as the amount of time from the initial crossing of the start line to the next crossing the start line having completed a full lap in the correct direction. Subsequent laps are crossing to crossing in the correct direction.

To participate in the eliminations you must submit new code before the round's submission deadline on the Friday before. We will not run the previously submitted code from other rounds so make sure you submit your code before each finals week if you are in the top ten!

Here is an example of the elimination rounds leaderboard:

Leaderboard position Competitor number Points Total of 7 fastest laps
1 3 NA 216.3
2 21 NA 218.3
3 11 NA 218.4
4 22 NA 219.9
5 52 NA 220.2
6 13 NA 220.3
7 12 NA 221.2
8 7 NA 224.3
9 2 NA 224.5
10 5 NA 230.2

Final

The final has a format which favours aggressive strategies
The final will be a race of 10 minutes total. The competitor with the most laps completed without jumping the start will win. If two or more teams get the same number of laps they will be placed in the order in which they last crossed the line.

The finals will use the same code as submitted for the elimination rounds. In the event of a mechanical failure in elimination rounds or finals, no compensation will be awarded.

The top three from each final will receive a place on our wall of fame and some other prizes. It may be required to pay Taxes on prizes, please check with your tax authority.

Code

Submitting code

Each competitor is required to submit new code by the code submission deadlines before every race / elimination. These deadlines can be found in the event dates page of the website. The code submitted for the eliminations will be used for the finals as well.

Each competitor is given space on the FTP server which has a name which corresponds to their competitor number. It is required that code be on the FTP site, or a physical SD card be received by the code submission dates. If there is no uploaded code on the FTP by the submission deadline (prior Friday 12:00 GMT), you will forfeit that race.

The code you wish to be run should be uploaded as a standard .tar.gz file to formulapi.tar.gz at the top of your FTP access. Only this file will be downloaded and extracted to the robot. For custom SD cards this will be used to overwrite the previous /home/pi/formulapi directory, it may be an empty .tar.gz format file if no changes are required from the last run.

We have provided a convenience script (fpi-upload.sh) which can perform both the compression and FTP uploading when provided with your competitor number and FTP password. For example if your team number is 99 and your assigned password is pass1234 you can upload your code using these commands:

cd ~/formulapi
./fpi-upload.sh 99 pass1234

Alternatively you can use these commands to create a suitable compressed file:

cd ~/formulapi
tar -czvf formulapi.tar.gz

This file should then be uploaded to our FTP server using the ftp command in binary mode or any FTP client which supports binary transfers. ASCII transfers are NOT suitable and will likely corrupt the file!

To run in a testing round you must submit new code to the FTP by the submission deadline the week before the round. This includes those running custom SD cards.

In all cases you new code submission may be identical to the previous submission, it just has to be submitted on the week before the relevant round by the submission deadline.

Code requirements

Before the race, the competitors zipped code from the /home/pi/formulapi directory will be copied from the FTP site on to a house SD card. (Alternatively, if you have supplied a physical SD card, it will be used). This will be entered into the Raspberry Pi Zero or Raspberry Pi 3.

The standard SD card image will start up and automatically run the /home/pi/formulapi/Formula.py script. This means that if you are using the FTP uploading option then a script named "Formula.py" must be part of the included code. You may use other programming languages and use the script to run a non-python program if you prefer.

Formula Pi code must be well documented. Obscuring how the code works may be deemed not in the spirit of the competition, and may result in disqualification.

Please note if your software does not run on our standard SD card image, we must receive an SD card with your code by traditional mail before the code submission deadline. Updates to the /home/pi/formulapi directory must be submitted before each submission deadline as well, although the file may be empty (no changes).

Receiving log files

It is possible for us to place log files back in the ftp folder after a run. This might be useful if you want to check via diagnostics what your robot was trying to achieve. There are limits to the size of the log file.

If you are using your own logging code please ensure any log files are stored in /home/pi/formulapi/logs. Only files stored in this folder will be uploaded to the FTP site. The logs folder will be uploaded as a single zip file with the current date as the file name.

Power up sequence

The SD card with the competitor's code will be inserted into a random club robot. A randomly selected charged battery will be put into the robot. The Robot will be placed on to a random lane of the track which will not be known by the competitor until viewed during the race.

Switching on is done in the order the steward decides. Each robot is to boot and wait until it can see the transition from lights off to lights green. The stewards will wait approximately 2 minutes for the Pi to boot, before attempting to change light states.

MonsterBorgs are required to display their assigned colour using the on-board LEDs when they are ready for the lights to show which team is running. This will be saved as a RGB triple (such as 1, 1, 0) into /colour.txt. The standard code will do this by default.

The lights will go through this sequence to start the race: Off, Green, Red, Green. The race is declared GO on the second Green. If a robot does not go, the stewards may or may not toggle the lights in all configurations to try and get the robot moving.

The time duration between lights off to lights on, lights green to lights red, and lights red to lights green is random. If the robot moves past the start position before the final transition from Red to Green, the robot is declared to have jumped the start and will be awarded 0 points for that heat or final.

If the robot does not move based on the lights alone, it will not be aided and will become a blockage for other competitors. No points will be awarded if the robot does not complete at least one lap, even if other competitors also do not move.

Once the race is "GO", the lights are not of significance and may be in the Green, Red or Off state.

FAQ's

Why do I need to share my code for Formula Pi?

A main aim of the event is to better the understanding and design of autonomous vehicles. The winner's code is shared at the end of the race, so the competition improves each time it is run.

Can I send my own vehicle?

No. Each robot is calibrated and matched to other robots to make sure they compete equally. We might allow custom robots in future series.

Can I test my robot on the track?

No. We have more testing rounds than race rounds which should provide a reasonable amount of test time for each team. Code can be tested prior to these using the simulator provided with the race code.

Why do the MonsterBorg entries need to show a colour?

We need this to see which entry is which when the robots run upside-down. On the YetiBorgs we have fixed a coloured plate and on the MonsterBorgs it is shown using the LEDs. The LEDs have the advantage of being visible from other angles as well, making each entry clearer in some of the camera angles.

Anti Cheating rules

The series wants to promote ingenuity and alternative approaches to racing. However these must be in the spirit of competition. Any strategy deemed to be cheating from the view of the stewards may result in expulsion from the competition without any compensation or reward. Cheating could include inhibiting other vehicles driving through means other than normal racing and rubbing of the vehicle.

Examples of this type of cheating includes but is not limited to immediately trying to attack other vehicles and running around the track backwards intentionally. If in doubt, please email the stewards to check.

Some other examples:

  • Gently pushing an opponent into a wall is permitted.
  • Turning around and head on crashing into other vehicles is considered cheating
  • Intentionally stopping to restrict a vehicle behind is not viewed as the spirit of racing, and may result in disqualification. This will be up to the judgement of the stewards.
  • Using the ThunderBorg LEDs for something other than displaying the assigned colour for the race

The above rules are subject to change.