将检测转换为对象电视
格式
这些示例显示了如何将传感器天然格式的实际检测转换为对象电视
对象。对象电视
是传感器融合和跟踪工具箱中大多数过滤器和跟踪器的标准输入格式。五个示例逐渐显示了如何设置对象电视
带有各种跟踪方案。
一个对象电视
报告必须包含基本检测信息:Time
和测量
。它还可以包含其他关键属性,包括测量Noise
,,,,SensorIndex
,,,,ObjectClassid
,,,,ObjectAttributes
, 和测量Parameters
。配置测量Parameters
正确地使过滤器或跟踪器可以解释测量对于创建至关重要对象电视
。这first example shows the basic setup of an对象电视
。其余的示例着重于如何正确设置测量Parameters
。
示例1:转换固定矩形框架中的检测
考虑使用固定塔和卡车的2D跟踪场景。位于场景框架原点的塔配备了雷达传感器。在 = 0 seconds, the truck at the position of (10,20,0) meters is traveling in the positive 方向以5 m/s的速度。
雷达传感器在场景框架中输出3-D位置和速度测量值,因此测量可以写如下:
MEASUREMT1 = [10; 20; 0; 5; 0; 0; 0];%[x; y; z; vx; vy; vz]
you can specify additional properties such asMeasurmentNoise
,,,,SensorIndex
,,,,ObjectClassid
, 和ObjectAttributes
for the对象电视
目的。例如,假设位置和速度测量噪声的标准偏差分别为10 m和1 m/s,则可以将测量误差协方差矩阵定义为:
mesurementNoise1 = diag([[10*一个(3,1);一个(3,1)]);
创建一个对象电视
使用这些值。
time1 = 0;检测时间%detect1 = objectDetection(time1,measurement1,“ suberumentnoise',MesurementNoise1)
detect1 =具有属性的对象进行:时间:0测量:[6x1 double] suberemementNoise:[6x6 double] sensorIndex:1 objectClassId:0 MeasurementParameters:{} objectAttributes:{}
示例2:转换在移动矩形框架中的检测
考虑使用自我汽车和卡车的2D跟踪场景。在 = 0秒,相对于场景框架,汽车位于(20,10,0)米。汽车以5 m/s的速度移动 direction of the scenario frame. The local (forward) frame of the ego car, { ,,,, },从场景框架旋转,角度为90度。与上一个示例一样,(10,20,0)米的位置的卡车正在正向行驶 方向以5 m/s的速度。
Meanwhile, the ego car is observing the truck in its own local frame, {
,,,,
}。In practice, you can obtain the measurement directly from the sensor system of the ego car. From the figure, the measurements of the truck are [10; 10; 0 -5; -5; 0] with respect to the {
,,,,
}以[x; y; z; vx; vy; vz
]。
测量2= [10; 10; 0; -5; -5; 0];%[x; y; z; vx; vy; vz]
要指定对象检测,您需要从场景矩形帧{
,,,,
}到本地矩形框架{
,,,,
}。您可以使用测量Parameters
财产的对象电视
指定这些转换参数。在转换中,场景框架是父母frame, and the ego car local frame is the孩子框架。
这
框架
属性将儿童框架类型设置为'长方形'
(在此示例中)或球形'
。这
OriginPosition
属性设置了子框架相对于父框架的原点位置。这
原始性
属性设置了子框架相对于父框架的起点的速度。
MP2 = struct(); MP2.Frame ='长方形';mp2.originposition = [20;10;0];mp2.originvelocity = [0;5;0];
使用从Euler角转换的旋转矩阵指定旋转。放iSparenttochild
至真的至indicate rotation from the parent frame to the child frame.
rotangle2 = [90 0 0];%[偏航,音调,行]rotQuat2 = quaternion(rotAngle2,“欧拉”,,,,'zyx',,,,'框架');rotMatrix2 = rotmat(rotQuat2,'框架');mp2.方向= rotmatrix2;mp2.isparenttochild = true;
Specify measurements.
放
征服
和hasazimut
both to错误的
,由于子框架是矩形。放
hatrange
至真的
实现位置测量。放
大麻
至真的
至enable velocity measurement.
mp2.haselevation = false;mp2.hasazimuth = false;mp2.hasrange = true;mp2.hasvelocity = true;
Create the对象电视
object and specify the测量Parameters
财产。
time2 = 0;检测2 = objectDetection(time2,measurement2,“测量参数”,,,,MP2)
detection2 = objectDetection with properties: Time: 0 Measurement: [6x1 double] MeasurementNoise: [6x6 double] SensorIndex: 1 ObjectClassID: 0 MeasurementParameters: [1x1 struct] ObjectAttributes: {}
To verify the object detection, you can use theCVMEAS
测量功能以再生测量。这CVMEAS
function can take the actual state of the target and measurement parameters as input. The state input ofCVMEAS
按照[X;vx;y;vy;z;vz
]。如以下输出所示,结果与测量2
。
state2 = [10; 5; 20; 0; 0; 0];%[x; vx; y; vy; z; vz]cvmeas2 = cvmeas(state2,mp2)%[x; y; z; vx; vy; vz]
CVMEAS2 =6×110.0000 10.0000 0 -5.0000 -5.0000 0
示例3:转换在移动球形框架中的检测
考虑先前的跟踪方案,直到现在,测量是通过带有球形输出框架的扫描雷达获得的。雷达的偏见方向与 方向(与 direction) at = 0 seconds.
由于卡车和汽车之间的相对速度朝着视线方向,因此测量值是[方位角的顺序;海拔;范围;范围率],可以如下获得:
测量3 = [45;0;10/sind(45);-5/sind(45)];%[az; el; rng; rr]。单位学位。
指定测量参数。
mp3 = struct();mp3.frame ='球形';%的子框架是球形的。mp3.originposition = [20;10;0];mp3.originvelocity = [0;5;0];% Specify rotation.rotAngle3 = [90 0 0]; rotQuat3 = quaternion(rotAngle3,“欧拉”,,,,'zyx',,,,'框架');rotmatrix3 = rotmat(rotquat3,'框架');mp3.方向= rotmatrix3;mp3.isparenttochild = true;
放征服
和hasazimut
至真的
在球形子框架中输出方位角和高程角。放hatrange
和大麻
both to真的
分别为输出范围和范围速率。
mp3.haselevation = true;mp3.hasazimuth = true;mp3.hasrange = true;mp3.hasvelocity = true;
Create the对象电视
目的。
time3 = 0;检测3 = objectDetection(time3,measurement3,“测量参数”,,,,MP3)
检测3 =带有属性的对象进行:时间:0测量:[4x1 double] smuesurementNoise:[4x4 double] sensorIndex:1 objectClassid:0 MeasurementParameters:[1x1 struct] objectAttributes:{}
Verify the results usingCVMEAS
。这results agree with测量3
。
state3 = [10; 5; 20; 0; 0; 0];%[x; vx; y; vy; z; vz]CVMEAS3 = cvmeas(state3,MP3)% [az;el;rng;rr]
CVMEAS3 =4×145.0000 0 14.1421 -7.0711
示例4:在三帧之间转换检测
Consider the previous tracking scenario, only now the boresight direction of the radar rotates 45 degrees from the direction of the car's local frame.
这new measurements, expressed in the new spherical frame { ,,,, }, are:
测量4 = [0;0;10/sind(45);-5/sind(45)];% [az;el;rng;rr]
测量的参数,您可以指定the rotation as a 135-degree rotation from the scenario frame to the new spherical frame. Alternately, you can specify it as two consecutive rotations: rectangular {
,,,,
}到矩形{
,,,,
}和矩形{
,,,,
}到球形{
,,,,
}。为了说明由金宝app测量Parameters
属性,此示例使用后一种方法。
第一组测量参数与MP2
used in示例2。MP2
从矩形{
,,,,
} to the rectangular {
,,,,
}。对于第二组测量参数,MP4
,您只需要从矩形{
,,,,
} to the spherical {
,,,,
}。
mp4 = struct();mp4.frame ='球形';mp4.originposition = [0;0;0];同位位置%。mp4.originvelocity = [0;0;0];% Same origin velocities.% Specify rotation.rotangle4 = [45 0 0];rotquat4 = Quaternion(Rotangle4,“欧拉”,,,,'zyx',,,,'框架');rotmatrix4 = rotmat(rotquat4,'框架');mp4.取向= rotmatrix4;mp4.isparenttochild = true;%在球形子框架中指定输出。mp4.haselevation = true;mp4.hasazimuth = true;mp4.hasrange = true;mp4.hasvelocity = true;
创建组合测量Parameters
输入,MPc
。
mpc = [mp4 mp2];
Create the对象电视
目的。
time4 = 0;检测4 = objectDetection(time4,measurement4,“测量参数”,MPC)
detection4 = objectDetection with properties: Time: 0 Measurement: [4x1 double] MeasurementNoise: [4x4 double] SensorIndex: 1 ObjectClassID: 0 MeasurementParameters: [1x2 struct] ObjectAttributes: {}
Verify the results usingCVMEAS
。这result agrees with测量4
。
state4 = [10;5;20;0;0;0];%[x; vx; y; vy; z; vz]cvmeas4 = cvmeas(state4,mpc)%[az; el; rr; rrate]
CVMEAS4 =4×10.0000 0 14.1421 -7.0711
示例5:转换3D检测
考虑监测区域的无人飞行器(UAV)。在 = 0秒,相对于全球向北(NED)框架,无人机处于(5,5,-1)km的位置。无人机的速度为(-50,-100,5)m/s。无人机车身框架的方向{ ,,,, ,,,, 关于全局的NED框架,在偏航,音高和滚动中以(-120,2,2)度给出。同时,(1,1,0)公里处的一辆汽车以30 m/s的速度向东移动。无人机使用与自己的车轴对齐的雷达系统测量汽车。
基于此信息,为测量转换指定运动学参数。
指定UAV车身框架的框架类型,原点位置和原点速度。
mp5 = struct();mp5.frame ='球形';mp5.originposition = [5000;5000;-1000];mp5.originvelocity = [-50;-100;5];
指定从NED框架到UAV车身框架的旋转。
Rot_angle5 = [-120 2 2];% [yaw,pitch,roll]Rot_quat5 = quaternion(Rot_angle5,“欧拉”,,,,'zyx',,,,'框架');rot_matrix5 = rotmat(rot_quat5,'框架');mp5.方向= rot_matrix5;mp5.isparenttochild = true;
在球形框架中指定输出测量。
mp5.haselevation = true;mp5.hasazimuth = true;mp5.hasrange = true;mp5.hasvelocity = true;
您可以直接从无人机上的雷达系统获得测量。使用CVMEAS
功能是获得测量。该测量是根据[方位角;高度;范围;范围率]的顺序。
car_state5 = [1000;0;1000;30;0;0];%[x; vx; y; vy; z; vz]。Measurement5 = CVMEAS(CAR_STATE5,MP5);MEAS_AZ5 = MEAKUREMENT5(1)
MES_AZ5 = -14.6825
meas_el5 = measurement5(2)
MEAS_EL5 = 12.4704
MES_RNG5 = MEATEREMENT5(3)
MES_RNG5 = 5.7446E+03
meas_rr5 = measurement5(4)
MES_RR5 = -126.2063
这elevation angle is defined as an angle from the xy-plane to the z direction. That is why the elevation angle is positive for a target on the ground relative to the UAV. This convention is used throughout the toolbox.
方位角,高程,范围和范围率的测量噪声分别为[1,1,20,2]。同样,雷达的索引为2,雷达可以将检测到的对象分类为1的类型'car'
。
index5 = 2; covariance5 = diag([1;1;20;2]); classID5 = 1;
创建一个对象电视
检测对象。
time5 = 0; detection = objectDetection(time5,measurement5,“ SensorIndex”,,,,index5,...“ suberumentnoise',,,,covariance5,“ ObjectClassId”,,,,classID5,“测量参数”,,,,MP5)
detection = objectDetection with properties: Time: 0 Measurement: [4x1 double] MeasurementNoise: [4x4 double] SensorIndex: 2 ObjectClassID: 1 MeasurementParameters: [1x1 struct] ObjectAttributes: {}