Main Content

hasTrackerInput

Determine whether tracker needs additional input for target specification

Since R2024b

    Description

    tf = hasTrackerInput(targetSpec) returns a logical value of 1 (true) if a tracker initialized with targetSpec requires additional target specification as input to update. The function returns a logical value of 0 (false) otherwise.

    example

    Examples

    collapse all

    Create target specification objects and determine whether a tracker initialized with each of these objects requires additional input.

    helicopterSpec = trackerTargetSpec("aerospace","aircraft","helicopter");
    tfHelicopterSpec = hasTrackerInput(helicopterSpec)
    tfHelicopterSpec = logical
       0
    
    
    truckSpec = trackerTargetSpec("automotive","truck","highway-driving");
    truckSpec.ReferenceFrame = "global";
    tfTruckSpec = hasTrackerInput(truckSpec)
    tfTruckSpec = logical
       0
    
    
    carSpec = trackerTargetSpec("automotive","car","highway-driving");
    tfCarSpec = hasTrackerInput(carSpec)
    tfCarSpec = logical
       1
    
    

    If the return is true, you can use the dataFormat function on the target specification object to determine the data format required by the tracker.

    dataFormat(carSpec)
    ans = struct with fields:
                             Time: 0
        EgoPositionalDisplacement: [0 0 0]
        EgoRotationalDisplacement: [0 0 0]
    
    

    Input Arguments

    collapse all

    Target specification, specified as a target specification object. You can use the trackerTargetSpec function to generate target specification objects.

    Output Arguments

    collapse all

    Logical value indicating whether a tracker initialized with targetSpec requires additional target specification input to update. See the dataFormat function for information on how to provide additional input to the tracker.

    Tip

    Currently, hasTrackerInput only returns true for the HighwayTruck and HighwayCar objects with their ReferenceFrame property set to "ego".

    Version History

    Introduced in R2024b