top of page

SIMULATION RESULTS

The proposed algorithm is written in MATLAB code and simulated with the MATLAB Application Driving Scenario Designer to visualize the algorithm outcome rather than on the Duckietown smart city.In the Driving Scenario Designer App, two roads (one vertical and one horizontal) are defined to overlap each other to characterize an intersection. Three cars A, B, and C are defined each with a route and a constant speed at 50 m/s. A watchtower at the center of the intersection is described with four camera sensors each one facing a road.

SIMULATIONRESULT.png

In the Birds Eye Plot, the camera vision can be seen in blue. The blue car is named as Car A, the orange is Car B, the yellow is Car C, and the purple square in the middle is the watchtower (ego car). In the algorithm, the car is detected in the zone if it is found approaching the intersection 15 units away from the watchtower (centre), until it enters the intersection (2 units from the centre) using the direction and the vehicle position. The following figure illustrates how the x and y coordinates of the vehicles are used for the detection of the vehicles within the zone, first it will check that the x and y coordinates are within the zone, then it will determine the direction of the car (entering the zone) through by comparing the current coordinates (xA,yA) with the previous coordinates (xAprev,yAprev). After the car detection, car prioritization part follows, first the distance of each car relevant to the watchtower is calculated using the distance formula, then the cars are prioritized from 1 to 3 corresponding to closest to farthest.

SIMULATIONRESULT2.png

In the scenario, the algorithm starts to work precisely at 6-time units, Car A is classified as priority 2 behind Car C (fist in the zone – priority 1), while Car B has not yet entered the zone. Then Car B will enter the zone and be classified as priority 3. As shown, the speed of cars of priority 2 and 3 are updated while car of priority 1 remains with no commands.

It is critical to mention that no cars needed to stop at the intersection (speed > 0), and that car of priority 3 (Car B) is far behind car of priority 2 (Car A) and so on ensuring comfortable riding, and no collision. The algorithm will only control the car speeds if they are in the zone, for example, after time = 11, when all vehicles leave the zone, the speeds snap right back to 50 m/s as defined previously. This means, if the code were to be implemented on real cars, the drivers will be in full control until they enter the zone, and when they leave the zone, they will gain back full control.

DEMO

bottom of page