Main Content

tunerPlotPose

Plot filter pose estimates during tuning

Description

example

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.

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: [1x5 string]
          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.1149
    1            GyroscopeNoise                   0.1146
    1            GyroscopeDriftNoise              0.1146
    1            LinearAccelerationNoise          0.1122
    1            LinearAccelerationDecayFactor    0.1103
    2            AccelerometerNoise               0.1102
    2            GyroscopeNoise                   0.1098
    2            GyroscopeDriftNoise              0.1098
    2            LinearAccelerationNoise          0.1070
    2            LinearAccelerationDecayFactor    0.1053
    3            AccelerometerNoise               0.1053
    3            GyroscopeNoise                   0.1048
    3            GyroscopeDriftNoise              0.1048
    3            LinearAccelerationNoise          0.1016
    3            LinearAccelerationDecayFactor    0.1002
    4            AccelerometerNoise               0.1001
    4            GyroscopeNoise                   0.0996

Figure Tuning Results contains 3 axes. Axes 1 with title Orientation contains 2 objects of type line. This object represents Ground Truth. Axes 2 contains 2 objects of type line. Axes 3 contains 2 objects of type line. This object represents Filter Estimate.

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.

Introduced in R2021a