Main Content

setTrackFilterProperties

Sets values of track filter properties

    Description

    example

    setTrackFilterProperties(tracker,trackID,property,value) sets the specified tracking filter property to the indicated value for a specific track within the radar tracker. trackID is the ID of that specific track.

    setTrackFilterProperties(tracker,trackID,property1,value1,...,propertyN,valueN) sets multiple property values. You can specify the property-value pairs in any order.

    Examples

    collapse all

    Create a radarTracker System object™ using a constant-acceleration, linear Kalman filter for all tracks.

    tracker = radarTracker('FilterInitializationFcn',@initcakf, ...
        'ConfirmationThreshold',[4 5],'DeletionThreshold',[9 9]);

    Create two detections and generate tracks for these detections.

    detection1 = objectDetection(1.0,[10; 10]);
    detection2 = objectDetection(1.0,[1000; 1000]);
    [~,tracks] = tracker([detection1 detection2],1.1)
    tracks=2×1 object
      2x1 objectTrack array with properties:
    
        TrackID
        BranchID
        SourceIndex
        UpdateTime
        Age
        State
        StateCovariance
        StateParameters
        ObjectClassID
        TrackLogic
        TrackLogicState
        IsConfirmed
        IsCoasted
        IsSelfReported
        ObjectAttributes
    
    

    Get filter property values for the first track. Display the process noise values.

    values = getTrackFilterProperties(tracker,1,'MeasurementNoise','ProcessNoise','MotionModel');
    values{2}
    ans = 6×6
    
        0.0000    0.0005    0.0050         0         0         0
        0.0005    0.0100    0.1000         0         0         0
        0.0050    0.1000    1.0000         0         0         0
             0         0         0    0.0000    0.0005    0.0050
             0         0         0    0.0005    0.0100    0.1000
             0         0         0    0.0050    0.1000    1.0000
    
    

    Set new values for this property by doubling the process noise for the first track. Display the updated process noise values.

    setTrackFilterProperties(tracker,1,'ProcessNoise',2*values{2});
    values = getTrackFilterProperties(tracker,1,'ProcessNoise');
    values{1}
    ans = 6×6
    
        0.0001    0.0010    0.0100         0         0         0
        0.0010    0.0200    0.2000         0         0         0
        0.0100    0.2000    2.0000         0         0         0
             0         0         0    0.0001    0.0010    0.0100
             0         0         0    0.0010    0.0200    0.2000
             0         0         0    0.0100    0.2000    2.0000
    
    

    Input Arguments

    collapse all

    Radar tracker, specified as a radarTracker object.

    Track ID, specified as a positive integer. trackID must be a valid track in tracker.

    Tracking filter property to set values for, specified as a character vector or string scalar. property must be a valid property of the tracking filter used by tracker. Valid tracking filters are trackingKF, trackingEKF, and trackingUKF.

    You can specify additional property-value pairs in any order.

    Example: 'MeasurementNoise',eye(2,2),'MotionModel','2D Constant Acceleration'

    Data Types: char | string

    Value to set the corresponding tracking filter property to, specified as a MATLAB expression. value must be a valid value of the corresponding property.

    You can specify additional property-value pairs in any order.

    Example: 'MeasurementNoise',eye(2,2),'MotionModel','2D Constant Acceleration'

    Extended Capabilities

    C/C++ Code Generation
    Generate C and C++ code using MATLAB® Coder™.

    Introduced in R2021a