Implementation of a Potential Field-Based Decision-Making Algorithm on Autonomous Vehicles for Driving in Complex Environments

Autonomous driving is undergoing huge developments nowadays. It is expected that its implementation will bring many benefits. Autonomous cars must deal with tasks at different levels. Although some of them are currently solved, and perception systems provide quite an accurate and complete description of the environment, high-level decisions are hard to obtain in challenging scenarios. Moreover, they must comply with safety, reliability and predictability requirements, road user acceptance, and comfort specifications. This paper presents a path planning algorithm based on potential fields. Potential models are adjusted so that their behavior is appropriate to the environment and the dynamics of the vehicle and they can face almost any unexpected scenarios. The response of the system considers the road characteristics (e.g., maximum speed, lane line curvature, etc.) and the presence of obstacles and other users. The algorithm has been tested on an automated vehicle equipped with a GPS receiver, an inertial measurement unit and a computer vision system in real environments with satisfactory results.


Introduction
The benefits of autonomous driving can be huge [1]. For example, the number of traffic accidents would be reduced, since it is estimated that around 90% of accidents are caused by human errors [2]. The most widely accepted classification of autonomous vehicles is presented by SAE (Society of Automotive Engineers) [3]. It was published for the first time in January 2014, and the last published revision is dated June 2018. It defines six levels of automation (from 0 to 5), depending on the degree of attention and human intervention required for the driving tasks. Table 1 shows a summary. There are several applications of autonomous vehicles in different environments. Even private vehicles are the most widespread among the public, autonomous vehicles are not limited to them [4,5]. One of the most remarkable examples in other sectors is the large-scale goods transport. In order to increase road capacity and companies' productivity, a method has emerged consisting of the grouping of a set of vehicles as a platoon [6,7]. In addition to goods transport, the irruption of autonomous driving technology provides solutions for public transport, such as autonomous-taxi models [8,9] and car-sharing [10,11]. Another sector in which autonomous driving is of great interest is the one of exploration, surveillance and military activities [12]. In this way, interventions could be carried out without risking human lives. Automated vehicles represent a technology that will create enhanced mobility opportunities for the elderly population and disabled people [13].
In summary, nowadays, the operation of autonomous vehicles is a reality in simple environments, but presents some decision-making challenges in complex scenarios [4]. Some examples are environments with heavy traffic where it is necessary to carry out a lane-change, entering a highway, or entering a roundabout. These tasks are quite trivial for experienced human drivers, but are high difficulty for a machine that follows the driving rules strictly; does not use, in general, previous expectations to solve conflicts; and does not extract the same information from each scenario (making impossible a subjective assessment of that scenario).
In this paper, a potential-field model for decision making in changeable traffic scenarios has been adapted, adjusting its parameters and operation so that it can operate in an autonomous vehicle in real time. Furthermore, some modifications to the conventional definition of this kind of model have been introduced in order to solve some of the main limitations, such as the limited application of responses to future events. Driving tests have been carried out in real-life scenarios and realistic environments. The environment was unknown, and we had no control over any variable, which allows us to generalize the response of the system. The tests were performed using an autonomous vehicle instrumented and equipped with sensor systems.
The paper is organized as follows: Section 2 discusses related works on autonomous cars and path planning techniques. Section 3 explains all the theoretical aspects of the potential-field model. Section 4 provides a description of the hardware and software architectures of the vehicle in which the decision algorithms are implemented for tests on real roads. Section 5 presents the different tests carried out, as well as the results obtained. Finally, Section 6 presents the main conclusions of this paper.

Related Work
Developing an autonomous vehicle involves three main elements: Perception (in a general way, including positioning and communications if available), decision making and action. The last one is perhaps the simplest one, so little research is required now, and most developments are now focused on the first and second ones. Concerning perception, the technology has undergone a great deal of development in recent years. Autonomous vehicles could use a wide variety of sensor systems, such as computer vision [14,15], ultrasonic [16], radar [17] or LiDAR [18,19], among others. Thanks to the advantages and limitations of each one, the current trend is focused on sensor information fusion [20,21]. Furthermore, vehicular communications enhance the electronic horizon, and satellite positioning on a digital map provides information as a secondary sensor.
The next step is decision-making. From a classical point of view, driving must address decisions at three different levels [22]. The first one involves the tasks related to navigation, such as choosing an appropriate route to reach the selected destination. The second one consists of strategies while driving (adjustment of the speed according to the environment, safe distance keeping from the other vehicles, or criteria to perform the lane-change maneuver). Finally, the third one refers to the operation of the actuators: Pedals (accelerator and brake), gear shift and steering wheel. Nowadays, vehicles with some level of automation can perform simple and repetitive control tasks such as lane tracking, or speed/safety distance maintenance, but they are not prepared to deal with complex and changing scenarios or with uncertainties. Therefore there is still the technological challenge of having more generic decision strategies, but, at the same time, running in real time and maintaining very high reliability standards.
Therefore, decision-making involves a multitude of aspects [4,23,24] (route planning, the road type and geometry, the presence of different elements on the road-obstacles, pedestrians, other vehicles-and comfort criteria, among others).
In addition, the scenarios that must be faced can be very varied. This implies that techniques and processes that can be systematically applied to decision-making must be as general as possible in order to face unexpected changes of the environment. Furthermore, the amount of data to be processed is very high and responses must be developed with very strict time requirements. Autonomous driving requires work with real-time applications. In summary, decision making needs to meet strict performance, safety, and fault tolerance criteria. So, there are different types of path-planning techniques which can be used in the navigation of autonomous vehicles. Perhaps, one of the simplest approaches is to use a target assignment strategy to allow the vehicle to navigate through successive waypoints in the environment [25].
Evolutionary algorithms have demonstrated to be very useful in tasks related to vehicle control and route calculation. A strategy for identification and correction of odometry data using evolutionary algorithms is presented in [26]. Within the evolutionary algorithms, there are two techniques for path planning in robotic applications which stand out: Genetic algorithms and particle swarm optimization. A comparison of parallel genetic algorithms and particle swarm optimization algorithms is made for path planning in real time robotic applications in [27].
In addition, there have been many recent developments in optimization-based planning methods. Besides evolutionary algorithms, there have been many recent planning approaches based on nonlinear optimization [28] and model predictive control [29].
Path planning strategies based on fuzzy logic have demonstrated to be a very versatile tool and widely used in different parts of vehicle control. For example, an overtaking system for autonomous vehicles that uses fuzzy controllers that mimic human behavior and reactions during overtaking maneuvers is presented in [30]. A system for pedestrian collision avoidance (at speeds up to 30 km/h) in autonomous vehicles using a fuzzy steering controller is presented in [31].
Nowadays, the application of techniques such as deep learning or neural networks in applications of this type are undergoing great developments as well. For example, a spiking neuron path planning algorithm for an autonomous robot that can adjust its routes depending on the environment is introduced in [32].
Rapidly-exploring random tree (RRT) algorithms are used in the calculation of path planning in robotic applications, as well as in vehicles [33,34]. Besides that, algorithms based on A* technique have been widely used in pathfinding problems [35,36].
Reactive techniques compute their response at each instant based on the current environment and can face highly dynamic and unpredictable environments [37]. Within the reactive techniques, planning based on artificial potential fields can be highlighted. It is a quite common technique in robotics, but its use in autonomous driving is not yet so widespread [38].
Some of the theoretical limitations of these techniques in robotics are presented in [39]. One of the main limitations of systems based on algorithms with potential fields would be the possible presence of local minima, but there are different approaches to avoid this problem, like the concept of the virtual obstacle for local minima recovery in [40,41] or the harmonic potential functions in [42].
Finally, the use of communications between vehicles (V2V) or between vehicles and infrastructure (V2I) is currently undergoing a great development [43]. Using communications, more information is available for path calculation and adapting speed [44].
The main contribution of this paper is the implementation of a generic path planning model, based on potential fields, on autonomous vehicle so it could react to unstructured situations. It is proposed to use a generic driving technique that can deal with any type of event, rather than determinist methods such as those currently applied. This model is specifically designed for road vehicles and not for robotic Furthermore, compared to conventional algorithms, some modifications are introduced in order to overcome the limitations regarding future events in the vehicle path. Tests have been carried out in real scenarios (apart from previous simulated data), specifically on highways with an instrumented autonomous vehicle. In the tests carried out, the estimation of the speed and steering angle were checked. The scenarios in which the tests were performed were not known beforehand, nor did we have control over any of their variables. The fact of not having control over the scenario allowed us to prove the generalizability of the proposed system.

Decision Making Algorithm
Path-planning based on potential models is a tool that is included within the reactive techniques. They are based on the fact that an object (in this case the vehicle) reacts at all times to the current situation and environment, generating an appropriate movement proportional to that situation. The selection of this kind of technique has the clear drawback that, in general, only the present information around the vehicle is considered, appropriate responses being generated from it. But other advantages make it a good solution. It is quite computationally efficient, and decisions can be obtained in real time with very high sampling rates. Furthermore, decisions are directly linked to physical variables so they are easily comprehensible, and this fact is essential for avoiding strange behaviors of the autonomous vehicle that could surprise other road users.
In the path-planning technique based on potential models, each element of the environment (lanes, other vehicles, obstacles, etc.) produces a potential field (attraction or repulsion) in an analogue way to what magnetic charges do (depending on whether their mathematical sign is positive or negative). That is, the vehicle will react to the presence of the different potential fields (Figure 1) with an appropriate and proportional behavior. Depending on the different potentials considered each time, the vehicle modifies its movement by acting on the steering wheel, the throttle or the brake pedals. specifically on highways with an instrumented autonomous vehicle. In the tests carried out, the estimation of the speed and steering angle were checked. The scenarios in which the tests were performed were not known beforehand, nor did we have control over any of their variables. The fact of not having control over the scenario allowed us to prove the generalizability of the proposed system.

Decision Making Algorithm
Path-planning based on potential models is a tool that is included within the reactive techniques. They are based on the fact that an object (in this case the vehicle) reacts at all times to the current situation and environment, generating an appropriate movement proportional to that situation. The selection of this kind of technique has the clear drawback that, in general, only the present information around the vehicle is considered, appropriate responses being generated from it. But other advantages make it a good solution. It is quite computationally efficient, and decisions can be obtained in real time with very high sampling rates. Furthermore, decisions are directly linked to physical variables so they are easily comprehensible, and this fact is essential for avoiding strange behaviors of the autonomous vehicle that could surprise other road users.
In the path-planning technique based on potential models, each element of the environment (lanes, other vehicles, obstacles, etc.) produces a potential field (attraction or repulsion) in an analogue way to what magnetic charges do (depending on whether their mathematical sign is positive or negative). That is, the vehicle will react to the presence of the different potential fields ( Figure 1) with an appropriate and proportional behavior. Depending on the different potentials considered each time, the vehicle modifies its movement by acting on the steering wheel, the throttle or the brake pedals. In the following sections, the different possible types of potential sources will be explained: Forward, backward, side and diagonal potentials.

Forward and Backward Potentials
The first potential sources that must be considered are forward and backward potentials. Figure 2 shows a scheme of both situations, as well as the variables involved in their calculation. In this scheme, there are two vehicles (vehicle B1 and vehicle B2) interacting with the ego vehicle (vehicle A).  In the following sections, the different possible types of potential sources will be explained: Forward, backward, side and diagonal potentials.

Forward and Backward Potentials
The first potential sources that must be considered are forward and backward potentials. Figure 2 shows a scheme of both situations, as well as the variables involved in their calculation. In this scheme, there are two vehicles (vehicle B1 and vehicle B2) interacting with the ego vehicle (vehicle A).
Forward, backward, side and diagonal potentials.

Forward and Backward Potentials
The first potential sources that must be considered are forward and backward potentials. Figure 2 shows a scheme of both situations, as well as the variables involved in their calculation. In this scheme, there are two vehicles (vehicle B1 and vehicle B2) interacting with the ego vehicle (vehicle A).  On the one hand, the forward potential field behaves in such a way that other obstacles that are directly in front of the vehicle will produce changes in it. That is, in Figure 2, vehicle B1 (which drives in front of vehicle A) generates a potential field that affects the behavior of the ego vehicle. The forward potential (p fw ) is calculated by Equation (1): where v B1 is the speed of the obstacle, v max is the maximum road speed and d fw is the distance measured on the longitudinal axis of the road between the vehicle and the obstacle.
On the other hand, the backward potential (p bw ) is the one that is produced due to the presence of vehicles or other obstacles in the vicinity of the rear (e.g., vehicle B2 in Figure 2), as described in Equation (2): This potential is used as an element to foster cooperation between vehicles, so that if the vehicle behind it (at a distance d bw ) has a higher speed (v B2 ) than the autonomous vehicle (v A ), it will help vehicle B2 to perform the overtaking maneuver, whenever possible.

Side and Diagonal Potentials
The side potential is produced due to the presence of other elements on the sides of the vehicle (such as other vehicles or obstacles), or due to the road or lane lines. Figure 3 shows an example of the calculation of the variables that affect the side potential, without the presence of obstacles, that is, taking into consideration only the lane lines. On the one hand, the forward potential field behaves in such a way that other obstacles that are directly in front of the vehicle will produce changes in it. That is, in Figure 2, vehicle B1 (which drives in front of vehicle A) generates a potential field that affects the behavior of the ego vehicle. The forward potential (pfw) is calculated by Equation (1): where v B1 is the speed of the obstacle, v max is the maximum road speed and d fw is the distance measured on the longitudinal axis of the road between the vehicle and the obstacle.
On the other hand, the backward potential (pbw) is the one that is produced due to the presence of vehicles or other obstacles in the vicinity of the rear (e.g., vehicle B2 in Figure 2), as described in Equation (2): This potential is used as an element to foster cooperation between vehicles, so that if the vehicle behind it (at a distance d bw ) has a higher speed (v B2 ) than the autonomous vehicle (v A ), it will help vehicle B2 to perform the overtaking maneuver, whenever possible.

Side and Diagonal Potentials
The side potential is produced due to the presence of other elements on the sides of the vehicle (such as other vehicles or obstacles), or due to the road or lane lines. Figure 3 shows an example of the calculation of the variables that affect the side potential, without the presence of obstacles, that is, taking into consideration only the lane lines. The value of the side potential (ps) can be calculated at every moment by Equation (3) where d ls and d rs are the distances between the vehicle and the different elements located on its left and right sides, respectively, measured on the transverse axis of the lane. Figure 4 shows how the lateral potential field varies according to the distance to each of the limits of the lane. It is shown in red, the effects of the right side and in blue the effects of the left one The value of the side potential (p s ) can be calculated at every moment by Equation (3): where d ls and d rs are the distances between the vehicle and the different elements located on its left and right sides, respectively, measured on the transverse axis of the lane. Figure 4 shows how the lateral potential field varies according to the distance to each of the limits of the lane. It is shown in red, the effects of the right side and in blue the effects of the left one (both distance and partial potential). In the figure, it can be verified that, when the vehicle drives in the center of the lane (lc), the potential takes a null value. However, if it approaches the left limit of the lane (firstly) or the right limit (secondly), the lateral potential takes the maximum values. The diagonal potential is used to predict the vehicle position in future instances and anticipate future changes of the environment, so it can be used to make corrections in advance. Figure 5 shows an example of this type of potential field and also all the variables involved in its calculation.
It is necessary to consider the distance from each one of the front corners of the vehicle to the different obstacles or elements located in front of the vehicle (assuming a direction of ± 45 degrees with respect to the longitudinal axis of the vehicle).

Elements That Generate Potentials
The definition of those elements that are relevant each time for the vehicle decision making process and that are used for the definition of the aforementioned potential fields is a key issue. The most classical and simple approaches consider only obstacles and road or lane lines. A more complex approach considers traffic signals, such as speed limits of stop signals. However, this scope limits the ability of the algorithm from considering some other information that could be relevant in subsequent instances. This is the case, for example, for the information provided by the strategic level [5]; e.g., the The diagonal potential is used to predict the vehicle position in future instances and anticipate future changes of the environment, so it can be used to make corrections in advance. Figure 5 shows an example of this type of potential field and also all the variables involved in its calculation. The diagonal potential is used to predict the vehicle position in future instances and anticipate future changes of the environment, so it can be used to make corrections in advance. Figure 5 shows an example of this type of potential field and also all the variables involved in its calculation.
It is necessary to consider the distance from each one of the front corners of the vehicle to the different obstacles or elements located in front of the vehicle (assuming a direction of ± 45 degrees with respect to the longitudinal axis of the vehicle).

Elements That Generate Potentials
The definition of those elements that are relevant each time for the vehicle decision making process and that are used for the definition of the aforementioned potential fields is a key issue. The most classical and simple approaches consider only obstacles and road or lane lines. A more complex approach considers traffic signals, such as speed limits of stop signals. However, this scope limits the ability of the algorithm from considering some other information that could be relevant in subsequent instances. This is the case, for example, for the information provided by the strategic level [5]; e.g., the The value of the diagonal potential field (p d ) can be calculated by Equation (4) as a function of the front-left diagonal (d ld ) and the front-right diagonal (d rd ): It is necessary to consider the distance from each one of the front corners of the vehicle to the different obstacles or elements located in front of the vehicle (assuming a direction of ± 45 degrees with respect to the longitudinal axis of the vehicle).

Elements That Generate Potentials
The definition of those elements that are relevant each time for the vehicle decision making process and that are used for the definition of the aforementioned potential fields is a key issue. The most classical and simple approaches consider only obstacles and road or lane lines. A more complex approach considers traffic signals, such as speed limits of stop signals. However, this scope limits the ability of the algorithm from considering some other information that could be relevant in subsequent instances. This is the case, for example, for the information provided by the strategic level [5]; e.g., the presence of exit or merging ramps near the vehicle position, or the decision of taking a specific road exit. For this reason, the algorithm considers all the information available at each moment (not only the information provided by onboard sensors and the current scenario), useless data are automatically discarded because of their limited impact of the generated field. This strategy solves the main limitation of reactive decision-making methods and enhances the knowledge of the digital sight distance to make a decision.

Lateral and Longitudinal Control
Finally, the steering angle (θ) is calculated by applying a conversion factor (K T ) to the calculated total potential (p T ), according to Equation (5). This is what is known as lateral planning.
where the total potential is the pondered sum of all the individual potentials, according to Equation (6): where: • K s governs the lateral sensitivity of the vehicle. A high value means that small potential fields will make large changes in the steering angle. • K d is used to control the effect of the next lateral corrections. • K fw governs the longitudinal sensitivity of the vehicle. High values will cause the vehicle to avoid the obstacles very soon. • K bw controls the way the vehicle cooperates with others.
On the other hand, the speed of the vehicle is calculated in such a way that it drives at the maximum possible speed considering the movement of other road users, making sure to do it safely, respecting a comfortable deceleration (a) and without exceeding the maximum speed allowed on the road (v max ). This is what is known as longitudinal planning (Equation (7)).
It can be checked how, apart from respecting the speed limits, the speed v must be adequate with other vehicles in the lane (v B1 ), so that there is no risk of collisions.

Experimental Testbed Platform
The decision-making algorithm was tested in simulated and real scenarios. For the latter, an autonomous vehicle with open hardware and software architectures was used, in which new decision algorithms could be implemented. Those architectures are described in this section.

Hardware Architecture
The hardware architecture of the proposed system consists of five layers: Vehicle, automation, control, perception and application, as shown in Figure 6. The vehicle layer represents the car on which the different sensors are embedded and whose behavior is controlled with the decision model. It contains, in a very summarized way, a CAN (Controller Area Network) of the vehicle and the three actuators. The automation layer is responsible for interacting with the vehicle's actuators (accelerator, brake and steering wheel) so that these can be controlled by a computer. This layer includes all the necessary electronics to act on the actuators. The control layer includes the computer that manages the low-level control of the elements of the automation layer. That is, it receives mainly two input variables-speed and steering angle. Using these inputs, it is responsible for generating the appropriate signals and messages for the automation layer to work correctly and safely. This layer serves as a communication link between the rest of the layers and with the automation layer (and therefore, with the car). The perception layer incorporates all the sensor systems: GPS (Global Positioning System) receiver, an IMU (Inertial Measurement Unit) and a computer vision system. Finally, the Application layer includes high-level tasks (path-planning, behavior management, data calculation and visualization, etc.).

Software Architecture
This section shows the different nodes that constitute the software architecture in which any decision-making algorithm could be implemented. The system is composed of five nodes-positioning, environment perception, potential planning, low-level control and data logging, as shown in Figure 7. It shows that the Positioning and Environment perception nodes obtain information that is sent to the potential planning node, which is connected to the low-level control node. There is also a node (data logging), which is responsible for collecting data from the rest of the nodes (blue dashed line) and stores or displays them, as appropriate.
Firstly, the positioning node receives data from the GPS system and the inertial measurement unit (IMU). With all these data, its main task is carrying out accurate vehicle positioning. Secondly, the environment perception node is responsible for processing the computer vision system. Using the images that it receives, it provides information about the road lines (position, curvature, etc.), about possible obstacles on the road (pedestrians or other vehicles) and about the different traffic signals (mainly, speed limit signs). Then, the potential planning node is responsible for calculating the potential fields. With all these data, the tasks of lateral planning (calculation of the steering angle)

Software Architecture
This section shows the different nodes that constitute the software architecture in which any decision-making algorithm could be implemented. The system is composed of five nodes-positioning, environment perception, potential planning, low-level control and data logging, as shown in Figure 7. It shows that the Positioning and Environment perception nodes obtain information that is sent to the potential planning node, which is connected to the low-level control node. There is also a node (data logging), which is responsible for collecting data from the rest of the nodes (blue dashed line) and stores or displays them, as appropriate.

Tests
This work has adapted a path planning model based on potential fields so that it can work in real environments. Its behavior has been adapted and adjusted to be used on real roads. Working in real environments requires the ability of facing unexpected changes in the variables of the environment (for example, vehicles that do not drive in a typical way or elements that make it difficult to detect the road lines). In addition, the amount of data to be considered and to be processed is much bigger, so processing and response time requirements are quite strict. Therefore, the system must be robust and fast enough to achieve a proper performance.

Simulated Scenarios Definition
The parameters involved in the calculation of the potential fields should be adjusted in order to obtain realistic and feasible responses of the vehicle. For this task, different tests were carried out in simulated scenarios. Furthermore, correct behavior of the model should be assessed previously to the real tests with an autonomous vehicle. All these scenarios are shown in Figure 8. Firstly, the positioning node receives data from the GPS system and the inertial measurement unit (IMU). With all these data, its main task is carrying out accurate vehicle positioning. Secondly, the environment perception node is responsible for processing the computer vision system. Using the images that it receives, it provides information about the road lines (position, curvature, etc.), about possible obstacles on the road (pedestrians or other vehicles) and about the different traffic signals (mainly, speed limit signs). Then, the potential planning node is responsible for calculating the potential fields. With all these data, the tasks of lateral planning (calculation of the steering angle) and longitudinal planning (calculation of speed) are carried out. Afterwards, the node low-level control receives the values of steering angle target and speed target. With this information, the node manages the steering wheel, throttle and brake, in order to achieve the target values. Finally, the data logging layer is responsible for storing the calculated data and showing the information to the user.

Tests
This work has adapted a path planning model based on potential fields so that it can work in real environments. Its behavior has been adapted and adjusted to be used on real roads. Working in real environments requires the ability of facing unexpected changes in the variables of the environment (for example, vehicles that do not drive in a typical way or elements that make it difficult to detect the road lines). In addition, the amount of data to be considered and to be processed is much bigger, so processing and response time requirements are quite strict. Therefore, the system must be robust and fast enough to achieve a proper performance.

Simulated Scenarios Definition
The parameters involved in the calculation of the potential fields should be adjusted in order to obtain realistic and feasible responses of the vehicle. For this task, different tests were carried out in simulated scenarios. Furthermore, correct behavior of the model should be assessed previously to the real tests with an autonomous vehicle. All these scenarios are shown in Figure 8.

Parameters Analysis
The effect of modifying each parameter should be characterized in simulations, so they are varied in such a way as to obtain adequate responses, and to not produce abrupt or unstable behaviors.
The process of adjusting the configuration parameters is carried out as follows. Firstly, the Ks parameter is adjusted in an environment without obstacles so that the vehicle drives properly, meaning that it is correctly centered in the lane. In addition, these changes had to be proportional, because very high values of Ks would produce very abrupt responses and could make the vehicle unstable.
The Kd parameter is then gradually increased so that the vehicle can anticipate the effect of near future lateral variations. The value of this parameter cannot be very high, since its objective is to anticipate near future actions, but other potential fields are responsible for performing the maneuver.
Once the Ks and Kd parameters have been adjusted, the vehicle will be able to drive properly in the lane and face some situations that may occur. The next step is to set the value of the Kf parameter so that the vehicle can react to obstacles in front of it. Its value must allow for facing the obstacles, but without producing abrupt outputs: High values will cause the vehicle to avoid the obstacles very soon.
Due to one of the behavioral rules of the autonomous vehicle being to drive along the right lane (slow lane) whenever possible, after an overtaking maneuver, it returns to the original lane as soon as this is safe enough. For this reason, it is not necessary to adjust the Kb parameter.

Parameters Analysis
The effect of modifying each parameter should be characterized in simulations, so they are varied in such a way as to obtain adequate responses, and to not produce abrupt or unstable behaviors.
The process of adjusting the configuration parameters is carried out as follows. Firstly, the K s parameter is adjusted in an environment without obstacles so that the vehicle drives properly, meaning that it is correctly centered in the lane. In addition, these changes had to be proportional, because very high values of K s would produce very abrupt responses and could make the vehicle unstable.
The K d parameter is then gradually increased so that the vehicle can anticipate the effect of near future lateral variations. The value of this parameter cannot be very high, since its objective is to anticipate near future actions, but other potential fields are responsible for performing the maneuver.
Once the K s and K d parameters have been adjusted, the vehicle will be able to drive properly in the lane and face some situations that may occur. The next step is to set the value of the K f parameter so that the vehicle can react to obstacles in front of it. Its value must allow for facing the obstacles, but without producing abrupt outputs: High values will cause the vehicle to avoid the obstacles very soon.
Due to one of the behavioral rules of the autonomous vehicle being to drive along the right lane (slow lane) whenever possible, after an overtaking maneuver, it returns to the original lane as soon as this is safe enough. For this reason, it is not necessary to adjust the K b parameter.
Finally, Table 2 shows a summary of the effect of modifying the configuration parameters. In general, increasing these values will produce very abrupt responses and instability in the system. On the other hand, decreasing these values will impede the system from achieving an adequate response.

Tests in Real Environments
In order to assess the system in a practical and real way, different tests were performed to evaluate the strengths, weaknesses and possible improvements. The tests were carried out on the E-901/A-3 highway in Madrid, specifically between exits 7 and 17. Figure 9 shows a map of the test area.

Tests in Real Environments
In order to assess the system in a practical and real way, different tests were performed to evaluate the strengths, weaknesses and possible improvements. The tests were carried out on the E-901/A-3 highway in Madrid, specifically between exits 7 and 17. Figure 9 shows a map of the test area. The results obtained for the tests carried out are shown below. Firstly, an example of the calculation of the steering angle from the potential fields is presented. Secondly, the calculation of the speed from the potential field generated by a vehicle driving in front is shown. Data and decisions are made at a sampling rate of 5 Hz. Figure 10 shows the results obtained for the stretch of road the tests were performed on. The calculation of the steering wheel angle, as a function of lateral and diagonal potential, is shown graphically. The distance to each lane (dl = left, dr = right) is shown, as well as the calculation of the position of the center of the lane (Ad) and the variation of the active normalized potential fields (lateral and diagonal).
In this case, there were not obstacles, so only the potential fields generated by the lane lines are considered. This way, it can be checked how the lateral potential provides proportional values for driving in the center of the lane.
The system produces a response so that the steering wheel faces deviations when driving in the lane. In this way, the steering angle is calculated to drive centered in the lane. Generally, for small deviations, the system calculates turning angles of approximately ±0.05 rad. In this case, for slightly larger deviations, the calculated steering angles reach ±0.15 rad, a coherent value in this kind The results obtained for the tests carried out are shown below. Firstly, an example of the calculation of the steering angle from the potential fields is presented. Secondly, the calculation of the speed from the potential field generated by a vehicle driving in front is shown. Data and decisions are made at a sampling rate of 5 Hz. Figure 10 shows It should be noted that the perception systems, such as the computer vision system, can provide false or inaccurate information. Then, potentials are not correctly calculated and abrupt changes in the target steering angle could appear. This is the reason why sensor fusion (GPS, IMU and LiDAR) is advisable to avoid these situations.
Finally, Figure 11 shows the results obtained for the longitudinal planning calculation. In this case, there is another vehicle driving in front of the test car. This vehicle generates a potential field that affects the speed calculation.
The distance at which the vehicle is located, the relative speed and the calculated potential fields (pf = forward, ps = side, pd = diagonal) are shown. Using this information, target speed is calculated, below the maximum speed limit, considering the appropriate distance between the vehicle and the obstacle and the relative speed. In this case, the calculated speeds range between 90-100 km/h.
It is therefore demonstrated that the decision-making algorithm can operate on a real road, (specifically on a motorway) with real traffic flow, and that it would adapt correctly to changing scenarios. It should be kept in mind that tests were carried out in real and uncontrolled environments in which none of the scenario variables were previously known or predefined, so the vehicle could have found any possible situation and must react to them correctly. In this case, there were not obstacles, so only the potential fields generated by the lane lines are considered. This way, it can be checked how the lateral potential provides proportional values for driving in the center of the lane.
The system produces a response so that the steering wheel faces deviations when driving in the lane. In this way, the steering angle is calculated to drive centered in the lane. Generally, for small deviations, the system calculates turning angles of approximately ±0.05 rad. In this case, for slightly larger deviations, the calculated steering angles reach ±0.15 rad, a coherent value in this kind of environment.
It should be noted that the perception systems, such as the computer vision system, can provide false or inaccurate information. Then, potentials are not correctly calculated and abrupt changes in the target steering angle could appear. This is the reason why sensor fusion (GPS, IMU and LiDAR) is advisable to avoid these situations.
Finally, Figure 11 shows the results obtained for the longitudinal planning calculation. In this case, there is another vehicle driving in front of the test car. This vehicle generates a potential field that affects the speed calculation.
The distance at which the vehicle is located, the relative speed and the calculated potential fields (p f = forward, p s = side, p d = diagonal) are shown. Using this information, target speed is calculated, below the maximum speed limit, considering the appropriate distance between the vehicle and the obstacle and the relative speed. In this case, the calculated speeds range between 90-100 km/h.
It is therefore demonstrated that the decision-making algorithm can operate on a real road, (specifically on a motorway) with real traffic flow, and that it would adapt correctly to changing scenarios. It should be kept in mind that tests were carried out in real and uncontrolled environments in which none of the scenario variables were previously known or predefined, so the vehicle could have found any possible situation and must react to them correctly.  Figure 11. Longitudinal planning using potential fields.

Conclusions
In this paper, an algorithm for path-planning, based on potential fields, valid to react to any possible situation has been implemented, improving performance in comparison to current applications on autonomous vehicles. These potential fields are calculated from sensor data and obtained in real time. The tests to verify operation in real environments have been performed using an instrumented vehicle equipped with GPS, IMU and a computer vision system. These tests have been carried out in different stretches of a highway opened to traffic. The results were obtained from an unknown environment in which we had no control over any variable. This allowed us to prove the ability of generalizing the algorithm response because the scenario was not controlled.
For possible improvements, it is proposed to make use of LiDAR to improve the robustness and reliability in the perception of the environment, mainly because of false or limited information that computer vision can provide under highly demanding scenarios. Now, more challenging scenarios, such as overtaking maneuvers and entering roundabouts are being tested on real roads. It should be noted that, in this case, after the algorithms decide to make a movement, vehicle dynamics models are used to obtain speed and steering angel target values, achievable in a physically safe way.
Finally, as a contribution to reactive models, variables of the next road stretches are also considered in potential calculations, so road exits, desired route, traffic expectations, etc., could modify decisions. In that sense, the use of V2X technologies in the following tests is proposed. The use of cooperative driving would allow vehicles to inform others where they are, as well as share information on the different obstacles they detect. In this way, the information would be more complete; therefore, maneuvers could be carried out more safely and efficiently. That fact overcomes the limitations of these kinds of models that only consider the local state of the scenario each time.

Conclusions
In this paper, an algorithm for path-planning, based on potential fields, valid to react to any possible situation has been implemented, improving performance in comparison to current applications on autonomous vehicles. These potential fields are calculated from sensor data and obtained in real time. The tests to verify operation in real environments have been performed using an instrumented vehicle equipped with GPS, IMU and a computer vision system. These tests have been carried out in different stretches of a highway opened to traffic. The results were obtained from an unknown environment in which we had no control over any variable. This allowed us to prove the ability of generalizing the algorithm response because the scenario was not controlled.
For possible improvements, it is proposed to make use of LiDAR to improve the robustness and reliability in the perception of the environment, mainly because of false or limited information that computer vision can provide under highly demanding scenarios. Now, more challenging scenarios, such as overtaking maneuvers and entering roundabouts are being tested on real roads. It should be noted that, in this case, after the algorithms decide to make a movement, vehicle dynamics models are used to obtain speed and steering angel target values, achievable in a physically safe way.
Finally, as a contribution to reactive models, variables of the next road stretches are also considered in potential calculations, so road exits, desired route, traffic expectations, etc., could modify decisions. In that sense, the use of V2X technologies in the following tests is proposed. The use of cooperative driving would allow vehicles to inform others where they are, as well as share information on the different obstacles they detect. In this way, the information would be more complete; therefore, maneuvers could be carried out more safely and efficiently. That fact overcomes the limitations of these kinds of models that only consider the local state of the scenario each time.