Main Content


Plot filter pose estimates during tuning

Since R2021a



stopTuning = tunerPlotPose(params,tunerValues) plots the current pose estimate, consisting of orientation (and possibly position, depending on the filter), and the ground truth values. params contains the best estimates of the filter parameters during the current tuning iteration. tunerValues contains information on the tuner configuration, sensor data, and ground truth data. Use this function as the value for the OutputFcn property of the tunerconfig object to plot the tuning results during iterations.


collapse all

Create a tunerconfiguration object. Set the tunerPlotPose function as the output function of the object.

tc = tunerconfig('imufilter','OutputFcn',@tunerPlotPose)
tc = 
  tunerconfig with properties:

               Filter: "imufilter"
    TunableParameters: ["AccelerometerNoise"    "GyroscopeNoise"    "GyroscopeDriftNoise"    "LinearAccelerationNoise"    "LinearAccelerationDecayFactor"]
          StepForward: 1.1000
         StepBackward: 0.5000
        MaxIterations: 20
       ObjectiveLimit: 0.1000
    FunctionTolerance: 0
              Display: iter
                 Cost: RMS
            OutputFcn: @tunerPlotPose

Load prerecorded sensor data.

ld = load('imufilterTuneData.mat');

Tune an imufilter object using the sensor data. The truth data and the estimates are shown in a figure.

    Iteration    Parameter                        Metric
    _________    _________                        ______
    1            AccelerometerNoise               0.0857

Input Arguments

collapse all

Estimates of filter parameters during the current iteration of the tuning process, specified as a structure. The structure contains one field for every public property of the filter and additional fields for any required measurement noise. The exact field names vary depending on the filter being tuned.

Tuner values, specified as a structure. The structure has these fields:

Field NameDescription
IterationIteration count of the tuner, specified as a positive integer
SensorDataSensor data input to the tune function
GroundTruthGround truth input to the tune function
Configurationtunerconfig object used for tuning
CostTuning cost at the end of the current iteration

Output Arguments

collapse all

Stop the tuning process, returned as false. As a result, using the tunerPlotPose function as the output function of a tunerconfig object never terminates the tuning process of a fusion filter.

Version History

Introduced in R2021a