plotFilterErrors
Syntax
Description
plotFilterErrors(
plots the position and
velocity estimate errors on the x-, y-, and
z-axes. The function also plots the 3-sigma covariance envelopes, which
ideally contain roughly 99.7% of the state estimate errors for a consistent filter.tuner
)
Note
Use the tune
object
function before calling the plotFilterErrors
function if you have
changed any of these properties of the tuner
:
FilterInitializationFcn
TunablePropertiesSource
CustomTunableProperties
Examples
Tune trackingEKF
Using Tracking Filter Tuner
Load the tuning data containing the truth and detection data. The truth data has the position and velocity of one target for a duration of 9.5 seconds. The detection data has object detections of ten Monte-Carlo runs for the same period.
load("filterTuningData.mat","truth","detlog");
Create a trackingFilterTuner
object and set the Solver
property to "fmincon"
.
tuner = trackingFilterTuner(Solver="fmincon");
By default, the FilterInitialization
property of the tuner returns an initialization function that initializes a trackingEKF
object.
initFcn = tuner.FilterInitializationFcn
initFcn = "initcvekf"
Initialize the trackingEKF
object and display the untuned process noise.
filter = feval(tuner.FilterInitializationFcn,detlog{1}); disp(filter.ProcessNoise);
1 0 0 0 1 0 0 0 1
Specify the SolverOptions
property so that the tuner displays the tuning progress for every iteration and set the maximum number of iterations to 30.
tuner.SolverOptions = optimoptions("fmincon",MaxIterations=30);
Using the tune
object function, tune the filter with the detection log and the truth data. Return the tuned properties.
tunedProps = tune(tuner,detlog,truth);
Iter RMSE Step Size 0 9.2946 0.0000 1 9.2751 0.1324 2 9.1820 0.6904 3 9.0754 1.2832 4 9.0747 0.1351 5 9.0528 0.3302 6 9.0507 0.1613 7 9.0479 0.0803 8 9.0474 0.0552 9 9.0476 0.0463 10 9.0477 0.0085 11 9.0476 0.0194 12 9.0476 0.0064 13 9.0461 0.0603 14 9.0456 0.0280 15 9.0455 0.0040 16 9.0455 0.0013 17 9.0455 0.0015 18 9.0452 0.0254 19 9.0451 0.0141 20 9.0451 0.0022 21 9.0451 0.0010 22 9.0451 0.0026 23 9.0451 0.0037 24 9.0451 0.0027 25 9.0451 0.0015 26 9.0451 0.0009 27 9.0451 0.0005 28 9.0451 0.0003 29 9.0451 0.0002 30 9.0451 0.0001 Solver stopped prematurely. fmincon stopped because it exceeded the iteration limit, options.MaxIterations = 3.000000e+01.
Set the filter tunable properties by using the setTunedProperty
object function of the filter. Display the tuned process noise.
setTunedProperties(filter,tunedProps); disp(filter.ProcessNoise);
0.0004 0.0008 0.0002 0.0008 0.0152 0.0007 0.0002 0.0007 0.0004
Plot the filter estimation error after tuning by using the plotFilterErrors
object function.
plotFilterErrors(tuner)
Input Arguments
tuner
— Tracking filter tuner
trackingFilterTuner
object
Tracking filter tuner, specified as a trackingFilterTuner
object.
Version History
Introduced in R2022b
See Also
Apri esempio
Si dispone di una versione modificata di questo esempio. Desideri aprire questo esempio con le tue modifiche?
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)