# Road Traffic Gesture Autonomous Integrity Monitoring Using Fuzzy Logic
## 4 System Design Methodology  
The Road Traffic Gesture Autonomous Integrity Monitoring system is an in-vehicle traffic light system. It obtains on-board GPS sensor data (Figure 2) and broadcasts them to nearby cars in a self-organizing vehicular network at a four-legged intersection. The vehicular network is built on ESP32 microcontrollers and uses the ESPNow broadcast feature to share data. To enhance location classification, each microcontroller is assigned the registration number of the vehicle hosting it. The data received are fed to a fuzzy inference system that determines the relative position of each decelerating or stopped vehicle at the intersection. Three of the cars then vote for one vehicle to leave without the use of gestures. All the microcontrollers operate under the same program. Each microcontroller has an embedded unique Media Access Control (MAC) address and is able to broadcast its assigned vehicle registration number, its location coordinates, and the MAC address itself within a 250 m radius. Such data are then used to determine the relative positions at the intersection of all vehicles converging on the northern, western, southern, and eastern lanes. In a manner similar to how human drivers in a gridlock at an intersection use gestures to indicate to cars on one lane to proceed, a voting scheme will be employed to manage the flow of traffic in that lane. The dispersion is based on control signals that are sent to three pins, namely, the _standby_ pin, the _brake_ pin, and the _throttle_ pin. Since a car cannot accelerate and brake simultaneously, only a single pin is activated at a time. In other words, when the _digitalwrite_ signal is high on the brake pin, _digitalwrite_ goes low on the throttle pin. The placement of a traffic control device should ensure adequate visibility in the road user's view. Provisions made for a human driver on the dashboard include a _red_ light for movement prohibition, a _yellow_ light for caution, and a _green_ light for permission to move. This guarantees that the human driver notices a red light when the _brake_ pin is activated and a green light when the _throttle_ pin is activated, with both signals operating  
Figure 2: Priority assignment sequence. intermittently. Meanwhile, the autonomous vehicle can either come to a stop when the _digitalwrite_ signal on the _brake_ pin is high or proceed smoothly through a junction when the _digitalwrite_ signal on the _throttle_ pin is high. Light-Emitting Diodes (LEDs) are cheap, energy efficient, and long-lasting and can easily be incorporated into the instrument cluster panel of a road vehicle, bringing the traffic light closer to the driver. The lights can also be accompanied by audible messages and vibration of the driver's seat to draw attention to traffic flow, an advantage which the current infrastructure-based traffic control devices cannot provide the driving and riding public. A road lane of 4 m width having an orthogonal fillet radius of 2 m was used with an average car length of 4 m. The width of each car, represented by a rectangle in Figure 3, was also set at 2 m. The AutoCAD2023 software used for the design layout supports the use of real-world units. Mutual characteristics between pairs of node location coordinates were used to establish 32 fuzzy rules for the relative position classification at the intersection. Since a trailing node could be shifted slightly to the left or right behind a leading node, Back1 and Back2 membership functions were introduced to account for such discrepancies. Four output variables were defined for the fuzzy model, each having four membership functions. Four input variables have also been determined for the fuzzy model (Table 1). Each of the four quadrants of the Cartesian coordinate system was divided into two, resulting in eight sub-quadrant linguistic values (Q1,..., Q8) assigned to the angle variable. The distance variable has three linguistic values: short, medium, and long.