benchmark trajectories for multi-凯发k8网页登录
this example shows how to generate and visualize trajectories of multiple aircraft using trackingscenario
and waypointtrajectory
.
introduction
the six aircraft trajectories modeled in this example are described in [1]. the aircraft fly in an arrangement intended to be received by a radar located at the origin.
choice of interpolant
conceptually speaking, a trajectory is a curve through space which an object travels as a function of time. to define the curve, you may think of a curve through space that passes through a set of points called waypoints connected by an interpolating function called an interpolant. an interpolant allows you to define the path between waypoints via a continuous function. common interpolants are polynomial based (for example, piecewise linear or cubic splines). for a rapidly changing trajectory, more waypoints are required to keep the interpolated curve as close to the true curve as possible; however, we can reduce the number of required points by choosing interpolants carefully.
many motion models used in track filters consist of "constant velocity," "constant turn," or "constant acceleration" profiles. to accommodate these motion models, the interpolant used in the waypointtrajectory
object is based on a piecewise clothoid spline (horizontally) and a cubic spline (vertically). the curvature of a clothoid spline varies linearly with respect to distance traveled; this lets us model straight and constant turns with ease, having one extra degree of freedom to transition smoothly between straight and curved segments. similarly, objects in the air experience the effects of gravity, following a parabolic (quadratic) path. having a cubic spline to model vertical elevation allows us to model the path with a similar extra degree of freedom.
once the physical path through space of an object is known (and set), the speed of the object as a function of distance traveled is determined via cubic hermite interpolation. this is useful for modeling trajectories of objects that accelerate through turns or straight segments.
the benchmark trajectories we are using consist of straight, constant-g turns, and turns with acceleration.
waypoint construction
the following file contains tables of waypoints and velocities (in units of meters and meters per second) that can be used to reconstruct six aircraft trajectories. load it into matlab and examine the table containing the first trajectory.
load('benchmarktrajectorytables.mat', 'trajtable'); trajtable{1}
ans = 14x3 table time waypoints velocities _____ _________________________ _____________________________ 0 72947 29474 -1258 -258.9 -129.69 0 60 57413 21695 -1258 -258.9 -129.66 0 62 56905 21417 -1258 -245.3 -153.89 0 78.1 54591 17566 -1258 -20.635 -288.86 0 80 54573 17016 -1258 -2.8042 -289.59 0 83 54571 16147 -1258 -0.061 -289.56 0 110 54571 8329 -1258 0 -289.56 0 112.7 54634 7551.5 -1258 58.979 -283.56 0 120 55718 5785.5 -1258 226.41 -180.59 0 129 58170 5172.8 -1258 284.74 52.88 0 132 59004 5413.9 -1258 274.26 93.05 0 137.8 60592 5962.2 -1258 273.62 94.76 0 147.8 63328 6909.9 -1258 273.62 94.76 0 185 73508 10435 -1258 273.62 94.76 0
scenario generation
the table contains a set of waypoints and velocities that the aircraft passes through at the corresponding time.
to use the control points, you can create a scenario with six platforms and assign a trajectory to each:
scene = trackingscenario('updaterate',10); for n=1:6 plat = platform(scene); traj = trajtable{n}; plat.trajectory = waypointtrajectory(traj.waypoints, traj.time, 'velocities', traj.velocities); end
trajectory visualization
once you have the scenario and plotter set up, you can set up a theaterplot
to create an animated view of the locations of the aircraft as time progresses.
helperplot = helperbenchmarkplotter(numel(scene.platforms)); while advance(scene) % extract the pose of each of the six aircraft poses = platformposes(scene); % update the plot update(helperplot, poses, scene.simulationtime); end
the trajectories plotted above are three-dimensional. you can rotate the plot so that the elevation of the trajectories is readily visible. you can use the view
and axis
commands to adjust the plot. because the trajectories use a ned (north-east-down) coordinate system, elevation above ground has a negative z component.
view(60,10); axis square grid minor set(gca,'zdir','reverse');
trajectory 1
it may be instructive to view the control points used to generate the trajectories. the following figure shows the first trajectory, which is representative of a large aircraft.
the control points used to construct the path are plotted on the leftmost plot. only a few waypoints are needed to mark the changes in curvature as the plane takes a constant turn.
the plots on the right show the altitude, magnitude of velocity (speed), and magnitude of acceleration, respectively. the speed stays nearly constant throughout despite the abrupt change in curvature. this is an advantage of using the clothoid interpolant.
[time, position, velocity, acceleration] = cumulativehistory(helperplot); helpertrajectoryviewer(1, time, position, velocity, acceleration, trajtable);
trajectory 2
the second trajectory, shown below, represents the trajectory of a small maneuverable aircraft. it consists of two turns, having several changes in acceleration immediately after the first turn and during the second turn. more waypoints are needed to adjust for these changes, however the rest of the trajectory requires fewer points.
helpertrajectoryviewer(2, time, position, velocity, acceleration, trajtable);
trajectory 3
the third trajectory, shown below is representative of a higher speed aircraft. it consists of two constant turns, where the aircraft decelerates midway throughout the second turn. you can see the control points that were used to mark the changes in velocity and acceleration in the x-y plot on the left.
helpertrajectoryviewer(3, time, position, velocity, acceleration, trajtable);
trajectory 4
the fourth trajectory, also representative of a higher speed aircraft, is shown below. it consists of two turns, where the aircraft accelerates and climbs to a higher altitude.
helpertrajectoryviewer(4, time, position, velocity, acceleration, trajtable);
trajectory 5
the fifth trajectory is representative of a maneuverable high-speed aircraft. it consists of three constant turns; however it accelerates considerably throughout the duration of the flight. after the third turn the aircraft ascends to a level flight.
helpertrajectoryviewer(5, time, position, velocity, acceleration, trajtable);
trajectory 6
the sixth trajectory is also representative of a maneuverable high-speed aircraft. it consists of four turns. after the second turn the aircraft decreases altitude and speed and enters the third turn. after the third turn it accelerates rapidly and enters the fourth turn, continuing with straight and level flight.
helpertrajectoryviewer(6, time, position, velocity, acceleration, trajtable);
summary
this example shows how to use waypointtrajectory
and trackingscenario
to create a multi-object tracking scenario. in this example you learned the concepts behind the interpolant used inside waypointtrajectory
and were shown how a scenario could be reproduced with a small number of waypoints.
reference
w.d. blair, g. a. watson, t. kirubarajan, y. bar-shalom, "benchmark for radar allocation and tracking in ecm." aerospace and electronic systems ieee trans on, vol. 34. no. 4. 1998