Main Content

tunerPlotPose

Plot filter pose estimates during tuning

Since R2021a

Description

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.

example

Examples

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.

tune(imufilter,ld.sensorData,ld.groundTruth,tc)
    Iteration    Parameter                        Metric
    _________    _________                        ______
    1            AccelerometerNoise               0.0857

Figure Tuning Results contains 4 axes objects. Axes object 1 with title Orientation, ylabel Yaw (deg) contains 2 objects of type line. This object represents Ground Truth. Axes object 2 with ylabel Pitch (deg) contains 2 objects of type line. Axes object 3 with xlabel Time (sec), ylabel Roll (deg) contains 2 objects of type line. This object represents Filter Estimate. Hidden axes object 4 contains an object of type text.

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