applied sciences

Article End-to-End Automated Guided Modular Vehicle

Luis A. Curiel-Ramirez * , Ricardo A. Ramirez-Mendoza * , Rolando Bautista-Montesano , M. Rogelio Bustamante-Bello, Hugo G. Gonzalez-Hernandez , Jorge A. Reyes-Avedaño and Edgar Cortes Gallardo-Medina

School of Engineering and Science, Tecnologico de Monterrey 64849, Mexico; [email protected] (R.B.-M.); [email protected] (M.R.B.-B.); [email protected] (H.G.G.-H.); [email protected] (J.A.R.-A.); [email protected] (E.C.G.-M.) * Correspondence: [email protected] (L.A.C.-R.); [email protected] (R.A.R.-M.)

 Received: 24 April 2020; Accepted: 19 June 2020; Published: 26 June 2020 

Abstract: Autonomous Vehicles (AVs) have caught people’s attention in recent years, not only from an academic or developmental viewpoint but also because of the wide range of applications that these vehicles may entail, such as intelligent mobility and logistics, as well as for industrial purposes, among others. The open literature contains a variety of works related to the subject. They employ a diversity of techniques ranging from probabilistic to ones based on Artificial Intelligence. The increase in computing capacity, well known to many, has opened plentiful opportunities for the algorithmic processing needed by these applications, making way for the development of autonomous navigation, in many cases with astounding results. The following paper presents a low-cost but high-performance minimal sensor open architecture implemented in a modular vehicle. It was developed in a short period of time, surpassing many of the currently available solutions found in the literature. Diverse experiments were carried out in the controlled and circumscribed environment of an autonomous circuit that demonstrates the efficiency of the applicability of the developed solution.

Keywords: autonomous vehicle; intelligent transportation systems; deep learning; ; end-to-end learning; self-driving cars

1. Introduction Advancements in computing power have allowed the development and implementation of more complex systems in vehicle development. The automotive industry has taken advantage of these advancements by creating and continuously improving advanced driver-assistance systems, such as automatic systems, road-assisted driving, and sometimes fully autonomous driving (AD) capacity [1]. Urban, commercial, and industrial vehicles have been enhanced with these systems and are commonly known as Automated Guided Vehicles (AGV). Many automotive manufacturers have self-driving car development programs, including Tesla and . Additionally, other companies, such as Uber and , focus on the Transport as a Service (TaaS) industry. Finally, automated vehicles are also being employed inside warehouses or factories to automate distribution and optimize processes—e.g., Amazon [2,3]. There is still a long way to go before seeing this technology incorporated into all industries and transport services. The task of controlling a vehicle is not an easy one; it is a task that sometimes even the human being himself finds complicated to perform. The developed prototypes of self-driving car systems are required to fit industry and academic standards in terms of performance, safety, and trust [2,3]. The stand-alone navigation problem seemed to be solved after the Defense Advanced Research Projects Agency (DARPA) Grand and Urban Challenge [4], however new problems popped up. They generated interest in the following research topics: data management, adaptive mobility,

Appl. Sci. 2020, 10, 4400; doi:10.3390/app10124400 www.mdpi.com/journal/applsci Appl. Sci. 2020, 10, 4400 2 of 27 cooperative planning, validation, and evaluation. Data uncertainty and reliability represent the biggest challenges for data management. Without reliable data, the representation and modelling of the environment are at stake [5]. The topic of adaptive mobility relates to the introduction of self-driving cars to conventional environments. Therefore, the automation of the process is not simple. It is important to continue developing research in this area to improve upon the current technology surrounding autonomous vehicles, from the development of better sensors at a lower cost to the improvement of navigation algorithms with more advantageous designs, leading to the generation of more significant low-cost vehicular platforms. This paper presents the results obtained from the navigation automation of a modular vehicular platform, intending to generate a low-cost modular AGV. Considering the minimum instrumentation necessary in addition to the algorithms needed to achieve such automation, this work integrates several of the most popular software and hardware tools used nowadays. The Robot Operating System (ROS) was used as an integrating software for the different instrumentation modules and sensors that allow controlling the vehicle; Behavioral Cloning (BC), an end-to-end algorithm, was used because of its ability to replicate human behavior when navigating the vehicle through an established route. Numerous acronyms are frequently used in this work, which can be seen in AppendixA. This paper is organized as follows: The background overview section describes the related work and state-of-the-art developments in the field and compares them to the modular vehicle platform presented. The research approach presents the methodology used to develop the solution. The proposed system segment contains a thorough description of how the vehicle was instrumented, the minimum systems required to achieve Society of Automotive Engineers (SAE) Level 1 automation, and the test track. The development section reports how the stages in which the instrumentation, data acquisition, algorithm development, training, testing, and validation modules were developed over four weeks. The results segment presents the achievements of the AGV along with its performance metrics. The conclusion analyzes the problems faced and how they were solved along with the contributions of this work to areas of growth. Additionally, possible system upgrades are stated in the future work section.

2. Background Overview The development of technologies that automate driving in the last decade has structured specific definitions and methodologies that allow the effective implementation of vehicles with the capacity to navigate over complex environments. These definitions and methodologies are the basis of the current development of autonomous vehicles, and it is the same basis used for the development of the solution presented in this work. These concepts are levels of driving automation, approaches to achieving navigation, and learning methods for navigation.

2.1. Levels of Driving Automation Since 2014, the Society of Automotive Engineers (SAE) has published yearly the “SAE J3016 Levels of Driving Automation”, which defines six levels of automation ranging from 0, no automation, to 5, full vehicle autonomy [6–8]. Table1 briefly summarizes it. Appl. Sci. 2020, 10, 4400 3 of 27

Table 1. Levels of driving automation based on the Society of Automotive Engineers (SAE) J3016 [6–8].

SAE Levels Driver Tasks Vehicle Tasks Examples The driver has the main control The systems work only Blindspot warnings, lane 0 even though some of the as momentary assistance departure warnings, automated systems are engaged. providing warnings. parking alerts assistance. The vehicle has partial The driver must supervise the control and assistance in OR 1 environment and the system to the OR adaptive . interfere as he requires it. brake/acceleration. The vehicle controls the Lane centering AND steering and 2 at brake/acceleration in the same time. specific circumstances. Passive passengers when automated driving is engaged. The vehicle has Traffic jam and highway 3 The driver needs to intervene autonomous driving in chauffeur. upon the system request. limited conditions and will not operate unless all Local driverless taxi 4 Passive passengers when the conditions are met. (pedals or steering wheel automated driving is engaged. is optional). Robo taxi or full The passenger never takes over The vehicle has driving autonomous car (pedals 5 control. control under all and steering wheel are conditions. not required).

2.2. Navigation Approaches By defining the levels of driving automation, it is possible to know the scope and limitations that a navigation system must have when driving the vehicle. The generation of navigation systems for AVs has been achieved in recent years through various approaches. Two main scopes aim to solve the navigation problem:

Traditional approach: It focuses on the individual and specialized tasks for perception, navigation, • control, and actuation. The environment and the ego vehicle are modeled with the gathered data. Thus, for highly dynamic environments this approach is limited by the computing power, model complexity, and sensor quality. Robotic systems have used this modular solution for many years. Its complexity tends to be directly proportional to the model’s accuracy [2,3,9]. End-to-end approach (E2E): This scope allows users to generate a direct correlation of the • input data of a system with certain output data through the use of Deep Learning (DL). Artificial intelligence has been a breakthrough for AGVs. Machine learning (ML) serves to generate intelligent perception and control systems for robot navigation. Deep Learning (DL) is a state-of-the-art technique for creating models that resemble human behavior and decision-making [10–14].

DL is trained with positive and negative examples using Deep Neural Networks (DNN). There are several types of architectures to choose from, including Convolution or Deconvolution layers, Recurrence or Memory layers, and Fully Connected Neurons, as well as Encoding or Decoding layers. These layers form popular architectures, such as Convolutional Neural Networks (CNN), Recurrent Neural Networks (RNN), Long-Short Term Memories (LSTM), and Fully Convolutional Networks (FCN), among others. Specific architectures have been generated by companies or development groups, such as LeNet, GoogLeNet, VGG, ResNet, Inception, and others [15,16]. The performance of each type of network will strongly depend on the data with which it is trained. Data comes mostly from the ego vehicle’s front view, along with little processed data [17,18]. Outputs are usually referenced values to be given to closed-loop controllers for the steering, speed and braking systems [14]. Among all the DNN, convolutional neural networks (CNN) have proven to be Appl. Sci. 2020, 10, 4400 4 of 27 the most efficient ones for this type of task [19]. Their inner layers extract and filter the information with which it is trained. CNNs correlate input images to control and actuate the variables of the AGV. Thus, the training process efficiency is increased. Only a few thousand data points are required to achieve acceptable accuracy [20–22].

2.3. Learning Methods Taking into account the scope using neural networks, different learning algorithms have achieved an effective navigation system for AGVs in simulated and real environments. Each algorithm has its advantages and disadvantages in different types of development environments. The two learning Appl. Sci. 2020, 10, x FOR PEER REVIEW 4 of 26 algorithms for this kind of neural networks are: • DeepDeep ReinforcementReinforcement LearningLearning (DRL):(DRL): ThisThis method optimizes optimizes a a cost cost function function by by maximizing maximizing a • areward reward or or minimizing minimizing penalties, penalties, depending depending on onwhich which parameters parameters are arespecified specified by the by user. the user. For Forexample, example, a reward a reward in inan anE2E E2E approach approach regarding regarding autonomous autonomous navigation navigation could could be to grantgrant positivepositive pointspoints ifif thethe platformplatform remainsremains insideinside aa delimiteddelimited lanelane markmark andand aa negativenegative pointpoint ifif itit werewere toto drivedrive outside outside this this area. area. Regarding Regarding this this example, example, the the cost cost function function is composedis composed of aof set a set of rulesof rules of expectedof expected outcomes. outcomes. A set A ofset discrete of discrete randomized randomized actions actions are testedare tested in each in each scenario scenario [13]. The[13]. DNN The willDNN try will iteratively try iteratively to optimize to the optimize robot’s navigationthe robot’s within navigation a lane [23within–25], merginga lane [23–25], [24,26], ormerging exploring [24,26], unknown or exploring environments unknown [27,28 ].environm The algorithments [27,28]. is described The algorithm in Figure1 .is described in Figure 1.

Figure 1. Deep Reinforcement Learning (DRL) diagram. Figure 1. Deep Reinforcement Learning (DRL) diagram. A mapping algorithm would need to be implemented to delimit the lane marks that feed the A mapping algorithm would need to be implemented to delimit the lane marks that feed the image to the DNN and establish the reward rules and parameters. Not to mention that it is an iterative image to the DNN and establish the reward rules and parameters. Not to mention that it is an iterative method, which means that the training of the DNN would need to happen as the platform drives method, which means that the training of the DNN would need to happen as the platform drives itself in the chosen area. This is a risky approach, since no training has been carried out in the first itself in the chosen area. This is a risky approach, since no training has been carried out in the first iteration, so the platform would be driving itself around the area at the same time as it trains itself iteration, so the platform would be driving itself around the area at the same time as it trains itself with the rewards and the penalties. This training is usually developed in big areas, or simulated with the rewards and the penalties. This training is usually developed in big areas, or simulated as a as a first approach and then taken to the real world. This is dangerous, as in the first iterations the first approach and then taken to the real world. This is dangerous, as in the first iterations the platform platform is going to drive outside the lane; it will break and accelerate very slowly or quickly. It can is going to drive outside the lane; it will break and accelerate very slowly or quickly. It can hurt hurt somebody or even damage its own structure in the training process. somebody or even damage its own structure in the training process. For this work, a safe area was chosen to acquire training data. No simulator was used. For that For this work, a safe area was chosen to acquire training data. No simulator was used. For that reason, DRL was not the approach used for the development of this work. reason, DRL was not the approach used for the development of this work. Behavioral Cloning/Imitation Learning (BC/IL): These algorithms are applications of supervised •● Behavioral Cloning/Imitation Learning (BC/IL): These algorithms are applications of learning.supervised They learning. are iterative They are processes iterative processes in which in a networkwhich a network modifies modifies its weights its weights when givenwhen agiven set of a set inputs of inputs with with its corresponding its corresponding outputs. outputs. The The training training and and validation validation datasets datasets containcontain informationinformation aboutabout thethe vehicle’svehicle’s surroundingsurrounding environmentenvironment andand controlcontrol variables:variables: steeringsteering wheelwheel angle,angle, acceleration, and and braking. braking. Data Data are are acquired acquired by navigating by navigating several several laps lapson a given on a giventrack. The DNN generalizes an optimal solution after being trained with a valid dataset [29–31]. Valid datasets depend on the complexity of the track [30]. Usually tens of thousands of examples are needed [32]. The CNN is used to train these sets of images, performing sequential tasks of convolutions, batch normalizations, and max pooling activations in order to take important image descriptors. These extractions of image features are commonly taken using feature extraction methods, such as Scale-Invariant Feature Transform (SIFT), Speeded Up Robust Features (SURF), and others [33]. These methods often have image rotation invariance extractors as well as a low computational cost. For a BC/IL approach, a high number of features need to be extracted and acquired in very short periods of time. CNNs use the same approach as a conventional feature extractor, but they perform more tasks in the color and intensity histograms. These features are labeled with either the steering wheel angle, gas pedal intensity, brake force, or all three of them. The system captures images and labels them with the aforementioned Appl. Sci. 2020, 10, 4400 5 of 27

track. The DNN generalizes an optimal solution after being trained with a valid dataset [29–31]. Valid datasets depend on the complexity of the track [30]. Usually tens of thousands of examples are needed [32]. The CNN is used to train these sets of images, performing sequential tasks of convolutions, batch normalizations, and max pooling activations in order to take important image descriptors. These extractions of image features are commonly taken using feature extraction methods, such as Scale-Invariant Feature Transform (SIFT), Speeded Up Robust Features (SURF), and others [33]. These methods often have image rotation invariance extractors as well as a low computational cost. For a BC/IL approach, a high number of features need to be extracted and acquired in very short periods of time. CNNs use the same approach as a conventional feature extractor, but they perform more tasks in the color and intensity histograms. These features are labeled with either the steering wheel angle, gas pedal intensity, brake force, or all three of them. The system captures images and labels them with the aforementioned parameters while the users drive. CNNs extract features from the images and correlate them with the specified parameters. They do this by inputting the features extracted from the camera into the model, which outputs a label. Output data is used to give the control information of the vehicle. This approach requires large quantities of images but does not need in-field training as in the DRL approach. This implies that safety is only at stake when a model with 95%+ accuracy is tested.

Both methods can be trained and tested in simulated or real-world environments. DRL converges faster in simulations because of the lower complexity of the environment [34]. After an acceptable performance, it can be tested in a real-world environment. However, extra safety measures must be considered, such as inertia, friction, braking, and acceleration, which represent some factors that cannot be accurately simulated. BC and IL need human intervention to be trained. They offer a more straightforward solution; however, they require much more time to acquire enough data to function. The quality and amount of data, the DNN architecture, reward functions, and computer power determine how much time is needed to train both approaches [19,32]. The ego vehicle will perform well if the testing scenario resembles the training data.

3. Related Work and State-of-the-Art for AD AI and ML applied to robot navigation and autonomous vehicles have been trending for more than 20 years. However, computer power and memory usage have limited the performance of such algorithms. Current technology can train and implement such technology in shorter periods, which allows more complex variations of these algorithms to be developed [19]. The first practical implementation of BC/IL was carried out in 1989 by Carnegie Mellon University. The Autonomous Land Vehicle in a Neural Network (ALVINN) used a three-layer NN. It used an input image of the front view to output a steering angle [35]. The Defense Advanced Research Projects Agency (DARPA) developed a vehicle in 2004. DARPA Autonomous Vehicle (DAVE) used a six-layer CNN with a binocular camera in the front. Images with steering angles given by a human driver who trained the DNN. The robot successfully navigated through an obstacle course [36]. In 2016 Nvidia developed DAVE-2. It used BC/IL with a nine-layer CNN. Data obtained from a front camera and two lateral ones were loaded to the DNN in order to predict the steering wheel angle. This architecture improved the system’s accuracy and prevented possible derailments [15,16]. The works mentioned above set the basis for state-of-the-art developments, like the one presented in this paper. Deep Learning state-of-the-art work and developments can be found in Table2. All of them are applications either in simulation, real, or combining both types of environments. Some have optimization purposes or test systems that allow them to assist driving at different levels of autonomy. Appl. Sci. 2020, 10, 4400 6 of 27

Table 2. Summary of state-of-the-art Deep Learning (DL) approaches.

Authors DNN Architecture Summary Type of Application Implementation of driver behavioral cloning using deep Kocíc, J.; Joviˇcíc, N.; CNN learning in a unity simulator Simulation approach Drndarevíc, V. based on a Nvidia CNN network [37]. Proposal of two architectures for an end-to-end system for driving: Haavaldsen, H.; a traditional CNN and a CNN CNN, CNN-LSTM Simulation approach Aasbo, M.; Lindseth, F. extended design combining with a LSTM. All running in the Carla simulator [38]. An end-to-end Deep Neural Network for autonomous driving Kocíc, J.; Joviˇcíc, N.; CNN designed for Embedded Simulation approach Drndarevíc, V. Automotive Platforms on the Udacity’s Simulator [39]. Implementation of an agile Pan, Y.; Cheng, C.; autonomous driving using Saigol, K.; Lee, K.; Embedded small-scale CNN End-to-End Deep Imitation Yan, X.; Theodorou, E.A.; Automotive platform Learning on an embedded small Boots, B. kart platform [28]. The development of DeepPicar is Bechtel, M.G.; a Low-cost DNN based Embedded small-scale McEllhiney, E.; Kim, M.; CNN autonomous car platform built on Automotive platform Yun, H. a Raspberry Pi 3 [40]. Overview of sensors and Sensor Kocíc, J.; Joviˇcíc, N.; Fusion in Autonomous Vehicles Subsystem design and CNN, ResNet Drndarevíc, V. with a development on embedded proposal platforms [7]. Proposal and design of a modular Curiel-Ramirez, L.A.; framework for semi-autonomous Subsystem design and Ramirez-Mendoza, R.A.; CNN driving assistance systems for a approach Carrera, G. et al. real scale automotive platform [41]. A Multi-task Learning framework Real-world and Mehta, A.; Adithya, S.; on a simulation and cyber-physic CNN, ResNet simulated fused Anbumani, S. platform is proposed for driving environments assistance [42]. Development of an Autonomous Vehicle Control Strategy Using a Single Camera and Deep Neural Navarro, A.; Real-world and Networks. Different architectures, Joerdening, J.; Khalil, R.; CNN, RNN simulated fused including Recurrent Neural Brown, A.; Asher, Z. environments Networks (RNN), are used in a simulator and then on a real autonomous vehicle [43]. system that generates real view images from virtual environment pictures Real-world and Pan, X.; You, Y.; Wang, Z.; taken from a simulator. This is CNN, FCN simulated fused Lu, C. applied for data augmentation for environments autonomous driving systems using Fully Convolutional Networks (FCN) [44]. Appl. Sci. 2020, 10, 4400 7 of 27

Table 2. Cont.

Authors DNN Architecture Summary Type of Application DeepDriving is a learning affordance for direct perception in autonomous driving. The base Real-world and Chen, C.; Seff, A.; CNN training was made in simulation simulated fused Kornhauser, A.; Xiao, J. and tested with real environment environments pictures for lane change direction [45]. The proposal and implementation of a framework with Curiel-Ramirez, L.A.; hardware-in-the-loop architecture Real-world and Ramirez-Mendoza, R.A.; CNN, any to improve autonomous car simulated fused Izquierdo-Reyes, J. et al. computer vision systems via environments simulation and hardware integration [46]. Improvement of the imitation learning for end-to-end Algorithm learning Zhang, J.; Cho, K. CNN autonomous driving using a optimization Query-Efficiente learning method [27]. An FCN-LSTM model proposal Xu, H.; Gao, Y.; Yu, F.; for end-to-end learning on driving Algorithm learning FCN, LSTM Darrell, T. models using large-scale video optimization datasets [30]. DeepTest is a systematic testing tool for automatically detecting Tian, Y.; Pei, K.; Jana, S.; erroneous behaviors of Algorithm learning CNN, RNN Ray, B. DNN-driven vehicles that can optimization potentially lead to fatal crashes [29]. An empirical evaluation of DNN Huval, B.; Wang, T.; DL models testing in CNN models detecting lane lines in Tandon, S.; et al. real environments highway driving [47]. An end-to-end driving performance test in a highway Viswanath, P.; Nagori, S.; environment. Additionally, DL models testing in Mody, M.; Mathew, M.; CNN a proposal of an DNN architecture real environments Swami, P. named JacintoNet compared to VGG architecture [48]. Presents a DL algorithm development for autonomous Al-Qizwini, M.; DL models testing in driving using GoogLeNet for Barjasteh, I.; Al-Qassab, CNN simulated highway environments. H.; Radha, H. environments The system predicts the position of front vehicles [12].

As seen in the last table, there are some gaps in the methodology and proposal development on low-cost modular vehicle platforms, where the BC/IL algorithm is the basis for driving automation. From this, we can highlight the different areas of opportunity and contributions that this work seeks to develop. These are:

1. Few works of large-scale automated vehicles for the transport of people or cargo. 2. A low-cost modular AGV capable of autonomous driving on certain fixed routes. 3. A practical implementation of the BC/IL algorithm in a real environment. 4. Research, development, and test methodology implementation. 5. A quick development limited to four-weeks of work. Appl. Sci. 2020, 10, x FOR PEER REVIEW 7 of 26

Presents a DL algorithm development for DL models Al-Qizwini, M.; autonomous driving using GoogLeNet for testing in Barjasteh, I.; Al-Qassab, CNN highway environments. The system predicts simulated H.; Radha, H. the position of front vehicles [12]. environments

As seen in the last table, there are some gaps in the methodology and proposal development on low-cost modular vehicle platforms, where the BC/IL algorithm is the basis for driving automation. From this, we can highlight the different areas of opportunity and contributions that this work seeks to develop. These are: 1. Few works of large-scale automated vehicles for the transport of people or cargo. 2. A low-cost modular AGV capable of autonomous driving on certain fixed routes. 3. A practical implementation of the BC/IL algorithm in a real environment. Appl. Sci. 2020, 10, 4400 8 of 27 4. Research, development, and test methodology implementation. 5. A quick development limited to four-weeks of work. 6. ResearchResearch and and development development test test architecture: architecture: open, open, flexible, flexible, reconfigur reconfigurable,able, agile, agile, robust, robust, and cost-effectiveand cost-effective implementation. implementation. 7. Low-costLow-cost and and open-source open-source hardware hardware and software implementation. BC/ILBC/IL is mostly limited to simulated environments with simple vehicular models or controlled environments with small-scale vehicles.vehicles. Likewise, Likewise, its its implementa implementationtion is is developed or optimized through these simulated environments or merging withwith realreal data.data. There are very few tasks where the algorithms areare embeddedembedded in in a real-sizea real-size vehicle vehicle platform platform or in or a vehiclein a vehicle with thewith capacity the capacity to carry to people carry peopleor heavy or material. heavy material. Most of themMost areof them developed are developed on small-scale on small-scale automotive automotive platforms. platforms. This becomes This a becomesdifferential a differential in this work in by this the work development by the develop of a minimal,ment of modular,a minimal, and modula low-costr, and sensor low-cost architecture sensor architecturebut with a high but performancewith a high performance that allows automating that allows the automating driving to the an SAEdriving level to 1 an on SAE a AGV level platform 1 on a AGVthat can platform be used that to loadcan be material used to or load people material on it. Additionally,or people on dueit. Additionally, to the AGV’s due modularity, to the AGV’s it can modularity,be modified it or can adapted be modified in size, or sensors, adapted and in size, capacities sensors, as and required. capacities This as is required. how the This concept is how of the Automatedconcept of the Guided Automated Modular Guided Vehicle Modular is created. Vehicle is created. The following section details the capabilities of the platform used for this work, mentioning its technical and development characteristics.

4. Research Research Approach To carry out out this this work, work, it itwas was necessary necessary to us toe use a research a research and anddevelopment development methodology. methodology. The Thedevelopment development had hadto fulfill to fulfill with with the proposed the proposed work work within within a margin a margin of 4 ofweeks. 4 weeks. During During this thistime, time, the research,the research, development, development, and and testing testing of the of the vehicle vehicle platform platform had had to to be be carried carried out out with with the the BC/IL BC/IL algorithm. This methodology can be seen in Figure 22..

Figure 2. ResearchResearch and and development methodology. The methodology describes the stages for the development of this work. The first stages were to define and know the vehicle platform. This platform was already built, so this work was limited to knowing its characteristics and capabilities, which are described in the following section. For the instrumentation, actuators were already defined in the platform, but it was necessary to propose the required sensors to implement the BC/IL algorithm for driving automation. The next stage was to define the hardware and software for processing. This needed to have the minimum capacity necessary to process DL algorithms and be able to communicate with the sensors and actuators installed on the platform. That is why the Nvidia Jetson AGX Javier met the requirements. The stages of software development and integration were the next ones. During these stages, it was fundamental the use of ROS and DL frameworks, such as Keras and Tensorflow. The testing stage was made up of several parts, such as data acquisition and neural network training and testing protocol. All of this focused on the proposed route for the vehicle to drive it autonomously. Appl. Sci. 2020, 10, 4400 9 of 27

After obtaining results, it was necessary to analyze and define some design improvements on all stages of the development of this work. These will be reviewed in the analysis, conclusions, and future work sections of this paper. For all stages of the methodology, it was essential to support it with information found in state-of-the-artAppl. Sci. 2020 developments., 10, x FOR PEER REVIEW All the stages are detailed in the following sections. 8 of 26

5. ExperimentalThe methodology Platform describes the stages for the development of this work. The first stages were to define and know the vehicle platform. This platform was already built, so this work was limited to Diknowingfferent add-ons its characteristics enhance and the capabilities, bare-bones which platform are described so that itin canthe befollowing used forsection. diverse For purposes,the such asinstrumentation, personal transportation actuators were or cargo. already The defined electric in the vehicle’s platform, drive but it iswas rear-wheeled. necessary to propose A control the box in the rearrequired generates sensors the signalsto implement for the the open-loop BC/IL algorithm transmission for driving system. automation. This system can set a speed level, The next stage was to define the hardware and software for processing. This needed to have the rotational direction, and braking. The brakes are triggered with a hysteresis controller system that minimum capacity necessary to process DL algorithms and be able to communicate with the sensors activatesand coupled actuators relays. installed on the platform. That is why the Nvidia Jetson AGX Javier met the Thisrequirements. system communicates through an RS-232 serial protocol. The vehicle uses an Ackermann distributionThe with stages a 30 of◦ softwaresteering development ratio. The steering and integratio systemn were uses the the next same ones. communication During these stages, protocol it as the brakes,was fundamental while a closed-loop the use of systemROS and controls DL frameworks, the position. such as ItKeras is also and equipped Tensorflow. with The switchestesting that detect thestage maximum was made up position of several on parts, each such side. as data The acquisition modular platformand neural cannetwork be controlled training and with testing an Xbox protocol. All of this focused on the proposed route for the vehicle to drive it autonomously. wireless controller with no electrical or mechanical modifications made to the vehicle. The general After obtaining results, it was necessary to analyze and define some design improvements on technicalall detailsstages of of the the development platform are of listedthis work. in Table These3 willand be an reviewed image of in thethe modularanalysis, conclusions, platform is and depicted in Figurefuture3. work sections of this paper. For all stages of the methodology, it was essential to support it with information found in state- of-the-art developments.Table All 3. Modular the stages vehicle are detailed platform in the technical following characteristics. sections.

5. Experimental Platform Transmission Different add-ons enhance the bare-bonesVcc platform so 48that V it can be used for diverse purposes, such as personal transportation or cargo.Power The electric vehicle’s 1000 Wdrive is rear-wheeled. A control box in the rear generates the signals for theMax open-loop Speed transmission 40 km /system.h This system can set a speed level, rotational direction, and braking.Workload The brakes are triggered 800 kg with a hysteresis controller system that activates coupled relays. Brakes This system communicates through an RS-232 serial protocol. The vehicle uses an Ackermann Activation time 1.5 s distribution with a 30° steering ratio. The steering system uses the same communication protocol as the brakes, while a closed-loop system controlsSteering the position. It is also equipped with switches that detect the maximum position on Fulleach steering side. The time modular platform 10 s can be controlled with an Xbox wireless controller with no electricalTurning or mechanic radiusal modifications 4.08 m made to the vehicle. The general technical details of the platform are Steeringlisted in Tabl anglee 3 and an image 30◦ of the modular platform is depicted in Figure 3.

FigureFigure 3. Modular3. Modular platform platform built by by Campus Campus Puebla. Puebla. Appl. Sci. 2020, 10, 4400 10 of 27

This is a minimal system vehicle that can be used for passenger transportation or cargo. It can be further enhanced with sensors and processors to become an AGV.

5.1. Sensors and Instrumentation The vehicle had three cameras covering the front view. The central processing hardware was a Nvidia Jetson AGX Xavier that oversaw acquiring data, processing it, and turning it into actuator primitives. The components that were used to accomplish autonomous navigation can be grouped into sensors, processors, and control elements. Table4 briefly summarizes these elements.

Table 4. Sensors, processors, and control elements.

Sensors Camera Logitech C920 HD pro webcam, 1080 p LIDAR Hokuyo UST-10LX 10 m range, 1081 steps, 270◦ coverage Processors CPU/GPU Nvidia Jetson AGX Xavier 512-core Volta GPU, 8-core ARM, 32 GB RAM Microcontroller ATmega2560 54 IO pins, 15 PWM channels, 16 ADC, 256 KB flash memory Controllers H-bridge L298 Dual full-bridge driver, 4A, 12 V

Two types of sensors were used to acquire information from the environment: cameras and a LIDAR. The Logitech cameras used were middle/low range. They provided 720–1080 p images at 30 fps with a 78◦ field of view (FOV). Their automatic light correction warranties contrasted images, making them a good choice for different outdoor environments. Three of these cameras were used to generate a 150◦ FOV, as the acquired images from the left and right cameras overlapped the central one. The LIDAR, an active sensor manufactured by Hokuyo, uses a laser source to scan a 270◦ FOV divided into 1081 steps and a maximum distance of 10 m. It has an angular resolution of 0.25◦ and a linear accuracy of 40 mm. A full scan takes around 25 ms. The LIDAR was positioned in the center of the vehicle’s front. An F310 Logitech gamepad was used to tele-operate the vehicle’s velocity and Ackerman’s steering angle [49]. These four sensors along with the gamepad were connected to the AGV’s processor: a Nvidia Jetson AGX Xavier. The cameras were connected through USB-C 3.0 ports, the Hokuyo through an Ethernet connection, and the gamepad via a USB 2.0. A Nvidia Jetson AGX Xavier and an Atmega 2560 were used as high and low-level controllers, respectively. The Nvidia Jetson AGX Xavier acquired and processed information from the environment and the user. The user’s information was acquired through a mouse, a keyboard, and a gamepad, which were connected to a USB-hub 3.0. The CPU/GPU capabilities of this development kit enable it to perform operations of up to 1100 MHz. Thus, ML algorithms can be easily implemented in this platform. The user can supervise the Nvidia Jetson AGX Xavier through an on-board screen. The developer kit translated its computations into low-level instructions that could be communicated to a microcontroller using an RS232 protocol. An ATmega 2560 microcontroller embedded in an Arduino 2560 shield was used. This microcontroller can handle an intensive use of input-output (IO) peripherals and serial communication protocols. It has enough computational power to implement a basic open-loop and hysteresis control for the speed, braking, and steering systems. The speed system was open loop. Basic digital outputs were enough to activate and deactivate the system. Hysteresis control for the brakes and steering required an Analog-Digital Converter (ADC) and the RS232 communication protocol. The brakes and the steering angle positions were sensed with potentiometers. Typical H-bridges were used to trigger the actuators, which could be halted by a kill switch that interrupted the Vcc. The kill switch was used as an emergency stop. Figure4 shows the instrument connection diagram. Appl. Sci. 2020, 10, x FOR PEER REVIEW 10 of 26 kit enable it to perform operations of up to 1100 MHz. Thus, ML algorithms can be easily implemented in this platform. The user can supervise the Nvidia Jetson AGX Xavier through an on- board screen. The developer kit translated its computations into low-level instructions that could be communicated to a microcontroller using an RS232 protocol. An ATmega 2560 microcontroller embedded in an Arduino 2560 shield was used. This microcontroller can handle an intensive use of input-output (IO) peripherals and serial communication protocols. It has enough computational power to implement a basic open-loop and hysteresis control for the speed, braking, and steering systems. The speed system was open loop. Basic digital outputs were enough to activate and deactivate the system. Hysteresis control for the brakes and steering required an Analog-Digital Converter (ADC) and the RS232 communication protocol. The brakes and the steering angle positions were sensed with potentiometers. Typical H-bridges were used to trigger the actuators, which could beAppl. halted Sci. 2020 by, 10a ,kill 4400 switch that interrupted the Vcc. The kill switch was used as an emergency11 stop. of 27 Figure 4 shows the instrument connection diagram.

FigureFigure 4. 4. InstrumentInstrument connection connection diagram. diagram. 5.2. Software Architecture 5.2. Software Architecture The Operating System (ROS) was chosen because of its ease of handling input and The Robotics Operating System (ROS) was chosen because of its ease of handling input and output devices, communication protocols, such as RS232 or CAN, and simultaneously running scripts output devices, communication protocols, such as RS232 or CAN, and simultaneously running of different programming languages, like Python or C++. ROS is based on nodes that oversee scripts of different programming languages, like Python or C++. ROS is based on nodes that oversee specific tasks, such as communicating with a microcontroller or processing information from a camera. specific tasks, such as communicating with a microcontroller or processing information from a Nodes subscribe or publish information through topics. They can run in parallel, which allows an camera. Nodes subscribe or publish information through topics. They can run in parallel, which agile flow of information. Safety nodes were implemented so that whenever a publisher stopped allows an agile flow of information. Safety nodes were implemented so that whenever a publisher working, the vehicle would make an emergency stop. The ROS facilitated high and low-level algorithm stopped working, the vehicle would make an emergency stop. The ROS facilitated high and low-level integration. SAE level 1 navigation was achieved with E2E BC/IL. Several expert users drove on the test algorithm integration. SAE level 1 navigation was achieved with E2E BC/IL. Several expert users track to generate the training data. Drivers used the vehicle at different times of the day to get different drove on the test track to generate the training data. Drivers used the vehicle at different times of the light conditions. Twelve models were tested in a simulated testbed before being implemented in the day to get different light conditions. Twelve models were tested in a simulated testbed before being vehicle. The AGV was tested on campus in a controlled environment. All the autonomous navigations implemented in the vehicle. The AGV was tested on campus in a controlled environment. All the were successful. The enhancement and automation were carried out in a four-week time span. autonomous navigations were successful. The enhancement and automation were carried out in a The goal of this work was to implement the instrumentation, programming, intelligence, four-week time span. and integration of minimal system requirements to enhance an electric vehicle to an SAE level The goal of this work was to implement the instrumentation, programming, intelligence, and 1 AGV in less than four weeks. The BC/IL minimum instrumentation proposed in [15] was used as a integration of minimal system requirements to enhance an electric vehicle to an SAE level 1 AGV in basis. A LIDAR sensor was added in order to continuously monitor the distance to the surrounding less than four weeks. The BC/IL minimum instrumentation proposed in [15] was used as a basis. A elements and prevent a collision. This section will go into further detail of the instrumentation, the test LIDAR sensor was added in order to continuously monitor the distance to the surrounding elements track and the DNN architecture. and prevent a collision. This section will go into further detail of the instrumentation, the test track and5.3. the Neural DNN Network architecture. Architecture A robust and fast CNN was used to solve the autonomous steering problem of this work. As mentioned in Section2, DNNs are the most popular alternatives to train a BC /IL system [17]. This work’s implementation was inspired by DAVE-2 [15,16]. In this model, an image could be loaded to a DNN and yield a steering wheel angle value for the modular platform. Thirteen CNN models were tested before one had the desired driving behavior. The images used as inputs were acquired from the three cameras described in Section 5.1. The images coming from the front central camera were labeled with the steering wheel angle, whereas the ones are coming from the lateral one were labeled with a correction of the steering wheel angle. Each image was an RGB 720 480 px. The images were resized and cropped × to an 83 160 8-bit RGB. As the RGB data had a 0–255 range, it needed to be normalized to a 0.5 to × − Appl. Sci. 2020, 10, x FOR PEER REVIEW 11 of 26

5.3. Neural Network Architecture A robust and fast CNN was used to solve the autonomous steering problem of this work. As mentioned in Section 2, DNNs are the most popular alternatives to train a BC/IL system [17]. This work’s implementation was inspired by DAVE-2 [15,16]. In this model, an image could be loaded to a DNN and yield a steering wheel angle value for the modular platform. Thirteen CNN models were tested before one had the desired driving behavior. The images used as inputs were acquired from the three cameras described in section 5.1. The images coming from the front central camera were labeled with the steering wheel angle, whereas the ones are coming from the lateral one were labeled Appl. Sci. 2020, 10, 4400 12 of 27 with a correction of the steering wheel angle. Each image was an RGB 720 × 480 px. The images were resized and cropped to an 83 × 160 8-bit RGB. As the RGB data had a 0–255 range, it needed to be normalized0.5 range before to a being−0.5 to fed 0.5 to range the NN. before Normalization being fed helpedto the NN. to reduce Normalization the processing helped time to and reduce memory the processingusage. The followingtime and memory formula wasusage. used The to fo achievellowing this: formula was used to achieve this: x/255 − 0.5. (1) x/255 0.5. (1) − The input layer was followed by five convolutional layers. The first three use 5 × 5-sized filters The input layer was followed by five convolutional layers. The first three use 5 5-sized filters and the next two 3 × 3. The output was then vectorized to obtain an array of 2496 elements.× Then, and the next two 3 3. The output was then vectorized to obtain an array of 2496 elements. Then, three fully connected× neural layers of 200, 100, and 20 elements were alternated with dropout layers. Thethree dropout fully connected layers prevent neural layersthe system of 200, from 100, andoverfitting 20 elements [50]. wereConvolutional alternated and with fully dropout connected layers. Thelayers dropout were layersactivated prevent by theRectified system Linear from overfitting Unit (ReLU) [50]. Convolutionalfunctions, which and fullyhelped connected with weight layers wereadjustment activated during by Rectified the Adam-optimized Linear Unit (ReLU) training functions, stage [51]. which More helped details with of weight the training adjustment process during will bethe described Adam-optimized in the following training sections. stage [51 ].Finally, More detailsthe one-dimensional of the training layer process outputs will be from described −1 to 1 inwere the normalizedfollowing sections. to the predicted Finally, the angle. one-dimensional Figure 5 shows layer a diagram outputs of from the CNN1 to 1architecture were normalized used for to this the − predictedwork. angle. Figure5 shows a diagram of the CNN architecture used for this work.

Figure 5. Final CNN architecture. During the training process, different architectures were tested by modifying the convolution During the training process, different architectures were tested by modifying the convolution filter sizes and the number of neurons, optimizers, and activation functions in order to find the best filter sizes and the number of neurons, optimizers, and activation functions in order to find the best model, which is the one described above. model, which is the one described above. 5.4. Proposed Route 5.4. Proposed Route Tecnológico de Monterrey, Campus Ciudad de México is in the south of Mexico City. The campus Tecnológico de Monterrey, Campus Ciudad de México is in the south of Mexico City. The has internal roads and streets. The traffic and number of pedestrians in these roadways are almost campus has internal roads and streets. The traffic and number of pedestrians in these roadways are non-existent. Therefore, they represent an excellent option for a controlled and low-risk environment. almost non-existent. Therefore, they represent an excellent option for a controlled and low-risk The chosen 170 m flat road segment is located between the Cedetec and Legorreta buildings. When the environment. The chosen 170 m flat road segment is located between the Cedetec and Legorreta roundtrip is considered, the street has two pronounced 90◦ left/right curves and a 70 m slightly buildings. When the roundtrip is considered, the street has two pronounced 90° left/right curves and left/right curved way. The roadway is generally in good condition, although it has a few bumps and a 70 m slightly left/right curved way. The roadway is generally in good condition, although it has a potholes with poor lane separation. The sidewalk is separated from the road surface by a yellow line. few bumps and potholes with poor lane separation. The sidewalk is separated from the road surface The satellite view of the test track (red) is depicted in Figure6. The data acquisition and test phases by a yellow line. The satellite view of the test track (red) is depicted in Figure 6. The data acquisition were held under restricted access to the area and expert supervision. and test phases were held under restricted access to the area and expert supervision.

Appl. Sci. 2020, 10, 4400 13 of 27 Appl. Sci. 2020, 10, x FOR PEER REVIEW 12 of 26

Figure 6. Test track satellite view.

6. Development This section will provide details on how the ROS integration, data acquisition, system training, and tests were developed.

6.1. ROS Integration Hardware architecture describeddescribed previouslypreviously inin SectionSection 5.15.1 waswas managed by the Robot Operating System (ROS), (ROS), a a collection collection of of op open-sourceen-source software. software. It provides It provides a wide a wide range range of computational of computational tools toolssuch suchas low-level as low-level device device control, control, process process co communication,mmunication, hardware hardware abstraction, abstraction, and and packagepackage management. ROS is based on the computational graphgraph model, which allows a wide range of devices to runrun the the same same programs programs if they if comply they withcomply some with basic some hardware basic specifications. hardware Thespecifications. communication The betweencommunication platforms between is straightforward platforms is straightforward and simple. Each and ROS simple. process Each is called ROS process a node, is which called is a jointly node, interconnectedwhich is jointly through interconnected topics. A through node is atopics. hardware A node or software is a hardware element or that software requests element or provides that data,requests which or provides can be a single data, valuewhich or can clustered be a single elements. value Dataor clustered are sent elements. through topics. Data are An ROSsent through Melodic Morenatopics. An was ROS used Melodic on an Ubuntu Morena 18.04 was OSused [52 on]. Eachan Ub elementuntu 18.04 described OS [52]. in SectionEach element 5.1 was described a node. in sectionThe 5.1 master was a nodenode. was a C++ or Python program used during the data acquisition and testing, respectively.The master This node node was subscribed a C++ or toPython each inputprogram element: used camerasduring the (usb_cam), data acquisition LIDAR and (urg_node), testing, andrespectively. the gamepad This node (joy). subscribed It also published to each input information element: viacameras RS232 (usb_cam), (rosserial) LIDAR to an ATmega256.(urg_node), Theand microcontrollerthe gamepad (joy). was It also also a nodepublished (rosserial_arduino). information via The RS232 master (rosserial) script used to an OpenCV, ATmega256. cv_bridge, The image_transport,microcontroller was and also sensor_msgs a node (rosserial_arduino). libraries in order The to acquiremaster script and process used OpenCV, the corresponding cv_bridge, information.image_transport, It receivesand sensor_msgs information libraries from thein order Nvidia to Jetson acquire AGX and Xavier, process and the transformscorresponding this informationinformation. into It receives primitives information for the actuators. from the Nvidia Jetson AGX Xavier, and transforms this informationFor the traininginto primitives and test for phases, the actuators. a template was created. It retrieves and preprocesses information fromFor the inputthe training nodes. Theand camera’stest phas imageses, a template were switched was fromcreated. an RGBIt retrieves to BGR colorand preprocesses palette, then theyinformation were resized from the and input cropped. nodes. The The LIDAR camera’s data images were continuously were switched compared from an with RGB a to safety BGR factor; color if the current measurement was within 10% of the safety factor, the vehicle would try to avoid the palette, then they were resized and cropped.± The LIDAR data were continuously compared with a safety factor; if the current measurement was within ±10% of the safety factor, the vehicle would try to avoid the threat. However, if the measurement was not acceptable, the platform would stop and Appl. Sci. 2020, 10, 4400 14 of 27 Appl. Sci. 2020, 10, x FOR PEER REVIEW 13 of 26 enterthreat. lock However, mode. The if the published measurement data waswere not sent acceptable, using the theRS232 platform communicati would stopon protocol. and enter The lock speed mode. intervalThe published went from data zero were up sent to 30 using km/h. the It RS232 was normalized communication in a − protocol.4 to 9 interval. The speed This range interval was went chosen from accordingzero up to to 30 the km documentation/h. It was normalized of the inmodular a 4 to pl 9atform. interval. The This sign range of wasthe integer chosen determined according to the the − motiondocumentation direction: of negative the modular backward platform. and positive The sign forward. of the integer According determined to the thedocumentation, motion direction: the steeringnegative values backward of the and platform positive range forward. from According−20° to 20°. to The the microcontro documentation,ller produces the steering a Pulse-Width values of the Modulationplatform range (PWM) from signal,20 withto 20 a .duty The cycle microcontroller that is proportional produces to a the Pulse-Width steering angle. Modulation The minimum (PWM) − ◦ ◦ valuesignal, maps with to a dutythe leftmost cycle that steering is proportional value (−20°) to the with steering the value angle. of The400, minimumwhile the valuemaximum maps is to the the rightmost,leftmost steering (20°) with value a (value20 ) withof 800. the The value brakes of 400, were while activated the maximum with isa theBoolean. rightmost, The (20data) withwere a − ◦ ◦ gatheredvalue of 800.into Thea single brakes string were activatedthat contained with a Boolean.the speed, The steering, data were and gathered braking into setpoints. a single stringThe microcontrollerthat contained thereceives speed, the steering, string and brakingparses it setpoints. to acquire The the microcontroller desired setpoints. receives As the the data string were and alreadyparses itin to primitive acquire the values, desired the setpoints. ATmega256 As theuses data them were as alreadyreferences in primitivefor the open-loop values, the or ATmega256hysteresis control.uses them as references for the open-loop or hysteresis control. ForFor the the training training phase, phase, synchronized synchronized data data from from each each node node were were properly properly indexed indexed and and stored. stored. ThisThis data data was was later later used used to to train train the the CNN. CNN. The The ROS ROS low low latency latency minimizes minimizes the the time time difference difference betweenbetween samples samples coming from didifferentfferent devices. devices. However, However, the the process process cannot cannot be be considered considered real-time. real- time.During During the testing the testing phase, phase, data wasdata added was added to the to CNN the andCNN the and output the output was published was published to the actuator. to the actuator.The trained The model trained uses model libraries uses for libraries Python for and Python C++ contained and C++ in contained Tensorflow in andTensorflow Keras [53 and]. The Keras user [53].supervises The user the supervises proper performance the proper of performanc the system.e A of safety the system. node was A implementedsafety node was using implemented the gamepad, usingsuch thatthe gamepad, a button can such be that pressed a button to stop can the be software pressed fromto stop executing the software and lock from the executing modular and platform. lock theFigure modular7 shows platform. the overall Figure ROS 7 shows integrated the overall system. ROS integrated system.

FigureFigure 7. 7. RobotRobot Operating Operating System System (ROS) (ROS) integration integration diagram. diagram.

TheThe initial initial tests tests were were performed performed with with a a high high ra rangenge computer computer with with a a Nvidia Nvidia GPU. GPU. The The ROS ROS node node integrationintegration worked worked smoothly.smoothly. However,However, during during the th migratione migration to theto Nvidiathe Nvidia Jetson Jetson AGX Xavier,AGX Xavier, several severalcompatibility compatibility issues emerged. issues emerged. The first The one tofirst appear one to was appear CUDA, was a parallel CUDA, computing a parallel platform computing and platform and programming model from NVIDIA, which is optimized to work with a GPU or a CPU. Nevertheless, our development kit is a mixture of both. A lite version needed to be installed to solve Appl. Sci. 2020, 10, 4400 15 of 27

Appl. Sci. 2020, 10, x FOR PEER REVIEW 14 of 26 programming model from NVIDIA, which is optimized to work with a GPU or a CPU. Nevertheless, ourthe problem. development Another kit is issue a mixture was the of interaction both. A lite between version Python needed versions. to be installed ROS uses to solve Python the 2.7, problem. while Anotherall the AI issue software was theuses interaction Python 3.7. between Separate Python virtual versions. environments ROS useswere Python needed 2.7, to whilemake all the AIlibraries software work uses together. Python 3.7. Separate virtual environments were needed to make all the libraries work together. 6.2. Data Acquisition and Preprocessing 6.2. Data Acquisition and Preprocessing The hardware architecture and the ROS-based system were tested in the lab before testing them with Thethe vehicle. hardware The architecture LIDAR response and the worked ROS-based as expected. system were No testedfurther in modifications the lab before were testing needed. them withThe image the vehicle. acquisition The LIDAR system response required workedseveral asiterations expected. for Noit to further work modificationscorrectly. During were the needed. initial Thetests, image some acquisition images were system missing required or broken. several iterationsThe initial for supposition it to work correctly. was that During ROS was the initial unable tests, to somehandle images data acquisition were missing from or broken. three cameras The initial simultaneously. supposition was However, that ROS when was unabletesting to the handle template data acquisitionwith different from cameras, three cameras this hypo simultaneously.thesis was dismissed. However, Individual when testing response the time template tests with diRGBfferent 720 cameras, this hypothesis was dismissed. Individual response time tests with RGB 720 480 images × 480 images were performed. The results showed that the number of frames per second× (fps) of each werecamera performed. was different: The results18, 20, and showed 60, respectively. that the number The simplest of frames solution per second was to (fps) sample of each all camerathe cameras was diat fftheerent: slowest 18, 20, rate and (18 60, fps). respectively. This way, The the simplest same number solution of was simultaneous to sample all images the cameras could at be the acquired slowest rateand (18saved fps). along This with way, the the current same number steering of angle. simultaneous The images images were could preprocessed be acquired to andselect saved an area along of withinterest the and current this area steering was angle.taken into The consideration images were preprocessedwhen training to the select CNN. an Such area an of interestarea can and be seen this areain Figure was taken8. into consideration when training the CNN. Such an area can be seen in Figure8.

Figure 8. ImageImage acquired and area of interest.

In order to successfullysuccessfully train a CNN,CNN, enoughenough trainingtraining data is required.required. The data should be as diverse and complete complete as as possible possible in in order order for for the the CN CNNN to tothrow throw a useful a useful result. result. For Forthis thispurpose, purpose, the thetest testtrack track was wasrecorded recorded on seven on seven round round trips. trips. More More than than100 thousand 100 thousand images images were collected. were collected. Each Eachimage image was bound was bound with its with respective its respective steering steering angle. The angle. navigation The navigation of the ve ofhicle the was vehicle made was in maderight- inhand right-hand traffic. For tra theffic. purpose For the purposeof assuring of assuringsuitable training suitable data training for the data CNN, for the steering CNN, angles steering collected angles collectedas raw data as rawwere data normalized were normalized and augmented. and augmented. A histogram A histogram of raw data of rawfor such data steering for such angles steering is anglesshown isin shown Figure in 9. Figure It can9 be. It seen can bethat seen there that is there a slight is a bias slight in bias the inhistogram, the histogram, which which might might lead to lead an tounsuccessful an unsuccessful training. training.

Appl. Sci. 2020, 10, 4400 16 of 27 Appl. Sci. 2020,, 10,, xx FORFOR PEERPEER REVIEWREVIEW 15 of 26

FigureFigure 9. 9. HistogramHistogram of of the the raw raw data data acquisition. acquisition. In order to minimize the effect of this bias, prior to training we introduced data augmentation. In order to minimize the effect of this bias, prior to training we introduced data augmentation. That is, we horizontally flipped all images and multiplied the normalized steering data times 1. As a That is, we horizontally flipped all images and multiplied the normalized steering data times− −1. As result, we had a dataset twice as big as the original one (206,726 images with its corresponding steering a result, we had a dataset twice as big as the original one (206,726 images with its corresponding angle). This way, the CNN could generalize more efficiently against any bias that is taken towards any steering angle). This way, the CNN could generalize more efficiently against any bias that is taken given steering angle. The histogram of the data after augmentation and normalization can be seen in towards any given steering angle. The histogram of the data after augmentation and normalization Figure 10. can be seen in Figure 10.

Figure 10. Histogram of the data after the normalization and augmentation process. Figure 10. Histogram of the data after the normalization and augmentation process. The histogram demonstrates how the augmentation and normalization of the data help give The histogram demonstrates how the augmentation and normalization of the data help give greater symmetry to the amount of data per label. This allows to reduce the probability of bias of greater symmetry to the amount of data per label. This allows to reduce the probability of bias of the the system towards a certain type of response and lets the model generalize data in a better way system towards a certain type of response and lets the model generalize data in a better way during during training. training. A total of 103,363 synchronized data points were used for the training stage. This dataset was A total of 103,363 synchronized data points were used for the training stage. This dataset was split in Keras into training (70%) and validation (30%) subsets. The percentages used are used in split in Keras into training (70%) and validation (30%) subsets. The percentages used are used in state- state-of-the-art works. The separation of data can be seen in more detail in Table5. of-the-art works. The separation of data can be seen in more detail in Table 5.

Appl. Sci. 2020,, 10, x 4400 FOR PEER REVIEW 1617 of 26 27

Table 5. Dataset distribution for training. Table 5. Dataset distribution for training. Training Validation Total Training Validation Total Number of Samples 72,354 31,009 103,363 PercentageNumber of Samples70% 72,354 31,00930% 103,363100% Percentage 70% 30% 100% 6.3. Training Process 6.3. Training Process The training data contains individual images sampled from the video along with the correspondingThe training steering data contains command. individual Training images with sampled human from driver the videodata alongis not with enough. the corresponding In order to successfullysteering command. navigate Training the road with and humanavoid leaving driver datathe lane, is not the enough. network In must order also to successfully learn how to navigate recover fromthe road mistakes. and avoid leaving the lane, the network must also learn how to recover from mistakes. In orderorder toto facilitate facilitate this this improved improved model, model, images images of the of carthe fromcar from different different perspectives perspectives are added are addedto the trainingto the training data, including data, including images images from the from center the of center the lane of the and lane images and taken images from taken diff erentfrom differentangles of angles the road. of the road. A blockblock diagramdiagram of of the the training training system system developed developed is shown is shown in Figure in Figure11. The 11. images The areimages inputted are inputtedinto a CNN into that a CNN calculates that acalculates proposed a steering proposed angle, steering which angle, is compared which is to compared the desired to angle the desired for that angleimage. for The that resulting image. The error resultin is usedg toerror update is used the to weights update of the the weights CNN and of the to bringCNN theand CNN to bring output the CNNcloser tooutput the desired closer output. to the The desired weight adjustmentoutput. Th ise performedweight adjustment using a backpropagation is performed algorithmusing a backpropagationand optimizers such algorithm as the Adams, and optimizers Keras, and such Tensorflow as the Adams, libraries. Keras, It is and important Tensorflow to note libraries. that all It the is importantdata prior to trainingnote that enter all the a normalizationdata prior to traini layerng of enter the CNN, a normalization with the aim layer of makingof the CNN, training with more the aimefficient of making and reducing training the more computer’s efficient memoryand reducing usage. the computer’s memory usage.

Figure 11. DiagramDiagram for the data acquisition and training of the neural network.

The training process required a careful selection of parameters, which included the the optimizer, optimizer, batch size, number of time values, and separation of data between validation and training. Adam, Stochastic Gradient Descent (SGD), and Adadelta optimizers were usedused inin thethe didifferentfferent models.models. The loss is calculated by by training training and and validation. validation. Unlike Unlike accuracy, accuracy, loss loss is is not not a apercentage. percentage. It Itis isa summationa summation of ofthe the errors errors made made for each for each example example in trai inning training or validation or validation sets. The sets. loss The value loss is valueusually is lowerusually inlower the training in the trainingset. The important set. The important thing to take thing care to of take is that care there of is thatis no thereoverfitting is no overfitting by observing by aobserving general increase a general in the increase loss value in the instead loss value of a dec insteadrease. of The a decrease. number of The epochs number varied of epochsdepending varied on thedepending loss drop on difference, the loss drop but di allfference, the models but all were the models run between were run 12 betweenand 25 times 12 and before 25 times the loss before value the stoppedloss value decreasing. stopped decreasing. Loss values Loss are values usually are closer usually to closer0. The tolower 0. The the lower loss, thethe loss, better the the better model the (unlessmodel(unless the model the modelis overfitted is overfitted to the totraining the training data). data).The data The separation data separation was always was always the same, the same,with with70% training 70% training and 30% and validation. 30% validation. Training timestimes vary vary depending depending on theon amountthe amou of datant of and data their and resolution, their resolution, the CNN architecture, the CNN architecture,the computing the power, computing the framework power, the effi frameworciency, andk efficiency, other parameters. and other The parameters. basic architecture The basic of architecturethe navigation of the NN navigation was based NN on was the onebased proposed on the one by Bojarskiproposed [ 15by]. Bojarski The training [15]. The was training carried was out carried out on a computer with the following specifications: 6th generation of Intel i7 processor, RAM: 32 GB, GPU: Nvidia 1080 GTX,, with 8 GB dedicated memory. The training was conducted in the Appl. Sci. 2020, 10, 4400 18 of 27 on a computer with the following specifications: 6th generation of Intel i7 processor, RAM: 32 GB, GPU: Nvidia 1080 GTX, with 8 GB dedicated memory. The training was conducted in the GPU and the training times were between 14 and 32 min. The Deep Learning framework used was Keras 2.3 Appl. Sci. 2020, 10, x FOR PEER REVIEW 17 of 26 integratedAppl. Sci. 2020 with, 10, x TensorFlow FOR PEER REVIEW 1.14 running in Python. 17 of 26 GPU and the training times were between 14 and 32 min. The Deep Learning framework used was 6.4.GPU Algorithm and the Evaluationtraining times and Testingwere between 14 and 32 min. The Deep Learning framework used was Keras 2.3 integrated with TensorFlow 1.14 running in Python. KerasThe 2.3 following integrated protocol with Tensor and criteriaFlow 1.14 were running used toin validatePython. the model performance. 6.4. Algorithm Evaluation and Testing 1.6.4. AlgorithmThe trained Evaluation model must and Testing exceed 90% accuracy. The following protocol and criteria were used to validate the model performance. 2. TheThe trainedfollowing model protocol will be and given criteria a video were that used is notto validate part of the the training model performance. or validation set (Figure 12). 1. The trained model must exceed 90% accuracy. 1. a.The Thetrained evaluator model willmust check exceed the 90% quality accuracy. of the predictions. 2. The trained model will be given a video that is not part of the training or validation set (Figure 2. b.The Thetrained performance model will will be begiven graded a video on thethat di isff noerentt part stages of the of training the test track.or validation set (Figure 12).12). 3. The trained model will be tested in the modular platform. a.a. TheThe evaluator evaluator will will check check the the quality quality of of the the predictions. predictions. b. The performance will be graded on the different stages of the test track. c.b. TheThe test performance route. will be graded on the different stages of the test track. 3.3. TheThe trained trained model model will will be be tested tested in in the the modular modular platform. platform. d. A driver/evaluator will supervise the vehicle. c.c. TheThe test test route. route. e. The driver/evaluator will determine the driving speed. d.d. AA driver/evaluator driver/evaluator will will supervise supervise the the vehicle. vehicle. e.f.e. TheAutonomousThe driver/evaluator driver/evaluator steering will will will determine determine be done by the the the driving driving model. speed. speed. f.g. f. AutonomousTheAutonomous manual emergency steering steering will will stop be be buttondone done by by should the the model. model. be activated in any risk situation. g.g. TheThe manual manual emergency emergency stop stop button button should should be be activated activated inin anyany riskrisk situation.

FigureFigureFigure 12. 12.12. Stage StageStage 2 2of of a atest, test, prediction prediction of of the the model model withwith with unseenunseen unseen video.video. video.

TheTheThe information informationinformation flow flowflow starts startsstarts with withwith image imageimage acquisition acquisitionacquisition ofof the the front front camera.camera. The The next next stages stages were were performedperformedperformed in inin the thethe Nvidia NvidiaNvidia Jetson JetsonJetson AGX AGXAGX Xavier XavierXavier prep preprocessingpreprocessingrocessing and and model model operation. operation. The The model model will will predictpredictpredict a a asteering steering steering angle, angle, angle, which whichwhich will willwill later laterlater be bebe sent sentsent to to the the microcontrol microcontroller.microcontroller.ler. FigureFigure 131313 showsshowsshows this this process. process.

Figure 13. Diagram for the prediction of the steering wheel angle of the vehicle. FigureFigure 13. 13. DiagramDiagram for for the the prediction prediction of of the the st steeringeering wheel wheel angle angle of of the the vehicle. vehicle.

Appl. Sci. 2020, 10, 4400 19 of 27

7. Results and Discussion Throughout the training and data acquisition process, 13 different CNN models were trained. Each one was evaluated by the test protocol contained in Section 6.4. Table6 shows the evaluation of every model. The accuracy is obtained with the final value that Keras prints during the training. This value is calculated through the Mean Absolute Error (MAE)[54], which is expressed by the equation: Pn = abs(yi λ(xi)) MAE = i 1 − . (2) n

Table 6. Summary of the results of the training.

CNN Data Data Stage 1 Test Stage 2 Test Stage 3 Model Quantity Augmentation [Train Accuracy] [Test Data] [Real Test] 1 15,276 no 85.4% no no 2 30,552 yes 89.2% no no 3 15,276 no 87.7% no no 4 30,552 yes 91.6% poor no 5 43,157 no 92.3% regular no 6 86,314 yes 94.5% regular no 7 43,157 no 92.3% regular no 8 86,314 yes 94.5% regular/good no 9 103,363 no 93.3% good no 10 206,726 yes 94.6% good regular 11 103,363 no 93.8% very good good 12 206,726 yes 94.5% best best 13 206,726 yes 94.3% good no

The final value is the percentage of MAE that the model has with all the training data (training + validation sets). The following stages of the protocol result in more qualitative results through the observation of the model’s performance with the test video and the real trials on the test route. In the four weeks of work, three data acquisitions were performed to increase the amount of training data in search of an improvement in the prediction of the model. In the first capture, 15,276 images were acquired with their corresponding steering angles, the second reached 43,157 data points, and the last capture generated 103,363 data points. As can be seen, the efficiency of data capture between the three data acquisitions and with software and hardware corrections in the acquisition systems was improved. This improved the system performance and accuracy in predicting the angle. Another important question in the development of the models was whether or not to use data augmentation, since it was considered that it could generate noise during training. However, after evaluation it was determined that the augmentation quantitatively and qualitatively improved the performance of the model. As mentioned in the previous section, there were three test stages, each described in Section 6.4, with the results shown in Table6. Since the first four models did not meet the requirements of stage 1, the following stages were not performed. Tests in stage 2 of models 5 to 13 obtained the results shown in Figure 12. At this test stage, it was evaluated if the models made sudden accurate predictions of movement, with particular attention to the part of the main curve of the in-campus circuit. This evaluation had a qualitative nature during driving. In stage 3, it was decided to physically test the model considering the safety aspects mentioned in Section 6.4. Only the best three models passed this test. The objective was to finish the in-campus circuit with the least human intervention. As mentioned before, the speed was controlled all the time by the driver for safety purposes. Appl. Sci. 2020, 10, 4400 20 of 27 Appl. Sci. 2020, 10, x FOR PEER REVIEW 19 of 26

7.1. Best Best Model Results CNN model 13 was the one that obtained the best results in the tests, especially in stage 3 of the test, where an automated steering direction of the entire in-campus circuit was achieved with almost no human intervention intervention to to modify modify the the steering steering angle angle of of the the vehicle. vehicle. The The architecture architecture of ofthis this model model is theis the one one presented presented in section in Section 5.3. 5.3 This. This model model was was trained trained with with the Adam the Adam optimizer optimizer for 14 for epochs. 14 epochs. The Theduration duration of training of training was was 28 min 28 min and and 37 37s with s with a high a high capacity capacity computer, computer, whose whose characteristics characteristics are mentioned in Sectionsection 6.3.6.3. This This model model was was trained trained with with 206,726 206,726 images obtained by the augmentation of the 103,363 original data points with their respective steering wheelwheel angles.angles. An important important parameter parameter to toconsider consider during during training training is loss, is loss,as shown as shown in Figure in Figure14 for all 14 training for all epochs.training epochs.

Figure 14. Loss plot of model 13 during training.

The training set efficiency efficiency was verified verified by the ever-decreasing values values of of loss loss across across the the epochs. epochs. As for thethe validationvalidation set,set, aa mild mild improvement improvement was was noticed noticed but but it hadit had a mostlya mostly constant constant performance performance all allover over the the training. training. Although Although there there was was a low a improvementlow improvement in the in loss the for loss the for validation the validation set, the set, values the valuesfor the for validation the validation set are lowerset are than lower 0.02 than units. 0.02 Asunits. mentioned As mentioned above, above, a loss value a loss close value to close 0 and to with 0 and a withdecreasing a decreasing trend indicatestrend indicates a well-trained a well-trained model. mode Thel. loss The value loss value of the of validation the validation set is set higher is higher than thanthe training the training set is normal.set is normal. The important The important thing is tothing protect is to the protect model the from model overfitting from overfitting by keeping by its valuekeeping as its low value as possible as low withas possible a decreasing with a trend.decreasing trend. The platformplatform thusthus can can be be expected expected to to develop develop as plannedas planned when when the modelthe model starts starts running running as a node as a nodein the in ROS the topics, ROS topics, instead instead of being of directed being directed by the remote by the controller. remote controller. From the From loss plot, the itloss is importantplot, it is importantto note that to the note loss that value the generallyloss value declines, generally since declines, an increasing since an trendincreasing would trend suggest would overfitting suggest overfittingthe model. the model. Figure 15 shows the prediction of the steering wheel angle made by our CNN model against the ground truth obtained from the training data. This prediction was generated with one of the datasets in which it was trained in order toto observeobserve the precisionprecision obtainedobtained byby thethe model.model.

Appl.Appl. Sci. Sci.2020 2020, 10, 10, 4400, x FOR PEER REVIEW 2021 of of26 27

Appl. Sci. 2020, 10, x FOR PEER REVIEW 20 of 26

FigureFigure 15. 15.Prediction Prediction ofof thethe steering angle in in a a sample sample dataset. dataset.

AA certain certain “noise” “noise” canFigure can be be 15. observedobserved Prediction inin of the thethe prediction,steeringpredict ion,angle which in a sample is is reduced reduced dataset. by by applying applying a amoving moving averageaverage filter filter when when the the predicted predicted value value is is sent sent to to the the steering steering wheel wheel actuator. actuator. This This filter filter is is expressed expressed by theby equation: theA equation:certain “noise” can be observed in the prediction, which is reduced by applying a moving M 1 average filter when the predicted value is1 sent 1to1 Xthe− steering wheel actuator. This filter is expressed ( )=y(i)∑= 0 (x (i +j) ,), (3) (3) by the equation: M where y is the new output, x is the predicted1 output,1 j=0 and M is the number of data points used. This ( )= ∑ 0 ( ), (3) wheremodel,y isas theit is trained new output, on a fixedx is route, the predicted presents exce output,llent precision and M is with the the number data in ofthe data tests. points However, used. Thiswhereif amodel, more y is generalized the as itnew is trained output, prediction onx is a the fixedfor predicted the route, model presentsoutput, is desi andred, excellent Mit is necessarythe precision number to withofincrease data the points the data variety used. in the Thisand tests. However,model,amount as of if it training ais moretrained data. generalized on aThis fixed mo route, predictiondel obtained presents for a exce94.5% thellent model accuracy precision is desired,with with the the training it is data necessary in data. the tests.Although to increase However, other the if a more generalized prediction for the model is desired, it is necessary to increase the variety and varietymodels and had amount a higher of trainingpercent data.accuracy, This this model model obtained performed a 94.5% better accuracy in the with other the stages training of the data. amount of training data. This model obtained a 94.5% accuracy with the training data. Although other Althoughevaluation other protocol. models had a higher percent accuracy, this model performed better in the other stages models had a higher percent accuracy, this model performed better in the other stages of the of the evaluation protocol. evaluation7.2. Shadow protocol.Effects 7.2. ShadowThe training Effects set was demonstrated to be well developed. In the field, the platform behaved 7.2. Shadow Effects perfectlyThe training under similar set was conditions demonstrated to the ones to be used well for developed. training. During In the the field, week the of training platform and behaved data The training set was demonstrated to be well developed. In the field, the platform behaved perfectlyacquisition, under the similar weather conditions was cloudy. to the However, ones used it was for sunny training. during During the thepresentation. week of training This condition and data perfectlynegatively under impacted similar the conditions performanc to thee, because ones used the for shadows training. increased During the the we amountek of training of noise and in data the acquisition, the weather was cloudy. However, it was sunny during the presentation. This condition acquisition,system. An examplethe weather of these was cloudy.shadows However, can be seen it was in Figure sunny 16. during the presentation. This condition negatively impacted the performance, because the shadows increased the amount of noise in the negatively impacted the performance, because the shadows increased the amount of noise in the system.system. An An example example of of these these shadows shadows cancan bebe seenseen in Figure 16.16.

Figure 16. Examples of shadows on the day of the final presentation.

FigureFigure 16. 16.Examples Examples ofof shadowsshadows on the da dayy of of the the final final presentation. presentation. Appl. Sci. 2020, 10, 4400 22 of 27

During the presentation, the angle of the sun diminished the effect of the shadows. In order to fix the effect of the shadows, data must be additionally collected during various times and under varying weather conditions, which was not possible during the week of data collection. The platform completed the entire proposed route seen in Figure6 and completed three circuits with the only human interaction being that needed to accelerate the vehicle.

8. Conclusions Technological advancements in computing power allow for the development of more efficient, more practical, and lower cost autonomous vehicles. Several of the algorithms used today, especially in the area of Artificial Intelligence, were developed more than 50 years ago, but technological advancements allow for their implementation in this particular application. Research and development are crucial to the improvement of robust systems that can mimic human behavior. The development and improvement of electric and intelligent vehicles either for private or public use in industry or transportation services is a disruptive issue nowadays. All development must be carried out around an intelligent electromobility ecosystem. For this, the development of various vehicle platforms for different purposes must be conducted as part of this ecosystem. This is how the concept of the Automated Guided Modular Vehicle was created. Driving a vehicle is a very complex task. Therefore, the desire that a machine completes such a chore is not simple. Although autonomous driving began to have efficient implementations in the previous decade, it still has areas of improvement that this work seeks to satisfy. The algorithm of BC/IL allowed generating a practical and efficient solution in the time limit. The results were as expected: the modular AGV was able to navigate the proposed route. Even so, it is necessary to continue developing more complex models, with the option of being able to use reinforced learning or unsupervised learning. This can help generate a more complex and more efficient solution. Even so, it is important to keep the safety criteria in mind, especially if the tests are carried out in a real environment with a platform that has the ability to cause physical damage. Likewise, the use of a platform not designed in-house brought us advantages and disadvantages. There were several parts of the design that could be considered as a plug and play, which was beneficial in the process. The development of autonomous vehicles is something that technological development and the current computing is allowing to become more efficient, practical, and of lower cost. The origins of several of the algorithms used today, especially in the area of Artificial Intelligence, were developed more than 50 years ago but can be implemented in a real way thanks to the current technology. Nonetheless, development and research are needed to improve them in order to mimic human behavior more precisely. This work contains the successful implementation of a minimum system for a SAE Level 1 modular autonomous vehicle. This type of vehicle begins to be a differential in the industry and in the implementation of personal transport systems. That is why this work also contributes to the generation and development of the concept of a low-cost modular AGV, capable of driving autonomously on certain fixed routes, and been part of the current trends of mobility services and smart cities. The system is based on ROS and has hardware and software elements. Data acquisition from hardware elements with different sampling rates was achieved. Minimal data curation was performed due to the highly efficient data collection system. High- and low-level algorithms were implemented, such that they were efficient in time and computational resources. Our work contributes as a practical implementation in the controlled environment of behavioral cloning and imitation learning algorithms. The vehicle successfully navigated on a 300 m track. It evaded vehicles and potholes and drove in right-hand traffic. The most significant relevance of this work is to show that an autonomous navigation system can be implemented in diverse hardware and vehicular platforms, as long as they have a standardized software platform. This opens the opportunity to generate a test environment for other research use and contribute as an open HW-SW solution to the scientific community in the area. Appl. Sci. 2020, 10, 4400 23 of 27

Work Contributions After the development of this work, different contribution points were defined. After analyzing state-of-the-art technology, it can be observed that there are not many implementations of automated vehicles in the transportation of people or cargo. The design of the vehicle, although it was not part of this work, meets the general concept of an AGV with autonomous driving capacity level 1 and in future work, level 2. This type of vehicle begins to have a significance in the industry with an implementation in personal transport systems. This work contributes to the generation of a low-cost modular AGV capable of driving autonomously on certain fixed routes. Likewise, our work contributes as an example of a practical implementation of the BC/IL algorithm in a real environment. This algorithm has excellent capabilities and facilities that allowed the completion of the work in the 4-week limit. Even so, the algorithm needs to become more robust or be complemented in a way for it to reach higher levels of autonomy, even if these complements generate a higher cost solution.

9. Future Work The development of this work had several limitations due to the time of 4 weeks of development. Future work that improves the design and functionality of the AVG is described in the following part:

Improve the autonomous driving algorithm that allows leading with disturbances (shadows and • lights in the image), that modify the performance of the algorithm. Optimize code and hardware architecture to allow faster processing. Incorporating other • algorithms and models options with higher performance, for example, using Deep Convolutional Inverse Graphics Network (DCIGN) architectures [55]. The automation proposed in this work is limited to level 1 of the SAE scale. A future job will be able • to go up to a level 2, which allows automating the acceleration and braking of the vehicular model. An improvement in the longitudinal dynamics of the vehicle, acceleration, and braking stages are • safety aspects that must be taken into account for the improvement of the future design. The vertical dynamics of the vehicle will have to be revised to improve overall the mechanical • response of the autonomous system. In case of emergency evasion, the system must respond as fast as possible. The on-board electronics will need to be upgraded for viable operation; a Printed Circuit Board • (PCB), in order to dispose of all the wires inside the vehicle’s control box, is proposed, since this gives additional noise to the sensor measurements. The Arduino is no longer going to be used. Instead, the STM32L496ZGT6P board with the Nucleo-144 microcontroller will help have a more efficient signal control and processing. This also because of its ROS compatibility software and its ARM architecture capable of managing an 80 MHz frequency [56].

These are the highlights for improvement in the future work of the Automated Guided Modular Vehicle proposed and developed in this paper.

Author Contributions: Conceptualization, L.A.C.-R., R.B.-M., H.G.G.-H., J.A.R.-A. and E.C.G.-M.; methodology, L.A.C.-R., R.B.-M. and E.C.G.-M.; software, L.A.C.-R., R.B.-M., J.A.R.-A. and E.C.G.-M.; validation, L.A.C.-R., R.B.-M. and E.C.G.-M.; investigation, L.A.C.-R., R.B.-M., H.G.G.-H., J.A.R.-A. and E.C.G.-M.; resources, R.A.R.-M., H.G.G.-H., J.A.R.-A. and M.R.B.-B.; data curation, L.A.C.-R.; writing—original draft preparation, L.A.C.-R., R.B.-M., R.A.R.-M., E.C.G.-M. and M.R.B.-B.; writing—review and editing, L.A.C.-R., R.B.-M., H.G.G.-H., J.A.R.-A., R.A.R.-M., E.C.G.-M. and M.R.B.-B.; supervision, R.A.R.-M., H.G.G.-H., J.A.R.-A. and M.R.B.-B.; project administration, M.R.B.-B.; funding acquisition, R.A.R.-M., J.A.R.-A. and M.R.B.-B. All authors have read and agreed to the published version of the manuscript. Funding: Funding was provided by Tecnologico de Monterrey (Grant No. a01333649 and a00996397) and Consejo Nacional de Ciencia y Tecnologia (CONACYT) by the scholarship 850538 and 679120. Acknowledgments: We appreciate the support and collaboration of Miguel de Jesús Ramírez Cadena, Juan de Dios Calderón Nájera, Alejandro Rojo Valerio, Alfredo Santana Díaz and Javier Izquierdo Reyes; without their help, this project would not have been carried out. Appl. Sci. 2020, 10, 4400 24 of 27

Conflicts of Interest: The authors declare no conflict of interest.

Appendix A

Table A1. List of acronyms.

Acronym Definition Acronym Definition AD Autonomous Driving ADAS Advanced Driving Assistance System AGV Automated Guided Vehicles AI Artificial Intelligence ARM Advanced RISC Machines AV Autonomous Vehicle BC Behavioral Cloning CAN Controller Area Network CNN Convolutional Neural Network CPU Central Processing Unit DL Deep Learning DNN Deep Neural Network DRL Deep Reinforcement Learning E2E End to End FCN Fully Convolutional Network FOV Field of View GPU Graphic Processing Unit IL Imitation Learning LIDAR Laser Imaging Detection and Ranging LSTM Long-Short Term Memory ML Machine Learning NN Neural Network RAM Random Access Memory RNN Recurrent Neural Network ROS Robot Operating System SAE Society of Automotive Engineers SGD Stochastic Gradient Descent TaaS transport as a Service USB Universal Serial Bus

References

1. Curiel-Ramirez, L.A.; Izquierdo-Reyes, J.; Bustamante-Bello, R.; Ramirez-Mendoza, R.A.; de la Tejera, J.A. Analysis and approach of semi-autonomous driving architectures. In Proceedings of the 2018 IEEE International Conference on Mechatronics, Electronics and Automotive Engineering (ICMEAE), Cuernavaca, Mexico, 26–29 November 2018; pp. 139–143. 2. Mercy, T.; Parys, R.V.; Pipeleers, G. Spline-based motion planning for autonomous guided vehicles in a dynamic environment. IEEE Trans. Control Syst. Technol. 2018, 26, 6. [CrossRef] 3. Fazlollahtabar, H.; Saidi-Mehrabad, M. Methods and models for optimal path planning. Autonomous Guided Vehicles; Springer: Cham, Switzerland, 2015. [CrossRef] 4. Urmson, C.; Anhalt, J.; Bagnell, D.; Baker, C.; Bittner, R.; Dolan, J.; Duggins, D.; Ferguson, D.; Galatali, T.; Geyer, C.; et al. Tartan Racing: A Multi-Modal Approach to the DARPA Urban Challenge; DARPA: Pittsburgh, PA, USA, 2007. 5. Veres, S.; Molnar, L.; Lincoln, N.; Morice, P. Autonomous vehicle control systems—A review of decision making. Proc. Inst. Mech. Eng. I J. Syst. Control Eng. 2011, 225, 155–195. [CrossRef] 6. SAE International J3016. Available online: https://www.sae.org/standards/content/j3016_201401/ (accessed on 12 April 2020). 7. SAE International. SAE J3016: Taxonomy and Definitions for Terms Related to Driving Automation Systems for On-Road Motor Vehicles; SAE International: Troy, MI, USA, 15 June 2018; Available online: https: //saemobilus.sae.org/content/j3016_201806 (accessed on 6 January 2020). 8. Shuttleworth, J. SAE Standards News: J3016 Automated-Driving Graphic Update. 7 January 2019. Available online: https://www.sae.org/news/2019/01/sae-updates-j3016-automated-driving-graphic (accessed on 6 January 2020). 9. Koci´c,J.; Joviˇci´c,N.; Drndarevi´c,V. Sensors and sensor fusion in autonomous vehicles. In Proceedings of the 2018 26th Telecommunications Forum (TELFOR), Belgrade, Serbia, 20–21 November 2018; pp. 420–425. 10. Goodfellow, I.; Bengio, Y.; Courville, A. Deep Learning; The MIT Press: Cambridge, MA, USA, 2017; Available online: https://www.deeplearningbook.org (accessed on 5 December 2019). 11. Aggarwal, C.C. Neural Networks and Deep Learning; Springer International Publishing: Cham, Switzerland, 2018; ISBN 978-3-319-94462-3. 12. Chowdhuri, S.; Pankaj, T.; Zipser, K. MultiNet: Multi-modal multi-task learning for autonomous driving. In Proceedings of the 2019 IEEE Winter Conference on Applications of Computer Vision, Hilton Waikoloa Village, HI, USA, 7–11 January 2019. Appl. Sci. 2020, 10, 4400 25 of 27

13. Teichmann, M.; Weber, M.; Zöllner, M.; Cipolla, R.; Urtasun, R. MultiNet: Real-time joint semantic reasoning for autonomous driving. In Proceedings of the 2018 IEEE Intelligent Vehicles Symposium (IV), Changshu, Suzhou, China, 26–30 June 2018. 14. Al-Qizwini, M.; Barjasteh, I.; Al-Qassab, H.; Radha, H. Deep learning algorithm for autonomous driving using GoogLeNet. In Proceedings of the IEEE Intelligent Vehicles Symposium (IV), Redondo Beach, CA, USA, 11–14 June 2017. 15. Sengupta, S.; Basak, S.; Saikia, P.; Paul, S.; Tsalavoutis, V.; Atiah, F.; Ravi, V.; Peters, A. A review of deep learning with special emphasis on architectures, applications and recent trends. arXiv 2019, arXiv:1905.13294. [CrossRef] 16. Shrestha, A.; Mahmood, A. Review of deep learning algorithms and architectures. IEEE Access 2019, 7, 53040–53065. [CrossRef] 17. Bojarski, M.; Del Testa, D.; Dworakowski, D.; Firner, B.; Flepp, B.; Goyal, P.; Jackel, L.D.; Monfort, M.; Muller, U.; Zhang, J.; et al. End to end learning for self-driving cars. arXiv 2016, arXiv:1604.07316. 18. Bojarski, M.; Yeres, P.; Choromanska, A.; Choromanski, K.; Firner, B.; Jackel, L.; Muller, U. Explaining how a deep neural network trained with end-to-end learning steers a car. arXiv 2017, arXiv:1704.07911. 19. Teti, M.; Barenholtz, E.; Martin, S.; Hahn, W. A systematic comparison of deep learning architectures in an autonomous vehicle. arXiv 2018, arXiv:1803.09386. 20. Schikuta, E. Neural Networks and Database Systems; University of Vienna, Department of Knowledge and Business Engineering: Wien, Austria. arXiv 2008, arXiv:0802.3582. 21. Roza, F. End-to-End Learning, the (Almost) Every Purpose ML Method. Towards Data Science, Medium. 31 May 2019. Available online: https://towardsdatascience.com/e2e-the-every-purpose-ml-method- 5d4f20dafee4 (accessed on 15 January 2020). 22. Torabi, F.; Warnell, G.; Stone, P. Behavioral Cloning from Observation; The University of Texas at Austin, U.S. Army Research Laboratory: Austin, TX, USA. arXiv 2018, arXiv:1805.01954. 23. Sallab, A.E.; Abdou, M.; Perot, E.; Yogamani, S. Deep reinforcement learning Framework for autonomous driving. In Proceedings of the IS&T International Symposium on Electronic Imaging 2017, Hyatt Regency San Francisco Airport Burlingame, Burlingame, CA, USA, 29 January–2 February 2017. [CrossRef] 24. Fridman, L.; Jenik, B.; Terwilliger, J. Deeptraffic: Crowdsourced hyperparameter tuning of deep reinforcement learning systems for multi-agent dense traffic navigation. arXiv 2019, arXiv:1801.02805. 25. Sallab, A.E.; Abdou, M.; Perot, E.; Yogamani, S. End-to-end deep reinforcement learning for lane keeping assist. arXiv 2016, arXiv:1612.04340. 26. Shalev-Shwartz, S.; Shammah, S.; Shashua, A. Safe, multi-agent, reinforcement learning for autonomous driving. arXiv 2016, arXiv:1610.03295. 27. Ramezani Dooraki, A.; Lee, D.-J. An end-to-end deep reinforcement learning-based intelligent agent capable of autonomous exploration in unknown environments. Sensors 2018, 18, 3575. [CrossRef] 28. Wu, K.; Abolfazli Esfahani, M.; Yuan, S.; Wang, H. Learn to steer through deep reinforcement learning. Sensors 2018, 18, 3650. [CrossRef][PubMed] 29. Zhang, J.; Cho, K. Query-efficiente imitation learning for end-to-end autonomous driving. arXiv 2016, arXiv:1605.06450. 30. Pan, Y.; Cheng, C.; Saigol, K.; Lee, K.; Yan, X.; Theodorou, E.A.; Boots, B. Agile autonomous driving using end-to-end deep imitation learning. arXiv 2019, arXiv:1709.07174. 31. Tian, Y.; Pei, K.; Jana, S.; Ray, B. DeepTest: Automated testing of deep-neural-network-driven autonomous cars. In Proceedings of the IEEE/ACM 40th International Conference on Software Engineering (ICSE), Gothenburg, Sweden, 27 May–3 June 2018. 32. Xu, H.; Gao, Y.; Yu, F.; Darrell, T. End-to-end learning of driving models from large-scale video datasets. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017. Appl. Sci. 2020, 10, 4400 26 of 27

33. Cortes Gallardo-Medina, E.; Moreno-Garcia, C.F.; Zhu, A.; Chípuli-Silva, D.; González-González, J.A.; Morales-Ortiz, D.; Fernández, S.; Urriza, B.; Valverde-López, J.; Marín, A.; et al. A comparison of feature extractors for panorama stitching in an autonomous car architecture. In Proceedings of the 2019 IEEE International Conference on Mechatronics, Electronics and Automotive Engineering (ICMEAE), Cuernavaca, Mexico, 26–29 November 2019. 34. Riedmiller, M.; Montemerlo, M.; Dahlkamp, H. Learning to drive a real car in 20 minutes. In Proceedings of the 2007 Frontiers in the Convergence of Bioscience and Information Technologies, Jeju City, Korea, 11–13 October 2007; pp. 645–650. 35. Pomerleau, D.A. ALVINN: An Autonomous Land Vehicle in a Neural Network; Technical Report CMU-CS-89-107; Carnegie Mellon University: Pittsburgh, PA, USA, 1989. 36. Lecun, Y.; Cosatto, E.; Ben, J.; Muller, U.; Flepp, B. DAVE: Autonomous Off-Road Vehicle Control Using End-to-End Learning; DARPA-IPTO: Arlington, VA, USA, 2004. 37. Koci´c,J.; Joviˇci´c,N.; Drndarevi´c,V. Driver behavioral cloning using deep learning. In Proceedings of the 17th International Symposium INFOTEH-JAHORINA (INFOTEH), East Sarajevo, Republika Srpska, 21–23 March 2018; pp. 1–5. 38. Haavaldsen, H.; Aasbo, M.; Lindseth, F. Autonomous vehicle control: End-to-end learning in simulated urban environments. arXiv 2019, arXiv:1905.06712. 39. Koci´c,J.; Joviˇci´c,N.; Drndarevi´c,V. An end-to-end deep neural network for autonomous driving designed for embedded automotive platforms. Sensors 2019, 19, 2064. [CrossRef] 40. Bechtel, M.G.; McEllhiney, E.; Kim, M.; Yun, H. DeepPicar: A low-cost deep neural network-based autonomous car. arXiv 2018, arXiv:1712.08644. 41. Curiel-Ramirez, L.A.; Ramirez-Mendoza, R.A.; Carrera, G.; Izquierdo-Reyes, J.; Bustamante-Bello, M.R. Towards of a modular framework for semi-autonomous driving assistance systems. Int. J. Interact. Des. Manuf. 2019, 13, 111. [CrossRef] 42. Mehta, A.; Adithya, S.; Anbumani, S. Learning end-to-end autonomous driving using guided auxiliary supervision. arXiv 2018, arXiv:1808.10393. 43. Navarro, A.; Joerdening, J.; Khalil, R.; Brown, A.; Asher, Z. Development of an autonomous vehicle control strategy using a single camera and deep neural networks. In SAE Technical Paper; SAE: Warrendale, PA, USA, 2018; No. 2018-01-0035. 44. Pan, X.; You, Y.; Wang, Z.; Lu, C. Virtual to real reinforcement learning for autonomous driving. arXiv 2017, arXiv:1704.03952. 45. Chen, C.; Seff, A.; Kornhauser, A.; Xiao, J. DeepDriving: Learning affordance for direct perception in autonomous driving. In Proceedings of the IEEE International Conference on Computer Vision, Santiago, Chile, 7–13 December 2015. 46. Curiel-Ramirez, L.A.; Ramirez-Mendoza, R.A.; Izquierdo-Reyes, J.; Bustamante-Bello, R.; Tuch, S.A.N. Hardware in the loop framework proposal for a semi-autonomous car architecture in a closed route environment. Int. J. Interact. Des. Manuf. 2019, 13, 111. [CrossRef] 47. Huval, B.; Wang, T.; Tandon, S.; Kiske, J.; Song, W.; Pazhayampallil, J.; Andriluka, M.; Rajpurkar, P.; Migimatsu, T.; Cheng-Yue, R.; et al. An empirical evaluation of deep learning on highway driving. arXiv 2015, arXiv:1504.01716. 48. Viswanath, P.; Nagori, S.; Mody, M.; Mathew, M.; Swami, P. End to end learning based self-driving using JacintoNet. In Proceedings of the 2018 IEEE 8th International Conference on Consumer Electronics (ICCE), Berlin, Germany, 2–5 September 2018. 49. Jing-Shan, Z.; Xiang, L.; Zhi-Jing, F.; Dai, J. Design of an ackermann-type steering mechanism. Inst. Mech. Eng. J. Mech. Eng. Sci. 2013, 227, 2549–2562. 50. Srivastava, N.; Hinton, G.; Krizhevsky, A.; Sutskever, I.; Salakhutdinov, R. Dropout: A simple way to prevent neural networks from overfitting. J. Mach. Learn. Res. 2014, 15, 1929–1958. 51. Kingma, D.P.; Adam, J.B. A method for stochastic optimization. Cornell University, Computer Science, Machine Learning. In Proceedings of the 3rd International Conference of Learning Representations, San Diego, CA, USA, 7–9 May 2015. Appl. Sci. 2020, 10, 4400 27 of 27

52. ROS.org. Robotic Operating System Melodic Morenia. Available online: http://wiki.ros.org/melodic (accessed on 25 November 2019). 53. TensorFlow Core, Keras Documentation. Python. March 2015. Available online: https://keras.io/ (accessed on 5 October 2019). 54. Sammut, C.; Webb, G.I. Mean absolute error. In Encyclopedia of Machine Learning; Springer: Boston, MA, USA, 2011. 55. Kulkarni, T.D.; Whitney, W.; Kohli, P.; Tenenbaum, J.B. Deep Convolutional Inverse Graphics Network; Cornell University: Ithaca, NY, USA, March 2019. 56. STMicroelectronics. NUCLEO-L496ZG. Available online: https://www.st.com/en/evaluation-tools/nucleo- l496zg.html (accessed on 10 January 2020).

© 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).