ctrect
State transition function of constant turn-rate motion model for rectangular targets
Syntax
Description
returns the predicted rectangular states from the current rectangular
predictedState
= ctrect(states
)states
, based on the constant turn-rate motion model. The default
time step is 1 second.
specifies the time step, predictedState
= ctrect(states
,dt
)dt
, in seconds.
additionally specifies the process noise, predictedState
= ctrect(states
,w
,dt
)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
= 0.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
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
real-valued seven-element row or column vector | 7-by-N real-valued matrix
Current rectangular states, specified as a real-valued seven-element row or column 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 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
predictedState
— Predicted state at next time step
1-by-7 real-valued vector | 7-by-1 real-valued vector | 7-by-N real-valued matrix
Predicted state, 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 predictedState
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™.
Version History
Introduced in R2019b
See Also
gmphd
| trackerPHD
| ctrectmeas
| ctrectmeasjac
| ctrectjac
| initctrectgmphd
| ctrectcorners
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)