主要内容

将检测转换为对象电视Format

这些示例显示了如何将传感器天然格式的实际检测转换为对象电视对象。对象电视is the standard input format for most filters and trackers in Sensor Fusion and Tracking toolbox. The five examples progressively show how to set up对象电视with varied tracking scenarios.

  • Example 1configures the detection in a stationary rectangular frame.

  • Example 2在移动的矩形框架中配置检测。

  • Example 3在移动的球形框架中配置检测。

  • Example 4显示如何表达通过连续旋转获得的检测。

  • Example 5shows how to configure 3-D detections.

一个对象电视report must contain the basic detection information:时间and测量。它还可以包含其他关键属性,包括suberementNoise,,,,SensorIndex,,,,ObjectClassID,,,,objectattributes,,,,and测量参数。配置测量参数正确地使过滤器或跟踪器可以解释测量对于创建至关重要对象电视。第一个示例显示了一个基本设置对象电视。其余的示例着重于如何正确设置测量参数

示例1:转换固定矩形框架中的检测

考虑使用固定塔和卡车的2D跟踪场景。位于场景框架原点的塔配备了雷达传感器。在 t = 0秒,(10,20,0)米处的卡车在正处行驶 X direction at a speed of 5 m/s.

这radar sensor outputs 3-D position and velocity measurements in the scenario frame, so the measurement can be written as follows:

measurement1 = [10;20;0;5;0;0];% [x;y;z;vx;vy;vz]

您可以指定其他属性,例如MEATURMENTNOISE,,,,SensorIndex,,,,ObjectClassID,,,,andobjectattributes为了对象电视目的。例如,假设位置和速度测量噪声的标准偏差分别为10 m和1 m/s,则可以将测量误差协方差矩阵定义为:

measurementNoise1 = diag([10*ones(3,1);ones(3,1)]);

Create an对象电视using these values.

time1 = 0;检测时间%detect1 = objectDetection(time1,measurement1,'MeasurementNoise',,,,measurementNoise1)
detect1 =具有属性的对象进行:时间:0测量:[6x1 double] suberemementNoise:[6x6 double] sensorIndex:1 objectClassId:0 MeasurementParameters:{} objectAttributes:{}

示例2:转换在移动矩形框架中的检测

考虑使用自我汽车和卡车的2D跟踪场景。在 t = 0 seconds, the car is located at (20,10,0) meters with respect to the scenario frame. The car is moving with a speed of 5 m/s in the y 场景框架的方向。自我汽车的本地框架,{ X ,,,, y },从场景框架旋转,角度为90度。与上一个示例一样,(10,20,0)米的位置的卡车正在正向行驶 X direction at a speed of 5 m/s.

同时,自我汽车正在自己的本地框架观察卡车{ X ,,,, y }。实际上,您可以直接从自我汽车的传感器系统中获得测量。从图中,卡车的测量值为[10;10;0 -5;-5;0]关于{ X ,,,, y }以[X;y;z;vx;vy;vz]。

MESUREMENT2 = [10;10;0;-5;-5;0];% [x;y;z;vx;vy;vz]

To specify the object detection, you need to specify the coordinate transformation from the scenario rectangular frame { X ,,,, y } to the local rectangular frame { X ,,,, y }。you can use the测量参数财产的对象电视指定这些转换参数。在转换中,场景框架是父母框架,自我汽车本地框架是孩子框架。

  • Frameproperty sets the child frame type to '长方形'(in this example) or '球形'

  • 原始位置属性设置了子框架相对于父框架的原点位置。

  • OriginVelocityproperty sets the velocity of the origin of the child frame with respect to the parent frame.

mp2 = struct();mp2.frame ='长方形';MP2。原始位置=[20; 10; 0]; MP2.OriginVelocity = [0; 5; 0];

Specify rotation using the rotation matrix converted from Euler angles. SetIsParentToChild正确表示从父框架旋转到子框架。

rotAngle2 = [90 0 0];%[偏航,音调,行]rotquat2 = Quaternion(Rotangle2,“欧拉”,,,,'zyx',,,,'框架');rotmatrix2 = rotmat(rotquat2,'框架');MP2。Orientation = rotMatrix2; MP2.IsParentToChild = true;

指定测量。

  • HasElevationandhasazimut两者都错误的,由于子框架是矩形。

  • HasRangetotrueto enable position measurement.

  • 大麻totrue启用速度测量。

MP2。HasElevation = false; MP2.HasAzimuth = false; MP2.HasRange = true; MP2.HasVelocity = true;

创建对象电视对象并指定测量参数财产。

time2 = 0; detection2 = objectDetection(time2,measurement2,“测量参数”,MP2)
检测2 =带有属性的对象进行:时间:0测量:[6x1 double] smuesurementNoise:[6x6 double] sensorIndex:1 objectClassId:0 MeasurementParameters:[1x1 struct] objectAttributes:{}

要验证对象检测,您可以使用cvmeasmeasurement function to regenerate the measurement. Thecvmeas功能可以将目标的实际状态和测量参数作为输入。状态的输入cvmeasis in the order of [x; vx; y; vy; z; vz]。如以下输出所示,结果与measurement2

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

Example 3: Convert Detections in Moving Spherical Frame

考虑先前的跟踪方案,直到现在,测量是通过带有球形输出框架的扫描雷达获得的。雷达的偏见方向与 y direction (same as X 方向) t = 0秒。

由于卡车和汽车之间的相对速度朝着视线方向,因此测量值是[方位角的顺序;海拔;范围;范围率],可以如下获得:

measurement3 =[45; 0; 10/sind(45); -5/sind(45)];%[az; el; rng; rr]。Units in degrees.

Specify the measurement parameters.

mp3 = struct();mp3.frame ='球形';%的子框架是球形的。mp3.originposition = [20;10;0];mp3.originvelocity = [0;5;0];%指定旋转。rotangle3 = [90 0 0];rotquat3 = Quaternion(Rotangle3,“欧拉”,,,,'zyx',,,,'框架');rotmatrix3 = rotmat(rotquat3,'框架');MP3.Orientation = rotMatrix3; MP3.IsParentToChild = true;

HasElevationandhasazimuttotrue在球形子框架中输出方位角和高程角。放HasRangeand大麻两者都true分别为输出范围和范围速率。

mp3.haselevation = true;mp3.hasazimuth = true;mp3.hasrange = true;mp3.hasvelocity = true;

创建对象电视目的。

time3 = 0;检测3 = objectDetection(time3,measurement3,“测量参数”,mp3)
detection3 = objectDetection with properties: Time: 0 Measurement: [4x1 double] MeasurementNoise: [4x4 double] SensorIndex: 1 ObjectClassID: 0 MeasurementParameters: [1x1 struct] ObjectAttributes: {}

使用使用cvmeas。结果同意measurement3

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

Example 4: Convert Detections Between Three Frames

考虑以前的跟踪方案,直到现在,雷达的疏忽方向才从旋转45度 X 汽车本地框架的方向。

新的测量值,在新的球形框架中表达{ X ' ,,,, y ' }, 是:

测量4 = [0;0;10/sind(45);-5/sind(45)];%[az; el; rng; rr]

对于测量参数,您可以将旋转指定为从方案框架到新球形框架的135度旋转。或者,您可以将其指定为两个连续旋转:矩形{ X ,,,, y }到矩形{ X ,,,, y } and rectangular { X ,,,, y }到球形{ X ' ,,,, y ' }。为了说明由金宝app测量参数property, this example uses the latter approach.

第一组测量参数与MP2Example 2MP2accounts for the rotation from the rectangular { X ,,,, y }到矩形{ X ,,,, y }。对于第二组测量参数,MP4,您只需要从矩形{ X ,,,, y }到球形{ X ' ,,,, y ' }。

mp4 = struct();mp4.frame ='球形';MP4。原始位置=[0; 0; 0];同位位置%。mp4.originvelocity = [0;0;0];%相同的起源速度。%指定旋转。rotAngle4 = [45 0 0]; rotQuat4 = quaternion(rotAngle4,“欧拉”,,,,'zyx',,,,'框架');rotMatrix4 = rotmat(rotQuat4,'框架');MP4。Orientation = rotMatrix4; MP4.IsParentToChild = true;%在球形子框架中指定输出。mp4.haselevation = true;mp4.hasazimuth = true;mp4.hasrange = true;mp4.hasvelocity = true;

创建组合测量参数输入,MPC

MPC=[MP4 MP2];

创建对象电视目的。

time4 = 0; detection4 = objectDetection(time4,measurement4,“测量参数”,,,,MPC)
检测4 =带有属性的对象进行访问:时间:0测量:[4x1 double] smuesurementNoise:[4x4 double] sensorIndex:1 objectClassId:0 MeasurementParameters:[1x2 struct] objectAttributes:{}

使用使用cvmeas。结果同意measurement4

state4 = [10; 5; 20; 0; 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检测

Consider an unmanned aerial vehicle (UAV) monitoring a region. At t = 0秒,相对于全球向北(NED)框架,无人机处于(5,5,-1)km的位置。无人机的速度为(-50,-100,5)m/s。无人机车身框架的方向{ X ,,,, y ,,,, z } with respect to the global NED frame is given as (-120,2,2) degrees in yaw, pitch, and roll. At the same time, a car at the position of (1,1,0) km is moving east with a speed of 30 m/s. The UAV measures the car using a radar system aligned with its own body axis.

Based on this information, specify the kinematic parameters for the measurement transformation.

Specify the frame type, origin position, and origin velocity of the UAV body frame.

MP5 = struct(); MP5.Frame ='球形';里。原始位置= [5000; 5000; -1000]; MP5.OriginVelocity = [-50; -100; 5];

Specify the rotation from the NED frame to the UAV body frame.

rot_angle5 = [-120 2 2];%[偏航,俯仰,滚动]rot_quat5 = quaternion(rot_angle5,“欧拉”,,,,'zyx',,,,'框架');Rot_matrix5 = rotmat(Rot_quat5,'框架');里。取向= Rot_matrix5;里。IsParentToChild = true;

Specify the output measurements in a spherical frame.

mp5.haselevation = true;mp5.hasazimuth = true;mp5.hasrange = true;mp5.hasvelocity = true;

you can obtain the measurement directly from the radar system on the UAV. Use thecvmeasfunction is to obtain the measurement. The measurement is in the order of [azimuth;elevation;range;range-rate].

CAR_STATE5 = [1000; 0; 1000; 30; 0; 0];%[x; vx; y; vy; z; vz]。Measurement5 = CVMEAS(CAR_STATE5,MP5);MEAS_AZ5 = MEAKUREMENT5(1)
meas_az5 = -14.6825
MEATE_EL5 = MEAKUREMENT5(2)
MEAS_EL5 = 12.4704
MES_RNG5 = MEATEREMENT5(3)
meas_rng5 = 5.7446e+03
MES_RR5 = MEATUREMENT5(4)
meas_rr5 = -126.2063

高程角定义为从XY平面到Z方向的角度。这就是为什么高程角对于地面相对于无人机的目标是阳性的原因。该约定在整个工具箱中使用。

方位角,高程,范围和范围率的测量噪声分别为[1,1,20,2]。同样,雷达的索引为2,雷达可以将检测到的对象分类为1的类型'车'

index5 = 2;协方差= diag([1; 1; 1; 20; 2]);classID5 = 1;

Create an对象电视检测对象。

time5 = 0;检测= objectDetection(time5,measurement5,“ SensorIndex”,index5,。。。'MeasurementNoise',协方差5,'ObjectClassID',classid5,“测量参数”,MP5)
检测=带有属性的对象进行:时间:0测量:[4x1 double] suberementNoise:[4x4 double] sensorIndex:2 objectClassId:1 MeasurementParameters:[1x1 struct] objectAttributes:{}