Share E-Book

MATLABSimulink Sensor Fusion and Tracking Toolbox Reference (The MathWorks, Inc.) (z-library.sk, 1lib.sk, z-lib.sk)

Author

,

Rating No ratings yet

Log in to rate

Matlab
Language English

No Description

Format PDF
Size 13.7 MB
6
Views
(First 20 pages)

Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Page 1
Sensor Fusion and Tracking Toolbox™ Reference R2021b
Page 2
How to Contact MathWorks Latest news: www.mathworks.com Sales and services: www.mathworks.com/sales_and_services User community: www.mathworks.com/matlabcentral Technical support: www.mathworks.com/support/contact_us Phone: 508-647-7000 The MathWorks, Inc. 1 Apple Hill Drive Natick, MA 01760-2098 Sensor Fusion and Tracking Toolbox™ Reference Guide © COPYRIGHT 2018 – 2021 by The MathWorks, Inc. The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form without prior written consent from The MathWorks, Inc. FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through the federal government of the United States. By accepting delivery of the Program or Documentation, the government hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014. Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and Documentation by the federal government (or other entity acquiring for or through the federal government) and shall supersede any conflicting contractual terms or conditions. If this License fails to meet the government's needs or is inconsistent in any respect with federal procurement law, the government agrees to return the Program and Documentation, unused, to The MathWorks, Inc. Trademarks MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be trademarks or registered trademarks of their respective holders. Patents MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for more information. Revision History September 2018 Online only New for Version 1.0 (Release 2018b) March 2019 Online only Revised for Version 1.1 (Release 2019a) September 2019 Online only Revised for Version 1.2 (Release 2019b) March 2020 Online only Revised for Version 1.3 (Release 2020a) September 2020 Online only Revised for Version 2.0 (Release 2020b) March 2021 Online only Revised for Version 2.1 (Release 2021a) September 2021 Online only Revised for Version 2.2 (Release 2021b)
Page 3
Functions 1 Classes 2 System Objects 3 Blocks 4 Apps 5 iii Contents
Page 4
(This page has no text content)
Page 5
Functions 1
Page 6
allanvar Allan variance Syntax [avar,tau] = allanvar(Omega) [avar,tau] = allanvar(Omega,m) [avar,tau] = allanvar(Omega,ptStr) [avar,tau] = allanvar(___,fs) Description Allan variance is used to measure the frequency stability of oscillation for a sequence of data in the time domain. It can also be used to determine the intrinsic noise in a system as a function of the averaging time. The averaging time series τ can be specified as τ = m/fs. Here fs is the sampling frequency of data, and m is a list of ascending averaging factors (such as 1, 2, 4, 8, …). [avar,tau] = allanvar(Omega) returns the Allan variance avar as a function of averaging time tau. The default averaging time tau is an octave sequence given as (1, 2, ..., 2floor{log2[(N-1)/2]}), where N is the number of samples in Omega. If Omega is specified as a matrix, allanvar operates over the columns of omega. [avar,tau] = allanvar(Omega,m) returns the Allan variance avar for specific values of tau defined by m. Since the default frequency fs is assumed to be 1, the output tau is exactly same with m. [avar,tau] = allanvar(Omega,ptStr) sets averaging factor m to the specified point specification, ptStr. Since the default frequency fs is 1, the output tau is exactly equal to the specified m. ptStr can be specified as 'octave' or 'decade'. [avar,tau] = allanvar(___,fs) also allows you to provide the sampling frequency fs of the input data omega in Hz. This input parameter can be used with any of the previous syntaxes. Examples Determine Allan Variance of Single Axis Gyroscope Load gyroscope data from a MAT file, including the sample rate of the data in Hz. Calculate the Allan variance. load('LoggedSingleAxisGyroscope','omega','Fs') [avar,tau] = allanvar(omega,'octave',Fs); Plot the Allan variance on a loglog plot. loglog(tau,avar) xlabel('\tau') ylabel('\sigma^2(\tau)') title('Allan Variance') grid on 1 Functions 1-2
Page 7
Determine Allan Deviation at Specific Values of τ Generate sample gyroscope noise, including angle random walk and rate random walk. numSamples = 1e6; Fs = 100; nStd = 1e-3; kStd = 1e-7; nNoise = nStd.*randn(numSamples,1); kNoise = kStd.*cumsum(randn(numSamples,1)); omega = nNoise+kNoise; Calculate the Allan deviation at specific values of m = τ. The Allan deviation is the square root of the Allan variance. m = 2.^(9:18); [avar,tau] = allanvar(omega,m,Fs); adev = sqrt(avar); Plot the Allan deviation on a loglog plot. loglog(tau,adev) xlabel('\tau') ylabel('\sigma(\tau)') allanvar 1-3
Page 8
title('Allan Deviation') grid on Input Arguments Omega — Input data N-by-1 vector | N-by-M matrix Input data specified as an N-by-1 vector or an N-by-M matrix. N is the number of samples, and M is the number of sample sets. If specified as a matrix, allanvar operates over the columns of Omega. Data Types: single | double m — Averaging factor scalar | vector Averaging factor, specified as a scalar or vector with ascending integer values less than (N-1)/2, where N is the number of samples in Omega. Data Types: single | double ptStr — Point specification of m 'octave' (default) | 'decade' Point specification of m, specified as 'octave' or 'decade'. Based on the value of ptStr, m is specified as following: 1 Functions 1-4
Page 9
• If ptStr is specified as 'octave', m is: 20, 21...2 log2 N − 1 2 • If ptStr is specified as 'decade', m is: 100, 101...10 log10 N − 1 2 N is the number of samples in Omega. fs — Basic frequency of input data in Hz scalar Basic frequency of the input data, Omega, in Hz, specified as a positive scalar. Data Types: single | double Output Arguments avar — Allan variance of input data vector | matrix Allan variance of input data at tau, returned as a vector or matrix. tau — Averaging time of Allan variance vector | matrix Averaging time of Allan variance, returned as a vector, or a matrix. See Also gyroparams | imuSensor Introduced in R2019a allanvar 1-5
Page 10
ctrect Constant turn-rate rectangular target motion model Syntax updatedstates = ctrect(states) updatedstates = ctrect(states,dt) updatedstates = ctrect(states,w,dt) Description updatedstates = ctrect(states) returns the updated rectangular states from the current rectangular states based on the rectangular target motion model. The default time step is 1 second. updatedstates = ctrect(states,dt) specifies the time step, dt, in seconds. updatedstates = ctrect(states,w,dt) additionally specifies the process noise, w. Examples Predict Constant Turn-Rate Rectangular State Define a rectangular state. state = [1 2 2 30 1 4.7 1.8]; Predict the state dt = 1 second forward using the default syntax. state = ctrect(state,0.1) state = 1×7 1.1731 2.1002 2.0000 30.1000 1.0000 4.7000 1.8000 Predict the state dt = 0.1 second forward without noise. state = ctrect(state,0.1) state = 1×7 1.3461 2.2006 2.0000 30.2000 1.0000 4.7000 1.8000 Predict the state dt = 0.1 second forward with noise. state = ctrect(state,0.01,0.1) state = 1×7 1.5189 2.3014 2.0010 30.3000 1.0010 4.7000 1.8000 1 Functions 1-6
Page 11
Predict Multiple Constant Turn-Rate Rectangular States Define a state matrix. states = [1 3 4;-1 2 10;5 3 1.3;1 1.3 2.1;30 0 -30;4.7 3.4 4.5;1.8 2 3]; Predict the state dt = 1 second ahead. states = ctrect(states) states = 7×3 5.7516 5.9992 5.2528 0.3625 2.0681 9.7131 5.0000 3.0000 1.3000 31.0000 1.3000 -27.9000 30.0000 0.0000 -30.0000 4.7000 3.4000 4.5000 1.8000 2.0000 3.0000 Predict the state dt = 0.1 second ahead without noise. states = ctrect(states,0.1) states = 7×3 6.1732 6.2992 5.3660 0.6311 2.0749 9.6493 5.0000 3.0000 1.3000 34.0000 1.3000 -30.9000 30.0000 0.0000 -30.0000 4.7000 3.4000 4.5000 1.8000 2.0000 3.0000 Predict the state dt = 0.1 second ahead with noise. states = ctrect(states,0.1*randn(2,3),0.1) states = 7×3 6.5805 6.5979 5.4759 0.9216 2.0816 9.5795 5.0054 2.9774 1.3032 37.0009 1.3004 -33.9007 30.0183 0.0086 -30.0131 4.7000 3.4000 4.5000 1.8000 2.0000 3.0000 Input Arguments states — Current rectangular states 1-by-7 real-valued vector | 7-by-1 real-valued vector | 7-by-N real-valued matrix ctrect 1-7
Page 12
Current rectangular states, specified as a 1-by-7 real-valued vector, 7-by-1 real-valued vector, or a 7- by-N real-valued matrix, where N is the number of states. The seven dimensional rectangular target state is defined as [x; y; s; θ; ω; L; W]: Variable Meaning Unit x Position of the rectangle center in x direction m y Position of the rectangle center in y direction m s Speed in the heading direction m/s θ Orientation angle of the rectangle with respect to x direction degree ω Turn-rate degree/s L Length of the rectangle m W Width of the rectangle m Example: [1;2;2;30;1;4.7;1.8] Data Types: single | double dt — Time step real-valued positive scalar Time step, specified as a real-valued positive scalar in second. Data Types: single | double w — Process noise real scalar | 2-by-N real-valued matrix Process noise, specified as a 2-by-N real-valued matrix, where N is the number of states specified in the states input. If specified as a scalar, it is expanded to a 2-by-N matrix with all elements equal to 1 Functions 1-8
Page 13
the scalar. The first row of the matrix specifies the process noise in acceleration (m/s2). The second row specifies the process noise in yaw acceleration (degrees/s2). Data Types: single | double Output Arguments updatedstates — Updated states 1-by-7 real-valued vector | 7-by-1 real-valued vector | 7-by-N real-valued matrix Updated states, specified as a 1-by-7 real-valued vector, a 7-by-1 real-valued vector, or a 7-by-N real- valued matrix, where N is the number of states. The dimensions and setups of updatedstates output are exactly the same as those of the states input. Data Types: single | double Extended Capabilities C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™. See Also gmphd | trackerPHD | ctrectmeas | ctrectmeasjac | ctrectjac | initctrectgmphd | ctrectcorners Introduced in R2019b ctrect 1-9
Page 14
ctrectmeas Constant turn-rate rectangular target measurement model Syntax measurements = ctrectmeas(states,detections) Description measurements = ctrectmeas(states,detections) returns the expected measurements from the current rectangular states and detections. Examples Expected Detections Using Rectangular Measurement Model Load detections and truth generated from a rectangular target. load('rectangularTargetDetections.mat','detections','truthState'); Generate expected detections from the target's rectangular state and actual detections using ctrectmeas. tgtState = [3;48;0;60;0;5;1.9]; zExp = ctrectmeas(tgtState,detections); Set up visualization environment using theaterPlot. theaterP = theaterPlot; stateP = trackPlotter(theaterP,'DisplayName','State','MarkerFaceColor','g'); truthP = trackPlotter(theaterP,'DisplayName','Truth','MarkerFaceColor', 'b'); detP = detectionPlotter(theaterP,'DisplayName','Detections','MarkerFaceColor','r'); expDetP = detectionPlotter(theaterP,'DisplayName','Expected Detections','MarkerFaceColor','y'); l = legend(theaterP.Parent); l.AutoUpdate = 'on'; hold on; assignP = plot(theaterP.Parent,NaN,NaN,'-.','DisplayName','Association'); Plot actual and expected detections. inDets = [detections{:}]; inMeas = horzcat(inDets.Measurement); detP.plotDetection(inMeas'); zExpPlot = reshape(zExp,3,[]); expDetP.plotDetection(zExpPlot'); Plot association lines. zLines = nan(2,numel(detections)*3); zLines(1,1:3:end) = zExpPlot(1,:); 1 Functions 1-10
Page 15
zLines(2,1:3:end) = zExpPlot(2,:); zLines(1,2:3:end) = inMeas(1,:); zLines(2,2:3:end) = inMeas(2,:); assignP.XData = zLines(1,:); assignP.YData = zLines(2,:); Plot truth and state. truthPos = [truthState(1:2);0]; truthDims = struct('Length',truthState(6),... 'Width',truthState(7),... 'Height', 0,... 'OriginOffset', [0 0 0]); truthOrient = quaternion([truthState(4) 0 0],'eulerd', 'ZYX','frame'); truthP.plotTrack(truthPos',truthDims,truthOrient); statePos = [tgtState(1:2);0]; stateDims = struct('Length',tgtState(6),... 'Width',tgtState(7),... 'Height',0,... 'OriginOffset', [0 0 0]); stateOrient = quaternion([tgtState(4) 0 0],'eulerd', 'ZYX','frame'); stateP.plotTrack(statePos', stateDims, stateOrient); ctrectmeas 1-11
Page 16
Input Arguments states — Current rectangular states 7-by-N real-valued matrix Current rectangular states, specified as a 7-by-N real-valued matrix, where N is the number of states. The seven-dimensional rectangular target state is defined as [x; y; s; θ; ω; L; W]: Variable Meaning Unit x Position of the rectangle center in x direction m y Position of the rectangle center in y direction m s Speed in the heading direction m/s θ Orientation angle of the rectangle with respect to x direction degree ω Turn-rate degree/s L Length of the rectangle m W Width of the rectangle m Example: [1;2;2;30;1;4.7;1.8] Data Types: single | double detections — Detections of target 1-by-M cell array of objectDetection objects Detections of target, specified as a 1-by-M cell array of objectDetection objects. The MeasurementParameters property (that specifies the transformation from the state-space to measurement-space) for each object must be the same for all the detections in the cell array. 1 Functions 1-12
Page 17
Output Arguments measurements — Expected measurements P-by-N-by-M real-valued array Expected measurements, returned as a P-by-N-by-M real-valued array. P is the dimension of each measurement specified in the detections input, N is the number of states specified in the states input, and M is the number of detections specified in the detections input. Extended Capabilities C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™. See Also trackerPHD | gmphd | ctrect | ctrectmeasjac | ctrectjac | initctrectgmphd | ctrectcorners Introduced in R2019b ctrectmeas 1-13
Page 18
ctrectmeasjac Jacobian of constant turn-rate rectangular target measurement model Syntax jacobian = ctrectmeasjac(state,detections) Description jacobian = ctrectmeasjac(state,detections) returns the Jacobian based on the current rectangular target state and detections. Examples Generate Jacobian for Rectangular Target Model Load detections generated from a rectangular target. load('rectangularTargetDetections.mat','detections'); Calculate Jacobian based on the rectangular state of the target and detections. tgtState = [3;48;0;60;0;5;1.9]; jac = ctrectmeasjac(tgtState,detections); jac1 = jac(:,:,1) jac1 = 3×7 1.0000 0 0 0.0461 0 -0.2500 0.4330 0 1.0000 0 -0.0075 0 -0.4330 -0.2500 0 0 0 0 0 0 0 Input Arguments state — Current rectangular target state 7-by-1 real-valued vector Current rectangular target state, specified as a 7-by-1 real-valued vector. The seven dimensional rectangular target state is defined as [x; y; s; θ; ω; L; W]. The meaning of these variables and their units are: Variable Meaning Unit x Position of the rectangle center in x direction m y Position of the rectangle center in y direction m 1 Functions 1-14
Page 19
s Speed in the heading direction m/s θ Orientation angle of the rectangle with respect to x direction degree ω Turn-rate degree/s L Length of the rectangle m W Width of the rectangle m Example: [1;2;2;30;1;4.7;1.8] Data Types: single | double detections — Detections of target 1-by-M cell array of objectDetection objects Detections of target, specified as a 1-by-M cell array of objectDetection objects. The MeasurementParameters property (that specifies the transformation from the state-space to measurement-space) for each object must be the same for all the detections in the cell array. Output Arguments jacobian — Jacobian of measurement model M-by-7-by-D real-valued array Jacobian of measurement model, returned as a M-by-7-by-D real-valued array. M is the dimension of each measurement specified in detections, and D is the number of detections specified in the detections input. Extended Capabilities C/C++ Code Generation Generate C and C++ code using MATLAB® Coder™. ctrectmeasjac 1-15
Page 20
See Also trackerPHD | gmphd | ctrect | ctrectmeas | ctrectjac | initctrectgmphd | ctrectcorners Introduced in R2019b 1 Functions 1-16
The above is a preview of the first 20 pages. Register to read the complete e-book.

Recommended for You

Loading recommended books...
Failed to load, please try again later

Tip the Site

Scan the WeChat Pay or Alipay code to tip. No login required.

WeChat Pay
Alipay
← Back to List