# TAKEN: A Traffic Knowledge-Based Navigation System for Connected and Autonomous Vehicles
## 3 TAKEN-Traffic Knowledge-Based Navigation for CAVs
### Traffic Knowledge Generation-Analysis Module
#### 3.1.1 Waypoints and Velocity Generator  
The lateral and the longitudinal dynamics of the vehicle defines the steering angle and the throttle position respectively. Constrained with different forces/attributes such as the slip, radial forces, friction, centrifugal force, the aerodynamics and the banking of the road, the main goal of the lateral controller is to follow a predefined path such that the resultant (cross-track) error is minimised and that of the longitudinal controller is to maintain the reference velocity. The Stanley controller [7], a type of geometric controller, is used to model the lateral dynamics of the vehicle. \[\delta(t)=\Psi(t)+\frac{(k*e(t))}{v(t)},\delta(t)\in[\delta min,\delta max] \tag{1}\]  
Equation (1) [24] gives the corrected steering angle for the current time step. The controller, given by equation 1 combines the following requirements: elimination of heading error relative to the path, \(\Psi(t)\), elimination of the cross-track error e(t) and clipping of the resultant so that the steering angle lies between \([\delta min,\delta max]\), where \(\delta\)min and \(\delta\)max are extremities (usually symmetric about zero, selected by the designer), with velocity \(v(t)\) and some constant \(k\). On the other hand, the PID (Proportional-Integral-Derivative) controller [31] is used to define the longitudinal dynamics of the vehicle. \[u=k_{p}(v_{d}-v)+k_{i}\int_{0}^{t}(v_{d}-v)\mathrm{d}t+k_{d}\frac{d(v_{d}-v)} {\mathrm{d}t} \tag{2}\]  
Equation (2) represents the PID controller and is mathematically formulated by adding three terms dependent on the error function. These terms include a proportional term which is directly proportional to the error function, an integral term which is proportional to the integral of the error function and a derivative term which is proportional to the derivative of the error function. Here, the error function, \((v_{d}-v)\), is the difference between the desired speed (or desired velocity) and actual speed (or actual velocity). The pure gain term \(k_{p}\)  
Figure 1: Architecture of the proposed TAKEN system. scales the vehicle's acceleration, ensuring correct acceleration direction and magnitude. The integral term \(k_{i}\) signifies the removal of accumulated error and the derivative term \(k_{d}\) dampens the overshoot caused by the integral term. The output of the above equation is the corrected acceleration (or corrected velocity) that the system must apply to reach the desired speed (or desired velocity). These systems work only if there is a contiguous supply of information from sensors such as the GNSS and the wheel odometers without which it would be difficult for a self-driving agent to estimate its state in the environment. The performance of these systems depends heavily upon the hardware devices used to measure them. Typically, measuring devices are subjected to noise and the data captured by such a device are not accurate, making them unreliable. Methods such as least squares, recursive least squares and Kalman filters can be used in deriving such values as expressed in the book named, \"Optimal State Estimation: Kalman, Hoo, and Nonlinear Approaches\", by [PERSON] [32]. However, they fail to capture major malfunctioning of the device as a result of which the estimated states turn out to be misleading. The TAKEN system overcomes such issues and the problems of sensor failures by establishing an AI estimator whose job is to align itself with the dynamic controllers (lateral and longitudinal controllers) of the vehicle while they are functioning properly and estimate/predict the state when they are ineffective. Neural networks are universal approximators. The TAKEN system replaces the path information between two points (the source and the destination) with a deep neural network. The work samples appropriate coordinates between two points and feed them to the neural network as input and trains to predict the heading and the velocity of a vehicle at a point.