# Embedded Bayesian Network Contribution for a Safe Mission Planning of Autonomous Vehicles
## 6 Discussion
### BN Parameter Issue
#### 6.1.2 BN Parameter Learning: GPS Case Study  
We simplify the GPS monitor shown in the Figure 19 because multiple error nodes can be negligible (like the troposphere and ionosphere errors) in modern GPS. Only the nodes corresponding to uncorrected errors are kept (see Figure 25). In addition to these nodes, the node \"nb_Satellite\" has been added. The nodes of the new BN GPS are:  
* H_GPS: represents the health of the GPS.
* H_S_GPS: represents the health of the GPS receiver.
* U_GPS: indicates the internal GPS type error node.
* S_GPS: represents the GPS receiver sensor.
* U_Multipath: indicates the multipath type error.
* S_Laser: laser sensor node.
* H_S_Laser: represents the health of of laser sensor.
* Nb_Satellite: indicates the number of the visible satellites.
* Altitude: indicates the altitude.
* Environment: represents the appearance context of multipath error.  
Before applying the EM algorithm and learning the BN parameters, we need a learning database which can be built by simulation, mission history report, etc. For the GPS case study, we collect some information about a user position around an area (example: building) at different times. We consider a few known positions as a reference path. The difference between the computed position (using smartphone for example) and the reference one represent the GPS position deviation.  
The information was collected at almost the same time over several days. The information recovered for each position located with GPSData application are: the latitude, the longitude and the altitude, the number of visible satellites and the accuracy of the position given by the GPS.  
Each information collected by the user at different time corresponds to a specific node of the GPS monitor. Now, the collected data can be interpreted and transformed into BN data:  
* Altitude correspond to 'altitude' node.
* Deviation correspond to 'H_GPS' node.
* Distance correspond to 'S_laser' node.
* Satellite correspond to 'nb_satellite' node.
* Accuracy correspond to 'S_GPS' node.  
According to the value of the collected data and the fixed threshold for each node status of the GPS monitor. Thus, the data correspond to one of status of the corresponding BN node (interpreted as evidence). Table 8 shows how to interpret the real data into BN data.  
Once the database of the observed data for each node is built, we can perform the EM algorithm to learn the BN parameters which is the CPT probability values. The idea here is to compare the accuracy of the GPS position obtained with different collected database, with the reference one. Figure 26 shows the reference path (known position in red) around a building. Figure 27 shows the different paths (resulting from GPS positions) obtained by applying EM with different databases built from he collected data. In comparison with the reference path (in red on the figure), we can show that the accuracy of the GPS position varies according to the variation of the collected raw data and the rate of missing  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Collected Data** & **Corresponding BN Node Status** \\ \hline Deviation \textgreater{} 3 m & H\_GPS = not\_ok \\ Distance \textgreater{} 10 & S\_laser = not\_ok \\ Accuracy \textgreater{} 3 & S\_GPS = not\_ok \\ Altitude \textgreater{} 40 m & Altitude = high \\ Nb\_satellite \textgreater{} 4 & Nb\_satellite = sup4 \\ \hline \hline \end{tabular}
\end{table}
Table 8: Interpretation of raw data into BN node status.  
Figure 25: BN GPS used for the parameters learning.  
values in the database. In this case study, the parameters of all the BN nodes are learned with EM algorithm. The complexity of this approach varies according to the number of nodes and the conditional dependence. To deal with this, we can just learn the parameters of the pertinent nodes like the sensors nodes and the appearance context nodes using EM with another kind of inference mechanism [39].