© Michael Paluszek and Stephanie Thomas  2019
Michael Paluszek and Stephanie ThomasMATLAB Machine Learning Recipeshttps://doi.org/10.1007/978-1-4842-3916-2_13

13. Autonomous Driving with Multiple Hypothesis Testing

Michael Paluszek1  and Stephanie Thomas1
(1)
Plainsboro, NJ, USA
 

In this chapter, we will apply the multiple hypothesis testing (MHT) techniques from the previous chapter to the interesting problem of autonomous driving. Consider a primary car that is driving along a highway at variable speeds. It carries a radar that measures azimuth, range, and range rate. Cars pass the primary car, some of which change lanes from behind the car and cut in front. The multiple hypothesis system tracks all cars around the primary car. At the start of the simulation there are no cars in the radar field of view. One car passes and cuts in front of the radar car. The other two just pass in their lanes. You want to accurately track all cars that your radar can see.

../images/420697_2_En_13_Chapter/420697_2_En_13_Figa_HTML.gif

There are two elements to this problem. One is to model the motion of the tracked automobiles using measurements to improve your estimate of each automobile’s location and velocity. The second is to systematically assign measurements to different tracks. A track should represent a single car, but the radar is just returning measurements on echoes, it doesn’t know anything about the source of the echoes.

You will solve the problem by first implementing a Kalman Filter to track one automobile. We need to write measurement and dynamics functions that will be passed to the Kalman filter, and we need a simulation to create the measurements. Then we will apply the MHT techniques developed in the previous chapter to this problem.

We’ll do the following things in this chapter.

  1. 1.

    Model the automobile dynamics

     
  2. 2.

    Model the radar system

     
  3. 3.

    Write the control algorithms

     
  4. 4.

    Implement visualization to let us see the maneuvers in 3D

     
  5. 5.

    Implement the Unscented Kalman Filter

     
  6. 6.

    Implement MHT

     

13.1 Automobile Dynamics

13.1.1 Problem

We need to model the car dynamics. We will limit this to a planar model in two dimensions. We are modeling the location of the car in xy and the angle of the wheels, which allows the car to change direction.

13.1.2 Solution

Write a right-hand side function that can be called RungeKutta.

13.1.3 How It Works

Much like with the radar, we will need two functions for the dynamics of the automobile. RHSAutomobile is used by the simulation. RHSAutomobile has the full dynamic model including the engine and steering model. Aerodynamic drag, rolling resistance and side force resistance (the car doesn’t slide sideways without resistance) are modeled. RHSAutomobile handles multiple automobiles. An alternative would be to have a one-automobile function and call RungeKutta once for each automobile. The latter approach works in all cases, except when you want to model collisions. In many types of collisions two cars collide and then stick, effectively becoming a single car. A real tracking system would need to handle this situation. Each vehicle has six states. They are:

  1. 1.

    x position

     
  2. 2.

    y position

     
  3. 3.

    x velocity

     
  4. 4.

    y velocity

     
  5. 5.

    Angle about vertical

     
  6. 6.

    Angular rate about vertical

     
The velocity derivatives are driven by the forces and the angular rate derivative by the torques. The planar dynamics model is illustrated in Figure 13.1 [29]. Unlike the reference, we constrain the rear wheels to be fixed and the angles for the front wheels to be the same.
../images/420697_2_En_13_Chapter/420697_2_En_13_Fig1_HTML.jpg
Figure 13.1

Planar automobile dynamical model.

The dynamical equations are written in the rotating frame.
$$\displaystyle \begin{aligned} \begin{array}{rcl} m(\dot{v}_x - 2\omega v_y) &\displaystyle =&\displaystyle \sum_{k=1}^4F_{k_x}- q C_{D_x} A_x u_x \end{array} \end{aligned} $$
(13.1)
$$\displaystyle \begin{aligned} \begin{array}{rcl} m(\dot{v}_y +2\omega v_x) &\displaystyle =&\displaystyle \sum_{k=1}^4F_{k_y}- q C_{D_y} A_y u_y \end{array} \end{aligned} $$
(13.2)
$$\displaystyle \begin{aligned} \begin{array}{rcl} I\dot{\omega} &\displaystyle =&\displaystyle \sum_{k=1}^4r_k^\times F_k \end{array} \end{aligned} $$
(13.3)
where the dynamic pressure is:
$$\displaystyle \begin{aligned} q = \frac{1}{2}\rho\sqrt{v_x^2 + v_y^2} \end{aligned} $$
(13.4)
and
$$\displaystyle \begin{aligned} v= \left[ \begin{array}{l} v_x\\ v_y \end{array} \right] \end{aligned} $$
(13.5)
The unit vector is:
$$\displaystyle \begin{aligned} u=\frac{ \left[ \begin{array}{l} v_x\\ v_y \end{array} \right]}{\sqrt{v_x^2 + v_y^2}} \end{aligned} $$
(13.6)
The normal force is mg, where g is the acceleration of gravity. The force at the tire contact point, where the tire touches the road, for tire k is:
$$\displaystyle \begin{aligned} F_{t_k}= \left[ \begin{array}{l} T/\rho - F_r\\ -F_c \end{array} \right] \end{aligned} $$
(13.7)
where ρ is the radius of the tire and Fr is the rolling friction and is:
$$\displaystyle \begin{aligned} F_r = f_0 + K_1v_{t_{x}}^2 \end{aligned} $$
(13.8)
where $$v_{t_{x}}$$ is the velocity in the tire frame in the rolling direction. For front wheel drive cars, the torque, T, is zero for the rear wheels. The contact friction is:
$$\displaystyle \begin{aligned} F_c = \mu_c mg \frac{v_{t_{y}}}{|v_t|} \end{aligned} $$
(13.9)
This the force perpendicular to the normal rolling direction of the wheel, that is, into or out of the paper in Figure 13.2. The velocity term ensures that the friction force does not cause limit cycling. That is, when the y velocity is zero, the force is zero. μc is a constant for the tires.
../images/420697_2_En_13_Chapter/420697_2_En_13_Fig2_HTML.png
Figure 13.2

Wheel force and torque.

The transformation from tire to body frame is:
$$\displaystyle \begin{aligned} c = \left[ \begin{array}{rr} \cos\delta & -\sin\delta\\ \sin\delta&\cos\delta \end{array} \right] \end{aligned} $$
(13.10)
where δ is the steering angle so that:
$$\displaystyle \begin{aligned} F_k = cF_{t_k} \end{aligned} $$
(13.11)
$$\displaystyle \begin{aligned} v_t = c^T \left[ \begin{array}{l} v_x\\ v_y \end{array} \right] \end{aligned} $$
(13.12)
The kinematical equations that related yaw angle and yaw angular rate are
$$\displaystyle \begin{aligned} \dot{\theta} = \omega \end{aligned} $$
(13.13)
and the inertial velocity V , the velocity needed to tell you where the car is going, is:
$$\displaystyle \begin{aligned} V = \left[ \begin{array}{rr} \cos \theta & -\sin\theta\\ \sin\theta & \cos\theta \end{array} \right]v \end{aligned} $$
(13.14)

We’ll show you the dynamics simulation when we get to the graphics part of the chapter in Section 13.4

13.2 Modeling the Automobile Radar

13.2.1 Problem

The sensor utilized for this example will be the automobile radar. The radar measures azimuth, range, and range rate. We need two functions: one for the simulation and the second for use by the Unscented Kalman Filter.

13.2.2 Solution

Build a radar model in a MATLAB function. The function will use analytical derivations of range and range rate.

13.2.3 How It Works

The radar model is extremely simple. It assumes that the radar measures line-of-site range, range rate, and azimuth, the angle from the forward axis of the car. The model skips all the details of radar signal processing and outputs those three quantities. This type of simple model is always best when you start a project. Later on, you will need to add a very detailed model that has been verified against test data to demonstrate that your system works as expected.

The position and velocity of the radar are entered through the data structure. This does not model the signal-to-noise ratio of a radar. The power received by a radar goes as $$\frac {1}{r^4}$$. In this model, the signal goes to zero at the maximum range that is specified in the function. The range is found from the difference in position between the radar and the target. If δ is the difference, we write:
$$\displaystyle \begin{aligned} \delta = \left[ \begin{array}{l} x - x_r\\ y - y_r\\ z - z_r \end{array} \right] \end{aligned} $$
(13.15)
Range is then:
$$\displaystyle \begin{aligned} \rho = \sqrt{\delta_x^2 + \delta_y^2 + \delta_z^2} \end{aligned} $$
(13.16)
The delta velocity is:
$$\displaystyle \begin{aligned} \nu = \left[ \begin{array}{l} v_x - v_{x_r}\\ v_y - v_{y_r}\\ v_z - v_{z_r} \end{array} \right] \end{aligned} $$
(13.17)
In both equations, the subscript r denotes the radar. The range rate is:
$$\displaystyle \begin{aligned} \dot{\rho} = \frac{\nu^T\delta}{\rho} \end{aligned} $$
(13.18)
The AutoRadar function handles multiple targets and can generate radar measurements for an entire trajectory. This is really convenient because you can give it your trajectory and see what it returns. This gives you a physical feel for the problem without running a simulation. It also allows you to be sure the sensor model is doing what you expect! This is important because all models have assumptions and limitations. It may be that the model really isn’t suitable for your application. For example, this model is two-dimensional. If you are concerned about your system getting confused about a car driving across a bridge above your automobile, this model will not be useful in testing that scenario.

Notice that the function has a built-in demo and, if there are no outputs, will plot the results. Adding demos to your code is a nice way to make your functions more user friendly to other people using your code and even to you when you encounter the code again several months after writing the code! We put the demo in a subfunction because it is long. If the demo is one or two lines, a subfunction isn’t necessary. Just before the demo function is the function defining the data structure.

The second function, AutoRadarUKF is the same core code, but designed to be compatible with the Unscented Kalman Filter. We could have used AutoRadar, but this is more convenient. The transformation matrix, cITOC (inertial to car transformation) is two-dimensional, since the simulation is in a flat world.

 s       =  sin (d.theta);
 c       =  cos (d.theta);
 cIToC   = [c s;-s c];
 dR      = cIToC*x(1:2);
 dV      = cIToC*x(3:4);
 rng     =  sqrt (dR’*dR);
 y      = [rng; dR’*dV/rng;  atan (dR(2)/dR(1))];
The radar returns range, range rate, and the azimuth angle of the target. Even though we are using radar as our sensor, there is no reason why you couldn’t use a camera, laser range-finder or sonar instead. The limitation in the algorithms and software provided in this book is that it will only handle one sensor. You can get software from Princeton Satellite Systems that expands this to multiple sensors. For example, cars carry radar, cameras, and lidar. You may want to integrate all of their measurements together. Figure 13.3 shows the internal radar demo. The target car is weaving in front of the radar. It is receding at a steady velocity, but the weave introduces a time-varying range rate.
../images/420697_2_En_13_Chapter/420697_2_En_13_Fig3_HTML.jpg
Figure 13.3

Built-in radar demo. The target is weaving in front of the radar.

13.3 Automobile Autonomous Passing Control

13.3.1 Problem

To have something interesting for our radar to measure, we need our cars to perform some maneuvers. We will develop an algorithm for a car to change lanes.

13.3.2 Solution

The cars are driven by steering controllers that execute basic automobile maneuvers. Throttle (accelerator pedal) and steering angle can be controlled. Multiple maneuvers can be chained together. This provides a challenging test for the MHT system. The first function is for autonomous passing and the second performs the lane change.

13.3.3 How It Works

The AutomobilePassing implements passing control by pointing the wheels at the target. It generates a steering angle demand and torque demand. Demand is what we want the steering to do. In a real automobile, the hardware will attempt to meet the demand, but there will be a time lag before the wheel angle or motor torque meets the wheel angle or torque demand commanded by the controller. In many cases, you are passing the demand to another control system that will try and meet the demand. The algorithms are quite simple. They don’t care if anyone gets in the way. They also don’t have any control for avoiding another vehicle. The code assumes that the lane is empty. Don’t try this with your car! The state is defined by the passState variable. Prior to passing, the passState is 0. During the passing, it is 1. When it returns to its original lane, the state is set to 0.

  % Lead the target unless the passing car is in front
if( passee.x(1) + dX > passer.x(1) )
   xTarget = passee.x(1) + dX;
else
   xTarget = passer.x(1) + dX;
end
  % This causes the passing car to cut in front of the car being passed
if( passer(1).passState == 0 )
    if( passer.x(1) > passee.x(1) + 2*dX )
     dY = 0;
     passer(1).passState = 1;
    end
else
   dY = 0;
end
  % Control calculation
 target          = [xTarget;passee.x(2) + dY];
 theta           = passer.x(5);
 dR              = target - passer.x(1:2);
angle           = atan2(dR(2),dR(1));
 err             =  angle  - theta;
 passer.delta    = gain(1)*(err + gain(3)*(err - passer.errOld));
 passer.errOld   = err;
 passer.torque   = gain(2)*(passee.x(3) + dV - passer.x(3));

The second function performs a lane change. It implements lane change control by pointing the wheels at the target. The function generates a steering angle demand and a torque demand. The default gains work reasonably well. You should always supply defaults that make sense.

  % Default gains
ifnargin < 5 )
   gain = [0.05 80 120];
end
  % Lead the target unless the passing car is in front
 xTarget         = passer.x(1) + dX;
  % Control calculation
 target          = [xTarget;y];
 theta           = passer.x(5);
 dR              = target - passer.x(1:2);
angle           = atan2(dR(2),dR(1));
 err             =  angle  - theta;
 passer.delta    = gain(1)*(err + gain(3)*(err - passer.errOld));
 passer.errOld   = err;
 passer.torque   = gain(2)*(v - passer.x(3));

13.4 Automobile Animation

13.4.1 Problem

We want to visualize the cars as the maneuver.

13.4.2 How It Works

We create a function to read in .obj files. We then write a function to draw and animate the model.

13.4.3 Solution

The first part is to find an automobile model. A good resource is TurboSquid https://​www.​turbosquid.​com. You will find thousands of models. We need .obj format and prefer a low polygon count. Ideally, we want models with triangles. In the case of the model found for this chapter, it had rectangles so we converted them to triangles using a Macintosh application, Cheetah3D https://​www.​cheetah3d.​com. An OBJ model comes with an .obj file, an .mtl file (material file), and images for textures. We will only use the .obj file.

LoadOBJ loads the file and puts it into a data structure. The data structure uses the g field of the OBJ file to break the file into components. In this case, the components are the four tires and the rest of the car. The demo is just LoadOBJ( ’MyCar.obj’ ). You do need the extension, .obj. The car is shown in Figure 13.4.
../images/420697_2_En_13_Chapter/420697_2_En_13_Fig4_HTML.png
Figure 13.4

Automobile 3D model.

The image is generated with one call to patch per component.

The first part of DrawComponents initializes the model and updates it. We save, and return, pointers to the patches so that we only have to update the vectors with each call.

 switch(  lower (action) )
   case  ’initialize’
     n =  length (g.component);
     h =  zeros (1,n);
      for k = 1:n
       h(k) = DrawMesh(g.component(k) );
      end
   case  ’update’
     UpdateMesh(h,g.component,x);
   otherwise
     warning( ’%s␣not␣available’,action);
end

The mesh is drawn with a call to patch. patch has many options that are worth exploring. We use the minimal set. We make the edges black to make the model easier to see. The Phong reflection model is an empirical lighting model. It includes diffuse and specular lighting.

function h = DrawMesh( m )
 h =  patch (   ’Vertices’, m.v,  ’Faces’,   m.f,  ’FaceColor’, m.color,...
              ’EdgeColor’,[0 0 0], ’EdgeLighting’,  ’phong’,...
              ’FaceLighting’,  ’phong’);

Updating is done by rotating the vertices around the z-axis and then adding the x and y positional offsets. The input array is [x;y;yaw]. We then set the new vertices. The function can handle an array of positions, velocities, and yaw angles.

function UpdateMesh( h, c, x )
for j = 1:size(x,2)
    for k = 1:length(c)
     cs      =  cos (x(3,j));
     sn      =  sin (x(3,j));
     b       = [cs -sn 0 ;sn cs 0;0 0 1];
     v       = (b*c(k).v’)’;
     v(:,1)  = v(:,1) + x(1,j);
     v(:,2)  = v(:,2) + x(2,j);
      set(h(k), ’vertices’,v);
    end
end

The graphics demo AutomobileDemo implements passing control. AutomobileInitialize reads in the OBJ file. The following code sets up the graphics window:

  % Set up the figure
 NewFig(  ’Car␣Passing’ )
axes( ’DataAspectRatio’,[1 1 1], ’PlotBoxAspectRatio’,[1 1 1] );
 h(1,:) = DrawComponents(  ’initialize’, d.car(1).g );
 h(2,:) = DrawComponents(  ’initialize’, d.car(2).g );
 XLabelS( ’X␣(m)’)
 YLabelS( ’Y␣(m)’)
 ZLabelS( ’Z␣(m)’)
set(gca, ’ylim’,[-4 4], ’zlim’,[0 2]);
grid  on
view(3)
rotate3d on

During each pass through the simulation loop, we update the graphics. We call DrawComponents once per car along with the stored patch handles for each car’s components. We adjust the limits so that we maintain a tight focus on the two cars. We could have used the camera fields in the axes data structure for this too. We call drawnow after setting the new xlim for smooth animation.

   % Draw the cars
  pos1 = x([1 2]);
  pos2 = x([7 8]);
  DrawComponents(  ’update’, d.car(1).g, h(1,:), [pos1; pi /2 + x( 5)] );
  DrawComponents(  ’update’, d.car(2).g, h(2,:), [pos2; pi /2 + x(11)] );
  xlim = [ min (x([1 7]))-10  max (x([1 7]))+10];
   set(gca, ’xlim’,xlim);
   drawnow
Figure 13.5 shows four points in the passing sequence.
../images/420697_2_En_13_Chapter/420697_2_En_13_Fig5_HTML.jpg
Figure 13.5

Automobile simulation snap shots showing passing.

13.5 Automobile Simulation and the Kalman Filter

13.5.1 Problem

You want to track a car using radar measurements to track an automobile maneuvering around your car. Cars may appear and disappear at any time. The radar measurement needs to be turned into the position and velocity of the tracked car. In between radar measurements you want to make your best estimate of where the automobile will be at a given time.

13.5.2 Solution

The solution is to implement an Unscented Kalman Filter to take radar measurements and update a dynamical model of the tracked automobile.

13.5.3 How It Works

We first create the function RHSAutomobileXY with the Kalman Filter dynamical model. The Kalman Filter right-hand side is just the differential equations.
$$\displaystyle \begin{aligned} \begin{array}{rcl} \dot{x} &amp;\displaystyle =&amp;\displaystyle v_x \end{array} \end{aligned} $$
(13.19)
$$\displaystyle \begin{aligned} \begin{array}{rcl} \dot{y} &amp;\displaystyle =&amp;\displaystyle v_y \end{array} \end{aligned} $$
(13.20)
$$\displaystyle \begin{aligned} \begin{array}{rcl} \dot{v}_x &amp;\displaystyle =&amp;\displaystyle 0 \end{array} \end{aligned} $$
(13.21)
$$\displaystyle \begin{aligned} \begin{array}{rcl} \dot{v}_y &amp;\displaystyle =&amp;\displaystyle 0 \end{array} \end{aligned} $$
(13.22)

The dot means time derivative or rate of change with time. These are the state equations for the automobile. This model says that the position change with time is proportional to the velocity. It also says the velocity is constant. Information about velocity changes will come solely from the measurements. We also don’t model the angle or angular rate. This is because we aren’t getting information about it from the radar. However, you may want to try including it!

The RHSAutomobileXY function is shown below; it is of only one code! This is because it just models the dynamics of the point mass.

 xDot = [x(3:4);0;0];

The demonstration simulation is the same simulation used to demonstrate the multiple hypothesis system tracking. This simulation just demonstrates the Kalman Filter. Since the Kalman Filter is the core of the package, it is important that it works well before adding the measurement assignment part.

MHTDistanceUKF finds the MHT distance for use in gating computations using the Unscented Kalman Filter (UKF). The MHT distance is the distance between the observation and predicted locations. The measurement function is of the form h(x,d), where d is the UKF data structure. MHTDistanceUKF uses sigma points. The code is similar to UKFUpdate. As the uncertainty gets smaller, the residual must be smaller to remain within the gate.

 pS      = d.c* chol (d.p)’;
 nS      =  length (d.m);
 nSig    = 2*nS + 1;
 mM      = repmat(d.m,1,nSig);
iflength(d.m) == 1 )
     mM = mM’;
end
 x       = mM + [ zeros (nS,1) pS -pS];
 [y, r] = Measurement( x, d );
 mu      = y*d.wM;
 b       = y*d.w*y’ + r;
 del     = d.y - mu;
 k       = del’*(b\del);
  %% MHTDistanceUKF>Measurement
function [y, r] = Measurement( x, d )
  %       Measurement from the sigma points
 nSigma  =  size (x,2);
 lR      =  length (d.r);
 y       =  zeros (lR,nSigma);
 r       = d.r;
 iR      = 1:lR;
for j = 1:nSigma
         f           =  feval ( d.hFun, x(:,j), d.hData );
         y(iR,j)     = f;
         r(iR,iR)    = d.r;
end

The simulation UKFAutomobileDemo uses a car data structure to contain all of the car information. A MATLAB function AutomobileInitialize takes parameter pairs and builds the data structure. This is a lot cleaner than assigning the individual fields in your script. It will return a default data structure if nothing is entered as an argument.

The first part of the demo, is the automobile simulation. It generates the measurements of the automobile positions to be used by the Kalman Filter. The second part of the demo processes the measurements in the UKF to generate the estimates of the automobile track. You could move the code that generates the simulated data into a separate file if you were reusing the simulation results repeatedly.

The results of the script are shown in Figure 13.6, Figure 13.7, and Figure 13.8.
../images/420697_2_En_13_Chapter/420697_2_En_13_Fig6_HTML.jpg
Figure 13.6

Automobile trajectories.

../images/420697_2_En_13_Chapter/420697_2_En_13_Fig7_HTML.jpg
Figure 13.7

The true states and Unscented Kalman Filter (UKF) estimated states.

../images/420697_2_En_13_Chapter/420697_2_En_13_Fig8_HTML.jpg
Figure 13.8

The MHT distance between the automobiles during the simulation. Notice the spike in distance when the automobile maneuver starts.

13.6 Automobile Target Tracking

13.6.1 Problem

We need to demonstrate target tracking for automobiles.

13.6.2 Solution

Build an automobile simulation with target tracking.

13.6.3 How It Works

The simulation is for a two-dimensional model of automobile dynamics. The primary car is driving along a highway at variable speeds. It carries a radar. Many cars pass the primary car, some of which change lanes from behind the car and cut in front. The MHT system tracks all cars. At the start of the simulation there are no cars in the radar field of view. One car passes and cuts in front of the radar car. The other two just pass in their lanes. This is a good test of track initiation.

The radar, covered in the first recipe of the chapter, measures range, range rate, and azimuth in the radar car frame. The model generates those values directly from the target and from the tracked cars’ relative velocity and positions. The radar signal processing is not modeled, but the radar has field-of-view and range limitations. See AutoRadar.

The cars are driven by steering controllers that execute automobile maneuvers. Throttle (accelerator pedal) and steering angle can be controlled. Multiple maneuvers can be chained together. This provides a challenging test for the MHT system. You can try different maneuvers and add additional maneuver functions of your own.

The Unscented Kalman Filter described in Chapter 4 is used in this demo as the radar is a highly nonlinear measurement. The UKF dynamical model, RHSAutomobileXY, is a pair of double integrators in the inertial frame relative to the radar car. The model accommodates steering and throttle changes by making the plant covariance, both position and velocity, larger than would be expected by analyzing the relative accelerations. An alternative would be to use interactive multiple models (IMMs) with a “steering” model and “acceleration” model. This added complication does not appear to be necessary. A considerable amount of uncertainty would be retained even with IMM, since a steering model would be limited to one or two steering angles. The script implementing the simulation with MHT is MHTAutomobileDemo. There are four cars in the demo; car 4 will be passing. Figure 13.10 shows the radar measurement for car 3, which is the last car tracked. The MHT system handles vehicle acquisition well. The MHT GUI in Figure 13.11 shows a hypothesis with three tracks at the end of the simulation. This is the expected result.

../images/420697_2_En_13_Chapter/420697_2_En_13_Fig9_HTML.png
Figure 13.9

Automobile demo car trajectories.

../images/420697_2_En_13_Chapter/420697_2_En_13_Fig10_HTML.png
Figure 13.10

Automobile demo radar measurement for car 3.

../images/420697_2_En_13_Chapter/420697_2_En_13_Fig11_HTML.jpg
Figure 13.11

The MHT GUI shows three tracks. Each track has consistent measurements.

Figure 13.12 shows the final tree. There are several redundant tracks. These tracks can be removed, since they are clones of other tracks. This does not impact hypothesis generation.
../images/420697_2_En_13_Chapter/420697_2_En_13_Fig12_HTML.png
Figure 13.12

The final tree for the automobile demo.

13.7 Summary

This chapter has demonstrated an automobile tracking problem. The automobile has a radar system that detects cars in its field of view. The system accurately assigns measurements to tracks and successfully learns the path of each neighboring car. You started by building an Unscented Kalman Filter to model the motion of an automobile and to incorporate measurements from a radar system. This is demonstrated in a simulated script. You then build a script that incorporates track-oriented multiple hypothesis testing to assign measurements taken by the radar of multiple automobiles. This allows our radar system to autonomously and reliably track multiple cars.

You also learned how to make simple automobile controllers. The two controllers steer the automobiles and allow them to pass other cars.

Table 13.1 lists the functions and scripts included in the companion code.
Table 13.1

Chapter Code Listing

File

Description

AutoRadar

Automobile radar model for simulation.

AutoRadarUKF

Automobile radar model for the UKF.

AutomobileDemo

Demonstrate automobile animation.

AutomobileInitialize

Initialize the automobile data structure.

AutomobileLaneChange

Automobile control algorithm for lane changes.

AutomobilePassing

Automobile control algorithm for passing.

DrawComponents

Draw a 3D model.

LoadOBJ

Load an .obj graphics file.

MHTAutomobileDemo

Demonstrate the use of multiple hypothesis testing for automobile radar systems.

RHSAutomobile

Automobile dynamical model for simulation.

RHSAutomobileXY

Automobile dynamical model for the UKF.

UKFAutomobileDemo

Demonstrate the UKF for an automobile.