The Google Car simulator program is a simplistic take on the google self driving car. This is a rule based simulation program that attempts to drive a car around a track and keep in the right hand lane. The algorithm uses two rules to control the car. If the car is touching the white central road markings then it turns to the right, however if the car detects the edge of the road (any colour other than grey) it turns left back towards the centre of the road. The algorithm (rules) used are extremely simple compaired to the rules used by the Google Car, but the principle is the same. In reality the Google Car has to solve many more problems for example identifying and safely navigating around other road users (cars, lorries, busses, cyclists and pedestrians). The Google Car also needs to recognise and understand road junctions, traffic lights, road works and road signs and speed restrictions. Also note that the algorithm used here is "reactive" that is to say that the car turns AFTER it has detected an issue. For safey reasons a real life simulation (or the Google Car itself) would need to be "predictive" that is to say recognise any issues and take action BEFORE the event. After all its not much use to a pedestian if the car "correctly" turns away from them AFTER they have been hit by it! If you look at the scratch code for the blue car carefully you should be able to identify and recognise the two rules (if blocks) that control how the car turns. You should also be able to find two variables that control the speed of the car and the rate of turn. You could experiment by changing these values and look at the behavour of the car. You may also wish to try letting the car do several laps with the same parameters, is the behaviour of the car always the same in each lap?
Author: Tom Brough All artwork original of Author, generated using Inkscape.