## Appendix A Cooperative Pilot
### Prediction of Speed Profiles and Trajectories for the Ego-Vehicle  
Once the trajectories of real and \"ghost\" objects have been predicted, we must now calculate the safe speed profiles which comply with the rules listed above for the ego-vehicle (0) and for the three traffic lanes (A-C). These speed profiles for the ego-vehicle must meet the constraints of intelligent speed adaptation and safe inter-distances keeping. The computation of the reachable trajectories by the ego-vehicle is strongly based on the use of a module of environment perception (mainly the detection and tracking of obstacles and traffic lanes and road marking detection) and on the prediction of the object's trajectory already presented in the previous section. In the existing literature on trajectory planning, two main types of algorithms exist: \"sampling-based\" algorithms and direct algorithms [79]. \"Sampling-based\" algorithms such as \"sampling-based roadmap\", RRT algorithms or grid-based algorithms (space discretization) allow a universal approach by first generating random samples in the space of the trajectories, then evaluating these [40]. Direct algorithms, such as algorithms based on expert systems, potential or control fields, offer an application-specific approach that directly takes into account all the driving aspects in the generation of a trajectory, without the need for an assessment step. Direct algorithms find more optimal solutions and require fewer calculations than \"sampling-based\" algorithms. \"Sampling-based\" algorithms solve complex problems that direct algorithms are struggling to solve. A recent overview of these methods is presented in [80]. In our case, the \"safe decision\" module (from a traffic rule point of view) combines direct trajectory planning and a \"sampling-based\" algorithm. The \"direct calculations\" part is used for longitudinal maneuvers and for calculating the speed profiles of the ego-vehicle. The direct calculations are simple and accurate in the case of the use of continuous variables, such as the longitudinal speed from zero to the maximum speed, or the longitudinal acceleration going from extreme braking to strong acceleration. Calculations using the \"sampling-based\" approach are used for lateral maneuvers, which are discrete by nature. This is mainly due to the structure of the traffic lanes. In the current implementation ofthe decision module, only the trajectories centered towards the middle of the lanes are calculated. Figure 14 shows the generation of 7 possible speed profiles for the ego-vehicle, both longitudinal and lateral. These profiles are broken down into 3 categories. * The first corresponds to normal vehicle operation (0A, 0B, 0C). * The second takes into account the singular situations of breakdown and failure of an ego-vehicle embedded system (FA, FB, FC). The safety speed profiles generated in this case (F for failure) must allow stopping safely the ego-vehicle taking into account all the users. * The last category corresponds to a situation of safe reaction to a dangerous event requiring the use of a safety braking system or a collision requiring an emergency braking system (JB). This can occur when an unequipped vehicle does not respect traffic and human rules. The categories 2 and 3 are \"automated emergency mode\" of the ADS module and represent a significant innovation in ADS. This emergency mode will be addressed and explained in more detail in the next section. In Figure 15, the zone/envelope model of minimum and maximum achievable speed for the trajectories 0A, 0B, FA  
The decision module first calculates the speed profiles before calculating the paths. This approach is opposed to the classic \"path-speed\" decomposition approach [81]. In order to generate the velocity and acceleration profiles, a set of equations are implemented [64].