主要内容

trackingScenario

Create tracking scenario

Description

trackingScenario创建一个跟踪方案对象。跟踪方案模拟包含多个平台的3D竞技场。平台代表您要模拟的任何东西,例如飞机,地面车辆或船舶。一些平台带有传感器,例如雷达,声纳或红外线。其他平台充当信号的来源或反映信号。平台还可以包括可能影响其他平台运动的固定障碍。可以通过指定平台作为点或立方体建模'Dimension'property when calling平台。Platforms can have aspect-dependent properties including radar cross-section or sonar target strength. You can populate a tracking scenario by calling the平台method for each platform you want to add. Platforms arePlatformobjects. You can create trajectories for any platform using theKinematicTrajectory,waypointTrajectory, orgeoTrajectorySystem objects. After creating the scenario, run the simulation by calling theadvanceobject function.

Creation

sc = trackingScenariocreates an empty tracking scenario with default property values. In this case, you can specify platform trajectories in the scenario as Cartesian states using theKinematicTrajectoryorwaypointTrajectoryobjects.

sc = trackingScenario('IsEarthCentered',true)creates an empty Earth-centered tracking scenario with default property values. In this case, you can specify platform trajectories in the scenario as geodetic states using thegeoTrajectoryobject.

sc= trackingScenario(Name,Value)configures atrackingScenarioobject with properties using one or moreName,Value配对参数。Name是属性名称,Valueis the corresponding value.Namemust appear inside single quotes (''). You can specify several name-value pair arguments in any order asNAME1,Value1,...,Namen,Valuen。任何未指定的属性都采用默认值。

Properties

expand all

启用以接地为中心的参考框架和轨迹,指定为trueorfalse

  • If specified asfalse, you must use theKinematicTrajectoryorwaypointTrajectoryobject to define the trajectories of platforms as Cartesian states in the tracking scenario.

  • If specified astrue, you must use thegeoTrajectoryobject to define the trajectories of platforms as geodetic coordinates in the tracking scenario. In this case, you must specify theIsEarthCenteredproperty during the tracking scenario creation.

Data Types:logical

模拟的停止时间,指定为正标量。当满足这些条件中的任何一个时,模拟都会停止:

  • The stop time is reached.

  • Any platform reaches the end of its trajectory and you have specified the platformMotionproperty using waypoints,waypointTrajectory

Units are in seconds.

例子:60.0

Data Types:double

此属性仅阅读。

Current time of the simulation, defined as a positive scalar. To reset the simulation time to zero and restart the simulation, call the重新开始method. Units are in seconds.

Data Types:double

Frequency of simulation updates, specified as a nonnegative scalar in hertz.

  • When specified as a positive scalar, the scenario advances with the time step of 1/F, whereFis the value of theUpdateRateproperty.

  • When specified as zero, the simulation advances based on the necessity of updating sensors or emitters mounted on platforms of the scenario. Create a platform using the平台function.

例子:2.0

Data Types:double

Initial advance when calling theadvanceobject function, specified as'Zero'or'UpdateInterval'。When specified as

  • 'Zero'— The scenario simulation starts at time0in the first call of theadvancefunction.

  • 'UpdateInterval'— The scenario simulation starts at time 1/F, whereFis the value of a non-zeroUpdateRateproperty. If theUpdateRateproperty is specified as0, the scenario neglects theInitialAdvanceproperty and starts at time0

Data Types:enumeration

此属性仅阅读。

模拟状态, specified as

  • NotStarted— When theadvanceobject function has not been used on the tracking scenario.

  • InProgress— When theadvanceobject function has been used on the tracking scenario at least once and the scenario has not reached theCompletedstatus.

  • Completed— When the scenario reaches the stop time specified by theStopTime财产或任何Platformin the scenario reaches the end of its trajectory.

You can restart a scenario simulation by using the重新开始object function.

Data Types:enumeration

此属性仅阅读。

Platforms in the scenario, returned as a cell or cell array ofPlatformobjects. To add a platform to the scenario, use the平台object function.

Manager of ground surfaces in the tracking scenario, specified as aSurfaceManagerobject.

  • To control whether the tracking scenario models occlusion due to scenario surfaces, specify theUseOclussion属性SurfaceManager对象为true(default) orfalse。Note that when theUseOcclusionproperty is specified astrueand when theIsEarthCentered属性tracking scenario is also specified astrue, the tracking scenario also models horizon occlusion based on the WGS84 Earth model.

  • To query the height of surfaces at a location in the scenario, use theheightobject function of theSurfaceManagerobject.

  • To determine if the surfaces in the scenario occlude the line-of-sight between two points, use theocclusionobject function of theSurfaceManagerobject.

Object Functions

平台 Add platform to tracking scenario
地面 Add surface to tracking scenario
advance Advance tracking scenario simulation by one time step
重新开始 Restart tracking scenario simulation
record Run tracking scenario and record platform, sensor, and emitter information
发射 Collect emissions from emitters in tracking scenario
传播 Propagate emissions in tracking scenario
detect 从跟踪方案中收集所有传感器的检测
lidarDetect Report point cloud detections from all lidar sensor intrackingScenario
平台Poses 位置、速度和方向的解放军tforms in tracking scenario
PlatformProfiles 在跟踪方案中的平台配置文件
coverageConfig Sensor and emitter coverage configuration
clone Create copy of tracking scenario
perturb Apply perturbations to tracking scenario

Examples

collapse all

Construct a tracking scenario with two platforms that follow different trajectories.

sc = trackingScenario('UpdateRate',100.0,'StopTime',1.2);

Create two platforms.

platfm1 = platform(sc);platfm2 = platform(sc);

Platform 1 follows a circular path of radius 10 m for one second. This is accomplished by placing waypoints in a circular shape, ensuring that the first and last waypoint are the same.

wpts1 = [0 10 0; 10 0 0; 0 -10 0; -10 0 0; 0 10 0]; time1 = [0; 0.25; .5; .75; 1.0]; platfm1.Trajectory = waypointTrajectory(wpts1, time1);

平台2遵循一秒钟的直路。

wpts2 = [-8 -8 0;10 10 0];time2 = [0;1.0];platfm2.trajectory = waypointTrajectory(wpts2,time2);

Verify the number of platforms in the scenario.

disp(sc.Platforms)
{1×1 Fusion.scenario.platform} {1×1 Fusion.scenario.platform}

Run the simulation and plot the current position of each platform. Use an animated line to plot the position of each platform.

图网轴equalaxis([-12 12 -12 12]) line1 = animatedline('DisplayName','Trajectory 1','颜色','b','Marker','.');line2 = animatedline('DisplayName',“轨迹2”,'颜色','r','Marker','.');标题('Trajectories')p1 =姿势(platfm1);p2 =姿势(platfm2);ADDPOINTS(LINE1,P1。位置(1),P1.Position(2));加上点(line2,p2。p.position(2),p2. p2.position(2));whileadvance(sc) p1 = pose(platfm1); p2 = pose(platfm2); addpoints(line1,p1.Position(1),p1.Position(2)); addpoints(line2,p2.Position(2),p2.Position(2)); pause(0.1)end

Plot the waypoints for both platforms.

holdonplot(wpts1(:,1),wpts1(:,2),' ob') text(wpts1(:,1),wpts1(:,2),“t =”+ string(time1),'HorizontalAlignment','left','垂直对齐','bottom') plot(wpts2(:,1),wpts2(:,2),' or') text(wpts2(:,1),wpts2(:,2),“t =”+ string(time2),'HorizontalAlignment','left','垂直对齐','bottom') holdoff

创建具有指定更新速率的跟踪方案。

场景= TrackingsCenario('IsEarthCentered',true,'UpdateRate',0.01);

Add an airplane in the scenario. The trajectory of the airplane changes in latitude and altitude.

plane = platform(scene,'弹道',geoTrajectory([-12.338,-71.349,10600;42.390,-71.349,0],[0 36000]));

Advance the tracking scenario and record the geodetic and Cartesian positions of the plane target.

位置= [];whileadvance(scene) poseLLA = pose(plane,'CoordinateSystem','Geodetic');poseCart = pose(plane,'CoordinateSystem','Cartesian');positions = [positions;poseCart.Position];%#ok Allow the buffer to grow.end

Visualize the trajectory in the ECEF frame.

fig()km = 1000;% Plot the trajectory.plot3(positions(1,1)/km,positions(1,2)/km,positions(1,3)/km,'B*');holdon;plot3(位置(末端,1)/km,位置(末端,2)/km,位置(末端,3)/km,,'bo');plot3(positions(:,1)/km,positions(:,2)/km,positions(:,3)/km,'b');% Plot the Earth radial lines.plot3([0 positions(1,1)]/km,[0 positions(1,2)]/km,[0 positions(1,3)]/km,'k:');plot3([0 positions(end,1)]/km,[0 positions(end,2)]/km,[0 positions(end,3)]/km,'k:');xlabel('x (km)');ylabel('y (km)');zlabel('z (km)');传奇('Start position','End position','弹道')

Figure contains an axes object. The axes object contains 5 objects of type line. These objects represent Start position, End position, Trajectory.

Version History

Introduced in R2018b

expand all

Not recommended starting in R2021a