**1. Introduction**

In 2018, there were 102,299 tra ffic accidents with victims in Spain, with 1806 people losing their lives [1]. Most of these accidents happened in cities. Distractions were the main cause of fatal accidents at 32%, speed was at 22% and alcohol or drug consumption was at 21%. Most accidents are due to human error [2,3]. Other factors such as the environment or the vehicle involve less hazard [4].

In the literature, we find many works that evaluate driving performance and the drivers' physiological and cognitive states [5,6]. For example, in [5], the authors proposed a method to determine a driver's relative stress level based on analyzing physiological data and artificial intelligence. Twenty-four drivers participated in the experiment. The authors monitored the participants in real driving for at least 50 min. The results showed that the conductivity of the skin and the pulse metrics are those that most correlate with the level of stress. In [6], the changes in the muscles of the shoulder and the neck were analyzed while the participant drove in a driving simulator. Professional and non-professional drivers participated in the study. The conclusions were that, in both cases, the drivers

su ffered from fatigue after driving for 15 min. Many researchers have found a strong relationship between emotions and tra ffic accidents. Researchers in [7] conducted a cluster analysis on responses to a survey by more than 1500 college students about potentially annoying driving-related situations. The authors noted that men were more angered by the police presence and slow driving. On the other hand, women were more angered by illegal behavior and obstructions. Finally, they concluded that knowing the driver's anger could be of grea<sup>t</sup> help in reducing tra ffic accidents. Negative emotions, such as fear, anger, disgust or sadness, increase the probability of manifesting dangerous behaviors while driving. In [8], the authors analyzed the influence of mood on risk perception and attitude. The authors conducted an experiment where they induced di fferent emotions in the driver by watching videos. The results showed that negative emotions significantly increase the perception of risk by the driver, but also cause an inappropriate attitude. In [9], the authors focused on studying how sadness affects driving performance. Sixteen drivers participated in the experiment. They used a driving simulator. The results showed that drivers with sadness make more driving mistakes than neutral drivers. Furthermore, the driving times is also longer. In [10], the authors explore the use of a ffective interfaces in vehicles. The researchers conducted an online survey on emotional situations on the road. The results showed that drivers who experienced negative situations require better information managemen<sup>t</sup> and a high degree of automation. In contrast, drivers with positive emotions prefer a more genuine driving mode.

The state of the interior of the vehicle is another factor to consider. Other aspects such as the number of occupants in the vehicle or adequate ventilation should also be taken into account. It has been shown that a high concentration of CO2 decreases cognitive ability and increases fatigue. In [11], the authors analyzed the performance in a cognitive test when the participants were exposed to di fferent levels of CO2. Participants obtained significantly better cognitive scores when the CO2 level was lower than 1400 ppm. Similar results were obtained in [12]. In this work, the researchers analyzed the e ffects of CO2 on decision making. Twenty-two people participated in the experiment who took a decision-making test. In addition, the participants also filled out a questionnaire about their health and perceived air quality. The authors found that there was a moderate worsening of decision-making performance at 1000 ppm of CO2.

Autonomous vehicles could be a solution to reduce tra ffic accidents caused by human errors. However, on the one hand, these solutions still have a high cost and are not accurate enough [13]. In addition, in most countries, there are still no laws or regulations for this type of vehicle [14,15]. On the other hand, the autonomous vehicles that have been developed to date require that the driver maintain attention on the road and if an exceptional event takes place, he or she must take control. The first accidents have already occurred due to a lack of attention and the need for traditional and autonomous vehicles to coexist. In [16], the author used a Tesla Model S vehicle for six months. In this article, he analyzed the problems that these vehicles present for the driver in real driving conditions. The researcher points out that these vehicles can improve safety and driving comfort, but also can present challenges due to the transition between automatic and manual driving mode. Finally, a series of guidelines are proposed to improve the way in which this type of vehicle interacts with the driver. Reducing human errors while driving remains a significant concern.

The emotions experienced by the driver can be caused by events that occur during the driving task or before. In [17], McMurray analyzed driving reports. The researcher concluded that drivers who were in the process of a divorce had a higher probability of su ffering tra ffic accidents and violating tra ffic rules than other drivers. Similar results were obtained by [18], where the authors examined how stressful environments and psychological characteristics of the driver a ffect driving behavior. The results showed that stress significantly increases the risk of tra ffic accidents. The researchers also highlighted the importance of experiential knowledge acquired without instruction to present good driving behavior. In [19], the authors found that financial problems increase the likelihood of su ffering a tra ffic accident. Therefore, events unrelated to the driving task influence stress and driving skills.

Many of the works that analyze the driver's mental state and its effect on driving are based on artificially inducing a certain emotion using music, images or words [20]. For example, in [21], the researchers studied the effect of joy, sadness and anger on driving behavior using induced emotions. The results showed that negative emotions cause dangerous driving behaviors. The authors also observed that, in some cases, the emotional state did not affect driving when the workload was high. In [22], the authors conducted an experiment where participants were induced with sadness, anger or neutral emotions. Participants with induced anger or sadness made more driving mistakes than participants induced with neutral emotions.

Originally, the works that analyzed drivers' emotions used subjective measures [7]. These methods require the direct intervention of the participant. Therefore, the samples are obtained at a low rate. In recent years, the psychological methods have become less expensive and intrusive due to wearables. These devices allow us to monitor the driver continuously and without requiring his direct involvement. [23]. During driving, the use of non-intrusive devices is essential so as not to affect driving performance or cause safety problems [24,25]. In [26], we can find a review of the solutions to monitor a driver's psychological state.
