Main Content

objectDetectionDelay

Simulate out-of-sequence object detections

Since R2022a

Description

The objectDetectionDelay System object™ adds a delay to detections before they are passed from sensors to trackers. Use the objectDetectionDelay System object to simulate out-of-sequence measurements (OOSMs), which are measurements delayed due to sensor processing time or network lag.

To delay measurements at the current time and output previously stored OOSMs:

  1. Create the objectDetectionDelay object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

delayer = objectDetectDelay creates an objectDetectionDelay object delayer, that adds a delay to sensor detections to simulate out-of-sequence measurements..

delayer = objectDetectDelay(Name=Value) specifies Properties using one or more name-value arguments. For example, delayer = objectDetectionDelay(Capacity=50) sets the maximum number of detections the delayer object can store to 50. Unspecified properties have default values.

example

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Indices of sensors to which apply time delay, specified as a vector of distinct positive integers. The object applies the time delay to detections from the sensors whose sensor indices are listed in the vector.

To apply the delay to all the detections, use the default value "All".

Data Types: single | double

Maximum number of stored detections, specified as a positive integer or Inf.

  • If you specify the property as Inf, the object can store an unlimited number of delayed detections.

  • If you specify the property as a positive integer, the object stores a number of detections up to the property value. With this specification, the object supports non-dynamic memory allocation in code generation. The object returns an error if you exceed the specified capacity.

Data Types: single | double

Source of the delay, specified as "Property" or "Input".

  • If you specify the delay source as "Property", you can control the delay applied to the detections using the DelayDistribution and DelayParameters properties.

  • If you specify the delay source as "Input", you can control the time delay by specifying the delay input argument when calling the object.

Type of delay distribution, specified as:

  • "Constant" — The time delay is a constant value, defined in the DelayParameters property.

  • "Uniform" — The time delay follows a uniform distribution, whose upper and lower limits are defined in the DelayParameters property.

  • "Normal" — The time delay follows a normal distribution, whose mean and standard deviation are defined in the DelayParameters property.

Dependencies

To enable this property, set the DelaySource property to "Property".

Parameters of the delay distribution, specified as a nonnegative scalar or a two-element vector of nonnegative scalars. Specify this property based on the distribution type set in the DelayDistribution property:

  • "Constant" — Specify DelayPrameters as a nonnegative scalar.

  • "Uniform" — Specify DelayPrameters as a two-element vector of the form [lower,upper], where lower and upper are the lower and upper limits of the uniform distribution, respectively. Both values must be nonnegative.

  • "Normal" — Specify DelayPrameters as a two-element vector of the form [mean,sigma], where mean and sigma are the mean and standard deviation of the normal distribution, respectively. Both values must be nonnegative.

Dependencies

To enable this property, set the DelaySource property to "Property".

Data Types: single | double

Usage

Description

delayDetections = delayer(detections,currentTime) stores the detections with a delay defined by the properties of the ObjectDetectionDelay object delayer and returns the previously delayed detections that are deliverable at the current time. A delayed detection is deliverable if the summation of the original time of the detection (specified by its Time property) and the time delay applied to the detection is smaller than the current time.

Use this syntax only when the DelaySource property is set to "Property".

example

delayDetections = delayer(detections,currentTime,delay) directly specifies the time delay applied to the detections.

Use this syntax only when the DelaySource property is set to "Input".

[delayDetections,useCapacity,info] = delayer(___) also returns the used capacity and detailed information about the store detections.

example

Input Arguments

expand all

Object detections, specified as an N-element array of objectDetection objects, an N-element cell array of objectDetection objects, or an N-element array of structures whose field names are the same as the property names of the objectDetection object. N is the number of detections.

Current time of the system, specified as a nonnegative scalar. If you design a tracking system with a trackingScenario object, you can obtain the current time from the SimulationTime property of the trackingScenario object.

Data Types: single | double

Delay applied to detections, specified as a nonnegative scalar or an N-element vector of nonnegative values, where N is the number of detections specified in the detections input argument. If specified as a scalar, the specified delay applies to all detections.

Use this argument only when the DelaySource property is set to "Input".

Data Types: single | double

Output Arguments

expand all

Delayed object detections, returned as an M-element array of objectDetection objects, an M-element cell array of objectDetection objects, or an M-element array of structures whose field names are the same as the property names of the objectDetection object. The format of the returned delayed detections is same as that of the detections input. M is the number of detections that deliver at the current time.

A delayed detections is supposed to deliver at the current time if the summation of the original time of the detection (specified by its Time property or field) and the time delay applied to the detection is smaller than the current time.

Used capacity for storing delayed measurements in the objectDetectionDelay object, returned as a nonnegative integer.

Data Types: uint32

Information about the stored measurements in the objectDetectionDelay object, returned as a structure with these fields:

Field NameDescription
DetectionTimeThe original time of each stored detection, returned as a K-element vector of nonnegative values, where K is the number of stored detections.
DelayThe time delay applied to each stored detection, returned as a K-element vector of nonnegative values, where K is the number of stored detections.
DeliveryTimeThe delivery time of each stored detection, returned as a K-element vector of nonnegative values, where K is the number of stored detections.

Data Types: struct

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
cloneCreate duplicate System object
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object
isLockedDetermine if System object is in use

Examples

collapse all

Create an objectDetectionDelay object with the default distribution and set the SensorIndices property so that the object delays detections only from sensor 2 and sensor 3. By default, the object applies a constant time delay of 1 second for applicable detections.

delayer = objectDetectionDelay(SensorIndices=[2 3])
delayer = 
  objectDetectionDelay with properties:

        SensorIndices: [2 3]
             Capacity: Inf
          DelaySource: 'Property'
    DelayDistribution: 'Constant'
      DelayParameters: 1

Create one detection each from sensors 1, 2, and 3.

detection1 = objectDetection(0,[1;1;1],SensorIndex=1); % Detection time is at 0 second.
detection2 = objectDetection(0,[2;2;2],SensorIndex=2); % Detection time is at 0 second.
detection3 = objectDetection(1,[3;3;3],SensorIndex=3); % Detection time is at 1 second.

At time t = 0 seconds, pass detection1 and detection2 to the delayer object. The object delays detection2 by 1 second, but does not delay detection1 because sensor 1 is not specified in the SensorIndices property.

delayedDets0 = delayer({detection1 detection2},0);
disp("At time t = 0 seconds, the delivered detection is: " + newline)
At time t = 0 seconds, the delivered detection is: 
delayedDets0{:}
ans = 
  objectDetection with properties:

                     Time: 0
              Measurement: [3x1 double]
         MeasurementNoise: [3x3 double]
              SensorIndex: 1
            ObjectClassID: 0
    ObjectClassParameters: []
    MeasurementParameters: {}
         ObjectAttributes: {}

At time t = 1 second, pass detection3 to the delayer object. The object delays detection3 by 1 second. At this time, the previously delayed detection2 becomes deliverable, and the object returns it.

delayedDets1 = delayer({detection3},1);
disp("At time t = 1 second, the delivered detection is: " + newline)
At time t = 1 second, the delivered detection is: 
delayedDets1{:}
ans = 
  objectDetection with properties:

                     Time: 0
              Measurement: [3x1 double]
         MeasurementNoise: [3x3 double]
              SensorIndex: 2
            ObjectClassID: 0
    ObjectClassParameters: []
    MeasurementParameters: {}
         ObjectAttributes: {}

At time t = 2 seconds, the object returns the previously delayed detection3.

delayedDets2 = delayer({},2);
disp("At time t = 2 seconds, the delivered detection is: " + newline)
At time t = 2 seconds, the delivered detection is: 
delayedDets2{:}
ans = 
  objectDetection with properties:

                     Time: 1
              Measurement: [3x1 double]
         MeasurementNoise: [3x3 double]
              SensorIndex: 3
            ObjectClassID: 0
    ObjectClassParameters: []
    MeasurementParameters: {}
         ObjectAttributes: {}

Create an objectDetectionDelay object and set its DelaySource property as "Inputs" so that the object can accept a time delay input.

delay = objectDetectionDelay(DelaySource="Input") 
delay = 
  objectDetectionDelay with properties:

    SensorIndices: "All"
         Capacity: Inf
      DelaySource: 'Input'

Create four detections. The first detection is from sensor 1, the second and the third detections are from sensor 2, and the fourth detection is from sensor 3.

detection1 = objectDetection(0,[1;1;1],SensorIndex=1); % Detection time is at 0 second.
detection2 = objectDetection(0,[2;2;2],SensorIndex=2); % Detection time is at 0 second.
detection3 = objectDetection(0,[0;0;0],SensorIndex=2); % Detection time is at 0 second.
detection4 = objectDetection(1,[3;3;3],SensorIndex=3); % Detection time is at 1 second.

At time t = 0 seconds, pass detection1, detection2, and detection3 to the delayer object. Specify the delays of these detections as 0, 1, and 2 seconds, respectively. As a result, the object delivers detection1 immediately with no delay, delays detection2 by 1 second, and delays detection3 by 2 seconds.

[delayedDets0,usedCapacity0,info0]= delay({detection1 detection2 detection3},0,[0;1;2]);
disp("At time t = 0 seconds, the delivered detection is: " + newline)
At time t = 0 seconds, the delivered detection is: 
delayedDets0{:}
ans = 
  objectDetection with properties:

                     Time: 0
              Measurement: [3x1 double]
         MeasurementNoise: [3x3 double]
              SensorIndex: 1
            ObjectClassID: 0
    ObjectClassParameters: []
    MeasurementParameters: {}
         ObjectAttributes: {}

usedCapacity0
usedCapacity0 = uint32

2
info0
info0 = struct with fields:
    DetectionTime: [0 0]
            Delay: [1 2]
     DeliveryTime: [1 2]

At time t = 1 second, pass detection4 to the delayer object and delay it by 1 second. At this time, the previously delayed detection2 becomes deliverable and the object returns it.

delayedDets1= delay({detection4},1,1);
disp("At time t = 1 second, the delivered detection is: " + newline)
At time t = 1 second, the delivered detection is: 
delayedDets1{:}
ans = 
  objectDetection with properties:

                     Time: 0
              Measurement: [3x1 double]
         MeasurementNoise: [3x3 double]
              SensorIndex: 2
            ObjectClassID: 0
    ObjectClassParameters: []
    MeasurementParameters: {}
         ObjectAttributes: {}

At time t = 2 seconds, the previously delayed detection3 and detection4 become deliverable and the object return them.

delayedDets2 = delay({},2,1);
disp("At time t = 2 seconds, the delivered detections are: " + newline)
At time t = 2 seconds, the delivered detections are: 
delayedDets2{:}
ans = 
  objectDetection with properties:

                     Time: 0
              Measurement: [3x1 double]
         MeasurementNoise: [3x3 double]
              SensorIndex: 2
            ObjectClassID: 0
    ObjectClassParameters: []
    MeasurementParameters: {}
         ObjectAttributes: {}

ans = 
  objectDetection with properties:

                     Time: 1
              Measurement: [3x1 double]
         MeasurementNoise: [3x3 double]
              SensorIndex: 3
            ObjectClassID: 0
    ObjectClassParameters: []
    MeasurementParameters: {}
         ObjectAttributes: {}

Extended Capabilities

Version History

Introduced in R2022a