All experiments have been performed on AMD Ryzen 7 5000 series CPU with 16 GB RAM. For the RC car experiments, it is equipped with a Lidar, a depth dual camera, an IMU and wheel encoders. We however use the Vicon based localization to get an accurate position and orientation of the vehicle with high accuracy (of about 1 cm and 0.01 rad).
We first present all the results from numeric simulation
The tracks along with the racing lines used for the experiments are as follows :-
Track |
Rendered racelines at :-
\(\mu=0.6\) | \(\mu=0.7\) | \(\mu=0.8\) | \(\mu=0.9\) | \(\mu=1.0\) |
Track |
Rendered racelines at :-
\(\mu=0.6\) | \(\mu=0.7\) | \(\mu=0.8\) | \(\mu=0.9\) | \(\mu=1.0\) |
To demonstrate that our proposed ELM model can really learn from dynamics data and to get an idea of how much data is required to train a reasonable model, we perform this offline validation where we collect training data by running single lap on a ETHZMobil Track with pure pursuit for steering and PID for longitudinal control :-
We use this data to train ELM models offline and also train GP models as proposed in BayesRace work for comparison. Then, we make a run with NMPC using actual model parameters to run 1 lap on ETHZ track and use the trained models to predict difference in $vx$, $vy$ and $\omega$ between the actual values and the e-kinematic model. Here are the plots for $vx$, $vy$ and $\omega$ predictions for both ours and BayesRace against GT values.
vx | vy | $\omega$ |
As can be seen the predictions from both GP (from BayesRace) and our proposed ELM model are nearly close to the GT with training data used from only 1 lap of training data with limiting speeds (Note that the predictions are not very close if the training data is collected at low speeds with little lateral slips). This suggests that our proposed ELM is indeed as good as (if not worse) using GP for predicting difference between actual and e-kinematic model of the vehicle. But the obvious advantage of using our ELM is that it’s can be trained in an adaptive manner and with very less computation time allowing it to update online while GP’s training time is huge and it scales with more training data. One way to get rid of increaing computation on data size is to use only last few samples for training but it needs to be trained each time for each cycle due to which it contributes larger computation time for each cycle. Also, ELM has significantly less non-linearity which allows us to use it in building a real-time NMPC controller with only around 0.05 $\pm$ 0.02 s computation time while GP takes about 0.3s $\pm$ 0.05s practically on our machine when used online (and even offline it takes 0.25s on avg as also reported by BayesRace) with IPOPT optimization. Also, with estimated tire curve from ELM, we can even estimate the tire friction coefficient by taking the max value of the prediction while for GP we need to use an estimator separately.
This is to simulate wear and tear of the tires. We reduce the friction coefficients \(D_f\) and \(D_r\) according to the following plot :-
time vs $D_f/D_r$ variation |
The resultant trajectory, speed and \(\mu\) (used to render raceline reference speeds) plots for different algorithms are as follows :-
Method | Trajectory | Speeds | \(\mu\) used for raceline |
---|---|---|---|
Without any adaptation | Same as beginning (\(\mu=1.0\)) | ||
With only model adaptation | Same as beginning (\(\mu=1.0\)) | ||
With model + reference speed adaptations (ours) | |||
With GP for model difference | Same as GT | ||
Oracle | Same as GT |
Here is the video comparison with 3 runs (without adaptation, with only model adaptation, with model + reference speed adaptation) in parallel :-
We reduce the friction coefficients \(D_f\) and \(D_r\) according to the following plot :-
time vs \(D_f/D_r\) variation |
The resultant trajectory, speed and \(\mu\) (used to render raceline reference speeds) plots for different algorithms are as follows :-
Method | Trajectory | Speeds | \(\mu\) used for raceline |
---|---|---|---|
Without any adaptation | Same as beginning (\(\mu=1.0\)) | ||
With only model adaptation | Same as beginning (\(\mu=1.0\)) | ||
With model + reference speed adaptations (ours) | |||
With GP for model difference | Same as GT | ||
Oracle | Same as GT |
Next, to test how our method would perform if there is a suddent drop in maximum friction parameter which can be caused for example by sudden rain/change in weather condition etc., we suddenly drop the friction coefficient by about 30\% at a given time according to the given plot :-
time vs \(D_f/D_r\) variation |
Method | Trajectory | Speeds | \(\mu\) used for raceline |
---|---|---|---|
Without any adaptation | Same as beginning (\(\mu=1.0\)) | ||
With model + reference speed adaptations (ours) |
Method | Trajectory | Speeds | \(\mu\) used for raceline |
---|---|---|---|
Ours (on higher friction decline rate) | |||
Ours (on moderate friction decline rate) | |||
Ours (on less friction decline rate) |
To demonstrate our algorithm working on a high fidelity simulator in realtime with full sized car, we deploy it on Carla simulator. Deploying on a simulator gives us additional confidence in terms of the performance guarantee in presence of sensor and model noise. We use the following trackmap (Town07) :-
Town07 map |
We use Audi TT car in Carla as follows
Car used for simulation |
We start with the default model parameters as defined in Carla and reduce the tire_friction parameter (which is the coefficient of friction of the tire) of the vehicle linearly as described below :-
For offline validation, we check the lateral and longitudinal forces from the trained model on one lap of data and compare them to the lateral and longitudinal force values obtained from the simulator. As shown in Fig. \ref{fig:offline_val_carla}, although these values are noisy, our trained model archives high fitting accuracy. This is to ensure that the fitted tire curves from offline collected data just from the trajectory data actually confirms with the actual force recorded by carla simulator (available from privileged forces on tyres from carla). We also present the difference in vx, vy and $\omega$ wrt the e-kinematic model.
slip vs force (Predicted (line) vs recorded (scatter)) |
For the online run, we set $\alpha=0.002, \gamma=0.9, \mu_{start} = 1.0, K_{batch} = 2000, t_{th}=44s, n_h=40, N=50, Q=\begin{bmatrix} 0.1 & 0 \ 0 & 0.1 \end{bmatrix}, R = \begin{bmatrix} 0.005 & 0 \ 0 & 1 \end{bmatrix}$. The run plots for without adaptation are as follows :-
Trajectory | |
---|---|
Speeds | |
$\mu$ taken to get raceline | Same as at the beginning ($\mu=1$) |
As can be seen from the speed plot, the car crashes at about 120s. The plots for with adaptation are as follows :-
Trajectory | |
---|---|
Speeds | |
$\mu$ taken to get raceline |
The trajectory plots may not be visible clearly due to large track size. The video of the runs help to observe the results more clearly :-
Finally, we test our algorithm on a real RC car to demonstrate working on a real system with real sensor, model noises and that we can implement in realtime. The car is equipped with a Lidar, a depth dual camera, an IMU and wheel encoders.
RC car hardware |
Despite the onboard computation available, we use a windows machine with 16 GB RAM, AMD Ryzen 5000 processor for computation which also runs the Vicon tracker software for localization and communicate the commands directly to the vehicle
We perform the experiment on 2 track as shown below. The lane width is about 0.5 m. The reference line is taken to be the centerline with limiting speeds rendered according to \cite{doi:10.1080/00423114.2019.1631455}. The speeds are adjusted according to the estimated friction coefficient. We conduct the experiment by starting a friction coefficient equal to $1.5$ and incrementally increase target speeds from $50\%$ of the reference speeds to $100\%$ of the reference speeds from $t=10s$ to $t=35s$. This is to ensure physical safety and also allow sufficient time and data for the adaptation algorithm to estimate the friction and aerodynamic parameters.
Oval track | Diamond track |
The trajectories followed if adaptation is used vs not used are as follows :-
Method | Trajectory | \(\mu\) used for raceline |
---|---|---|
Without adaptation | Same as beginning (\(\mu=1.5\)) | |
With model + reference speed adaptations (ours) |
Then, we change the surface by adding wooden planks on the ground as shown below to change the surface :-
Starting with the same predicted model and friction coefficient, we again increase the speeds gradually from 0.5 of raceline speeds to 1. The trajectory followed by the car is as follows :-
Trajectory | \(\mu\) used for raceline |
---|---|
As can be clearly seen, the vehicle does move out of the track at the beginning but is able to use the experience to tune the model and friction coefficient to adjust the next lap accordingly and is able to adapt well to the new surface. The video of the whole run is as below :-
The trajectories followed if adaptation is used vs not used are as follows :-
Method | Trajectory | \(\mu\) used for raceline |
---|---|---|
Without adaptation | Same as beginning (\(\mu=1.5\)) | |
With model + reference speed adaptations (ours) |