Autonomous driving technology has been a particular interest for both industrial and research communities in the last a few years. Baidu, one of the leading companies in this field, has been putting great efforts into building an open community with its open-source self-driving solution since 2017 [1, 2, 3]. With years’ development (Baidu began its autonomous driving research since 2013), we had tested hundreds of vehicles with tens of thousand hours and with multiple generations of algorithms. As the number of deployed vehicles keeps increasing, we soon found that manually calibrating (we only refer to longitudinal vehicle dynamics calibration in this paper) each vehicle is infeasible. Manual calibration involves considerable labours, which, in other words, predicts large amount of time and great potential for man-made mistakes. Further, vehicle dynamics usually vary noticeably during driving (i.e. loads changes, vehicle parts worn out over time, surface friction ), and manual calibration cannot possibly cover them. Taken together, it is surprising that most research papers did not attempt to address this manual-calibration puzzle. One could attribute this to the fact that most research-oriented projects only focus on very few vehicles. To solve this industrial-specific problem, in this paper we propose a novel auto-calibration (for longitudinal dynamics) system based on both offline model and online learning.
Previous researches have investigated longitudinal control algorithms extensively, and regarded it as a challenging problem [5, 6, 7]. One major challenge lies in a mission impossible — to establish an accurate longitudinal vehicle dynamics in real time [8, 9, 10]. A control model with accurate longitudinal vehicle dynamics bridges gap between desired speeds and vehicle throttling/braking commands. A popular solution is to establish this state-space relation based on Newton formula [11, 12, 13, 14]. However, transmission system, power-train system, and actuator system are all very complex. It is not only difficult to model all these systems but also it requires unacceptable computing time as more systems involved.
In this paper, we address this challenging topic from another perspective. We consider the entire longitudinal control algorithm as an end-to-end problem, which can be solved in two steps: (1) Based on human driving data, we first generate a calibration table, which takes throttle, brake, and speed as inputs, and outputs acceleration. (2) Then a sophisticated on-line algorithm updates the table to properly cover the varying vehicle dynamics. Our results show that the auto-calibration system does save considerable amount of time and improves control accuracy. The calibration is also automated and intelligent, due to which, is suitable for mass-scale self-driving vehicle deployment.
Ii-a Apollo Autonomous Driving Control Module
Before launching into the methodological detail of this paper, it is useful to briefly review the current architecture of Apollo control module. Apollo control module is designed to track trajectories generated by Apollo planning module, and minimize tracking errors. It takes trajectory, vehicle position, and vehicle status as inputs, and sends steering, braking, and throttling commands to manipulate vehicle. Apollo control module includes lateral algorithm (which generates steering commands) and longitudinal algorithm (which generates braking/throttling commands), see Fig.1 for details. The longitudinal calibration algorithm, the topic of this paper, calculates throttle/brake values in the form of Eq. 1. Note that acceleration () and speed () are known variables given by longitudinal algorithm. This table hence simply maps () to throttling/braking commands (). An offline auto-calibration algorithm is used to generate an initial table for each vehicle. To cover varying vehicle dynamics, Apollo control module compensates offline table with an online learning algorithm. Together, the offline model and online algorithm guarantee the stability and accuracy of Apollo control module.
where refers to calibration table, is desired acceleration, is current vehicle speed, and is control command, i.e. throttling/braking value.
Ii-A1 Offline Model
Offline model generates an initial calibration table from manual driving data that best reflects vehicle longitudinal performance at the time of driving. The workflow of offline algorithm includes: (1) collecting human driving data, (2) preprocessing the data and select input features, (3) generating calibration table through machine learning models.
Ii-A2 Online Learning
Online algorithm instantly adjusts the offline table based on real-time feedback in self-driving mode. It aims to best match current vehicle dynamics based on offline model established from manual driving data. Several challenges this algorithm has to handle includes frequent vehicle load changes and mechanical components fatigue in the long run. The workflow of online algorithm includes: (1) collecting vehicle status and feedback in real time, (2) preprocessing and filter data, (3) adjusting calibration table accordingly.
Ii-B Data Preprocessing
Since real-world data always comes with noises, it is essential to preprocess data for both offline model and online learning algorithm. Note that due to different data sources, separate data preprocessing methods are used for offline model and online learning algorithm.
Ii-B1 Offline Model Data Preprocessing
Offline model takes human driving data as input. Throttling/braking values, speed, and longitudinal acceleration are chosen as features for this model. Note that throttling model and braking model are trained separately.
Since human driving data are naturally noisy and non-uniform (i.e. speed/acceleration does not distribute evenly during driving), Apollo control module takes a few steps to clean the data. First, a mean filter in Eq. 2 is used to smooth data. Further, Eq. 3 is applied to remove data with lateral swing. Last but not least, Eq. 4
is enforced to remove outliers.
where is the mean filter window size, , , , are data from time to .
where refers to steering wheel angle, refers to steering wheel angle threshold.
where is data to be processed, is mean of the data,
is standard deviation of the data.
Ii-B2 Online Learning Data Preprocessing
Online learning algorithm frequently adjusts calibration table built by offline model, on the basis of real-time vehicular status feedback in self-driving mode. The selected features for this algorithm are: a) throttling/braking commands; b) speed; c) desired acceleration; d) actual acceleration.
Again, only data complying with Eq. 3 are used. Meanwhile, since certain differential techniques are involved (see next Section for details), we use Eq. 5 to guarantee monotonicity throughout sequences of control commands.
where refers to updated calibration table; indexes the acceleration corresponding to control command and speed .
As to real-time data acquisition, one would expect a response delay (i.e. the time between throttling/braking commands being sent and corresponding acceleration being executed) caused by vehicular actuator. Such delay inevitably affects the quality of data, a common and useful technique is to collect data from sensors with a reasonable delay estimation. In our case, we take acceleration measured by IMU (Inertial Measurement Unit), 200 milliseconds after sending throttling/braking command, as the actual acceleration driven by that command. A Butterworth low pass filter, with an order of 3 and cutoff frequency of 2 Hz, is then used to remove high-frequency fluctuations. In case that 200 milliseconds’ delay estimation may not always be appropriate, Eq. 6 is used to further ensure data consistency.
where is the control command to be updated, i.e. command applied 200 milliseconds ago; is control command at time ; is the maximal command perturbations allowed. Note that is to be processed only if every element within its neighbourhood [, ] satisfies Eq. 6. Finally, Eq. 7 is enforced on sensor data (, ) to remove senseless noises.
Ii-C Offline Model Algorithm
Pseudo Algorithm 1 illustrates the procedure of offline model training process. Data is first preprocessed as described in Section II-B1 (Line II-C to Line II-C), after which, different models for throttling and braking are constructed (Line II-C to Line II-C
). A standard three-layer feedforward neural network is used in offline algorithm model, with a sigmoid function as the activation function and mean square error as the cost function. The network is built using Tensorflow with a build-in Adam optimizer. In comparison, we have evaluated multiple traditional machine learning regression methods for offline model:
These methods were implemented and evaluated with WEKA . Detailed settings and parameters can be found in WEKA.
Ii-D Online Learning Algorithm
For each control cycle, online learning algorithm updates calibration table based on real-time vehicular feedback. Once adjusted, new table takes effect immediately from the next control cycle. Pseudo Algorithm 2 gives the implementation detalis of real-time calibration process.
where is current speed error, is expected speed, is vehicle actual speed and is the threshold.
where is expected acceleration, is actual acceleration collected from sensors like IMU with delay estimation. To update calibration table , a cost function described by Eq. 10 is used for each table grid .
where refers to distance decay coefficient written as Eq. 11:
where and refer to control command decay coefficient and speed decay coefficient, respectively. Both and are distance decay factors. is set to and is written as Eq. 12.
Apart from distance factor, similarity cost () is defined as Eq. 13. Generally, similarity cost intends to preserve the original table. This is because we assume that initial table is reasonably accurate and should not be modified significantly during any short time.
where is similarity decay coefficient, and is exponential decay factor. Taken together, the update gain is calculated as Eq. 14:
where is learning ratio.
|Lincoln MKZ||Neolix AX1|
Iii-a Test Vehicles
Two types of vehicles (Table I) were used to test the performance under different algorithms: (1) hybrid passenger vehicle — Lincoln MKZ; (2) electronic delivery-only vehicle — Neolix AX1  111For Neolix AX1, manual driving refers to remote control via a joystick..
|Gaussian Process Regression||0.464||0.618||0.477||0.633|
|Support Vector Machine||0.465||0.615||0.471||0.621|
Iii-B Offline Model Evaluation
Offline model was tested on Lincoln MKZ with cross validation and road performance. In this section, test vehicles were put to a medium load, e.g. two passengers plus standard on-board equipments, around 200 kg in total.
Lincoln MKZ has more complex powertrain systems than Neolix AX1. Hence, if the offline calibration model works fine on Lincoln MKZ it should work well on Neolix AX1 too (and it does, see next Section).
Iii-B1 Cross Validation
Among all algorithms tested, Gaussian process regression, linear regression, and support vector machine were first ruled out due to their poor performance. Random Forest performed considerably better, but best results were obtained using neural network, which, in general, was able to achieve an accuracy within 3%, compared to effective range for throttling and effective range for braking. Taken together, neural network was chosen as the offline calibration model.
Iii-B2 Calibration Table View
Figure 2 intuitively shows a calibration table modeled by the offline algorithm, where neural network is the modeling algorithm with the same dataset in Section III-B1. Figure (a)a and (b)b indicate that both the command-acceleration relation and speed-acceleration relation are close to monotonicity, as one may expect.
Iii-B3 Road Performance
Usually, algorithms working fine under laboratory conditions with given inputs do not necessary mean they would have the same level of performance in actual industrial environments. In Baidu, we take road performance very seriously. After all, our algorithms will be implemented on numberless vehicles, including but not limited to our own 100+ vehicles. We used speed error and station error to exam road performance: (1) speed error = desired speed - actual speed; (2) station error = expected location - actual location.
|Manual Calibration||Auto Offline Calibration|
|Speed MAE ()||Station MAE ()||Speed MAE ()||Station MAE ()|
The offline calibration algorithm was first deployed on a Lincoln MKZ with a standard Baidu Apollo driving solution. We then compared road performance between manual calibration222Manual calibration table was generated using Apollo calibration tools. and offline auto-calibration algorithm. Ten rounds of road tests, each of which consists of 30 minutes with maximum speed at 10 , were run for both control group (manual calibration) and experimental group (offline auto-calibration).
The results show that offline auto-calibration model and manual calibration almost performed equivalently on speed error (Table III). As to station error, however, offline auto-calibration model performed considerably better (Table III).
Table IV shows more results on randomly selected vehicles (all Lincoln MKZ) for offline auto-calibration model only. It is clear that the offline model performed similarly across different vehicles, which proves its robustness.
|Speed ()||Station ()|
Iii-C Online Algorithm Evaluation
For online calibration tests, a Neolix AX1 (a delivery-only vehicle, maximum speed at 3 ) was used. During tests, an offline calibration table was first built at dead load (0 kg), then online calibration algorithm started adjusting the table at dead load, 150 kg load, 300 kg load, and 360 kg load (20% overload). One would expect small speed/station errors across all loads with online calibration enabled.
|With online-calibration||Without online-calibration|
|With online-calibration||Without online-calibration|
Iii-C1 Road Performance
Three repeated rounds were set for the test vehicle at each load, with each round consisting of 15 minutes’ autonomous driving. Results can be found in Table V and Table VI. Online calibration outperformed the offline one at almost every load, suggesting that online calibration algorithm did adjust the initial table appropriately. Interestingly, improvement on station error again outweighed that on speed error, similar to the results of offline calibration tests. This might due to the fact that commands (throttling/braking) generated from the table only directly affects acceleration. Any error on acceleration will be amplified twice to station error (since station error is second integration of acceleration error).
Figure 3 shows speed/station error per frame during a typical round at full load (300 kg). Without online calibration, the vehicle’s speed fluctuated considerably, with peak value around -2.0 . Conversely, the vehicle was able to maintain a relatively steady speed with online calibration. Similar pattern can also be found on station error.
Iii-C2 Calibration Table View
A table before and after calibration is available in Appendix in Section V-A. Note that before calibration the table was simply an initial calibration table built from manual driving data at dead load. Then the vehicle was put at 300 kg load and run for approximately 30 minutes and a new table was generated after thousands of real-time adjustments.
From the updated table, it is clear that same throttling/braking commands lead to lower acclerations/decelerations. This suggests that the vehicle’s ability of accleration/deceleration is reduced, exactly matching what one would expect when a vehicle is at full load.
Iii-D Computational complexity
Offline calibration model requires less than ten seconds on a Dell Precision 7510 workstation to build an initial calibration table. On an industrial standard Nuvo-5095GC machine, online calibration takes less than 2 milliseconds to complete adjustment on calibration table per cycle. It is also possible to parallelize the computation of grid updating during online calibration, since each grid in a table is independent of other grids .
In this manuscript, we presented a longitudinal control calibration algorithm, consisting of an offline calibration model and an online calibration algorithm. For the offline calibration model, we have tested quite a few machine learning techniques (see Table II) and eventually found an end-to-end solution (neural network). We have also tried numberless data preprocessing methods to obtain clean and useful data out of massive amount of data and noises (see Section II-B). Contrary to offline calibration, we chose a model-free method for online calibration. Specifically, online calibration was implemented in a gradient-descent way (see Section II-D). Since online calibration runs at high frequency (i.e. 100 Hz in our case), gradient-descent is a more reliable way to update calibration table, without the risk of choosing a wrong model.
The results show that with calibration enabled, our test vehicles performed significantly better as to control accuracy (speed/station error). What is more, the algorithm has been deployed to multiple Baidu Apollo autonomous driving vehicles, including standard hybrid family vehicles and electronic delivery-only vehicles. As of August 27th 2018, it had been tested more than two thousands hours, with around ten thousands kilometers’ (6,213 miles) road tests.
Finally, we would like to end with Baidu Apollo slogan: We choose to go to the moon in this decade and do the other things, not because they are easy, but because they are hard. — John F. Kennedy.
Baidu Apollo autonomous driving platform is designed to target one of the most challenging problems in the field of artificial intelligence. We, the Apollo Community, will continue delivering systems that can free drivers’ hands.
-  Apollo Auto, https://github.com/ApolloAuto/apollo.
-  Fan, H., et al. ”Baidu Apollo EM Motion Planner.” arXiv preprint arXiv:1807.08048 (2018).
-  Fan, H., et al. ”An Auto-tuning Framework for Autonomous Vehicles.” arXiv preprint arXiv:1808.04913 (2018).
-  Canudas-de-Wit, C., et al. ”Dynamic friction models for road/tire longitudinal interaction.” Vehicle System Dynamics 39.3 (2003): 189-226.
-  Khodayari, A., et al. ”A historical review on lateral and longitudinal control of autonomous vehicle motions.” Mechanical and Electrical Technology (ICMET), 2010 2nd International Conference on. IEEE, 2010.
-  Rajamani, R. ”Vehicle dynamics and control.” Springer Science & Business Media, 2011.
-  Pack, R.T., et al. ”System and method for behavior based control of an autonomous vehicle.” U.S. Patent 8,078,338, iRobot Corp, 2011.
-  Chen, Y. and Wang, J. ”Adaptive vehicle speed control with input injections for longitudinal motion independent road frictional condition estimation.” IEEE Transactions on Vehicular Technology, 60(3), pp.839-848, 2011
-  Falcone, et al. ”A linear time varying model predictive control approach to the integrated vehicle dynamics control problem in autonomous systems.” In Decision and Control, 2007 46th IEEE Conference on (pp. 2980-2985). IEEE, 2007, December.
-  Martinez, J.J. and Canudas-de-Wit, C. ”A safe longitudinal control for adaptive cruise control and stop-and-go scenarios.” IEEE Transactions on control systems technology, 15(2), pp.246-258, 2007
-  Bageshwar, et al. ”Model predictive control of transitional maneuvers for adaptive cruise control vehicles.” IEEE Transactions on Vehicular Technology, 53(5), pp.1573-1585, 2004
-  Levinson, J., ”Towards fully autonomous driving: Systems and algorithms.” In Intelligent Vehicles Symposium (IV), 2011 IEEE (pp. 163-168). IEEE, 2011, June.
-  Raffo, G.V., et al. ”A predictive controller for autonomous vehicle path tracking.” IEEE transactions on intelligent transportation systems, 10(1), pp.92-102, 2009.
-  Attia, R., et al. ”Combined longitudinal and lateral control for automated vehicle guidance.” Vehicle System Dynamics 52.2 (2014): 261-279.
-  Kim, H., et al. ”Mode transition control using disturbance compensation for a parallel hybrid electric vehicle.” Proceedings of the Institution of Mechanical Engineers, Part D: Journal of Automobile Engineering, 225(2), pp.150-166, 2011.
-  Bayindir, K.Ç., et al. ”A comprehensive overview of hybrid electric vehicle: Powertrain configurations, powertrain control techniques and electronic control units.” Energy Conversion and Management, 52(2), pp.1305-1313, 2011.
-  Del Re, L., et al. ”Automotive model predictive control: models, methods and applications (Vol. 402).” Springer, 2010.
-  Nam, K, et al. ”Wheel slip control for improving traction-ability and energy efficiency of a personal electric vehicle.” Energies 8.7 (2015): 6820-6840.
-  Wu, C., et al. ”A fuel economy optimization system with applications in vehicles with human drivers and autonomous vehicles.” Transportation Research Part D: Transport and Environment, 16(7), pp.515-524, 2011.
-  Nelles, O. ”Nonlinear system identification: from classical approaches to neural networks and fuzzy models.” Springer Science & Business Media, 2013.
-  Sukkarieh, S., et al. ”A high integrity IMU/GPS navigation loop for autonomous land vehicle applications.” IEEE Transactions on Robotics and Automation 15.3 (1999): 572-578.
-  Rasmussen, C. ”Gaussian processes in machine learning.” Advanced lectures on machine learning. Springer, Berlin, Heidelberg, 2004. 63-71.
-  Zhu, F., et al. ”Computed tomography perfusion imaging denoising using Gaussian process regression.” Physics in Medicine & Biology 57.12 (2012): N183.
-  Zhu, F., and Yuanfang Guan. ”Predicting dynamic signaling network response under unseen perturbations.” Bioinformatics 30.19 (2014): 2772-2778.
-  Sieberts, S. K., et al. ”Crowdsourced assessment of common genetic contribution to predicting anti-TNF treatment response in rheumatoid arthritis.” Nature communications 7 (2016): 12460.
-  Zhu, F., et al. ”COMPASS: A computational model to predict changes in MMSE scores 24-months after initial assessment of Alzheimers disease.” Scientific reports 6 (2016): 34567.
-  Hearst, M. A., et al. ”Support vector machines.” IEEE Intelligent Systems and their applications 13.4 (1998): 18-28.
-  Quinlan, J. R. ”Learning with continuous classes.” 5th Australian joint conference on artificial intelligence. Vol. 92. 1992.
-  Breiman, L., ”Random forests.” Machine learning 45.1 (2001): 5-32.
-  Hall, M., et al. ”The WEKA data mining software: an update.” ACM SIGKDD explorations newsletter 11.1 (2009): 10-18.
-  Neolix AX1, https://www.neolix.cn.
-  Zhu, F., et al. ”Parallel perfusion imaging processing using GPGPU.” Computer methods and programs in biomedicine 108.3 (2012): 1012-1021.
V-a Calibration Table View
Figure A.1 illustrates the calibration table before and after the online calibration. As there is no ground truth for calibration table, whether the updating changes suit our expectation is the criteria here.
Take 20 percent of throttle command as an example, it is able to generate an acceleration around 0.5 in the initial table, which is inferred without any load. After online calibrating, system determines that a 20 percent of throttle is only able to generate a slightly bigger than zero acceleration, as one may expected.