メインコンテンツ

theaterPlot を使用したレーダー シナリオの可視化

この例では、theaterPlot オブジェクトを使用してレーダー シナリオのさまざまな側面を可視化する方法を示します。

はじめに

theaterPlotは、レーダー シナリオのさまざまな側面を可視化するための効率的なツールです。これは、親座標軸に基づいたプロット環境をホストする主要オブジェクトと、レーダー シナリオの特徴における特定の側面をプロットするためのプロッターで構成されています。

次の図は、theaterPlot オブジェクトの構造的な表現を示しています。

Parent プロパティは、シアター プロットが有効になる座標軸を指定します。オブジェクトの作成時に、シアター プロットの親座標軸を指定できます。親座標軸を指定しない場合、theaterPlot は新しい Figure を作成し、作成された Figure の現在の軸をその Parent プロパティとして使用します。オブジェクト作成時に名前と値の引数を使用することで、XLimitsYLimits、および Zlimits の各プロパティを使用して親座標軸の範囲を設定することもできます。AxesUnits プロパティを使用して、各軸の測定単位を設定します。

Plotters プロパティには、theaterPlot オブジェクトに追加したプロッターが保持されます。

  • platformPlotter — レーダー シナリオ内のプラットフォームをプロット

  • trajectoryPlotter — レーダー シナリオ内の軌跡をプロット

  • orientationPlotter — レーダー シナリオ内のプラットフォームの向きをプロット

  • coveragePlotter — レーダー シナリオ内のセンサー カバレッジとセンサー ビームをプロット

  • detectionPlotter — レーダー シナリオ内のセンサー検出結果をプロット

  • trackPlotter — レーダー シナリオ内のトラックをプロット

  • surfacePlotter — レーダー シナリオ内の表面をプロット

プロッターの作成時に、各プロッターの視覚要素や効果を指定することができます。各プロッターは theaterPlot のオブジェクト関数とペアになっており、結果をプロットするにはこの関数を呼び出す必要があります。たとえば、coveragePlotter は、センサー カバレッジを表示するplotCoverageオブジェクト関数とペアになっています。

この例では、レーダー シナリオを可視化するためのいくつかのプロッターを紹介します。theaterPlot は、radarScenario オブジェクトと効率的に連携できますが、theaterPlot オブジェクトを使用するために必ずしも radarScenario オブジェクトが必要なわけではありません。

theaterPlot オブジェクトと radarScenario オブジェクトの作成

radarScenario オブジェクトと theaterPlot オブジェクトを作成します。

simulationDuration = 100;
scene = radarScenario('StopTime',simulationDuration);
tp = theaterPlot('XLimits',[-250 250],'YLimits',[-250 250],'ZLimits',[0 120]);
view(3);grid on;

ターゲット用の軌跡プロッターとプラットフォーム プロッターの作成

ターゲット プラットフォームのウェイポイント軌跡を作成します。

timeOfArrival = [0  simulationDuration];
waypoints = [100 -100 10; 100 100 80];
trajectory = waypointTrajectory(waypoints,timeOfArrival);

指定された軌跡に沿って移動する直方体のターゲット プラットフォームを追加します。まず、レーダー シナリオにターゲット プラットフォームを追加します。

target = platform(scene,'Trajectory',trajectory,'Dimensions', ...
    struct('Length',35,'Width',15,'Height',5.5,'OriginOffset',[0 0 0]));

次に、trajectoryPlotter オブジェクトを theaterPlot オブジェクトに追加し、plotTrajectory 関数を使用してウェイポイント軌跡をプロットします。

trajPlotter = trajectoryPlotter(tp,'DisplayName','Trajectory','Color','k','LineWidth',1.2);
plotTrajectory(trajPlotter,{trajectory.Waypoints})

ヒント: 1 つのプロッターを使用して、同じタイプの複数の特徴 (プラットフォーム、軌跡、向き、カバレッジ、検出、またはトラック) をまとめてプロットできます。たとえば、plotTrajectory 関数の 2 番目の引数としてウェイポイントの cell 配列を指定することで、複数の軌跡をまとめてプロットできます。詳細については、plotTrajectoryの構文の説明を参照してください。

ターゲット プラットフォーム用のプロッターを定義します。

targetPlotter = platformPlotter(tp,'DisplayName','Target', ...
    'Marker','s','MarkerEdgeColor','g','MarkerSize',2);
plotPlatform(targetPlotter,target.Position, ...
    target.Dimensions,quaternion(target.Orientation,'rotvecd'))

theaterPlot オブジェクトの親座標軸に直接プロットすることで、プロッター オブジェクト以外のグラフィック オブジェクトを theaterPlot に追加できます。原点に円マーカーを配置します。

hold on
plot3(tp.Parent,0,0,0,'Color','k','Marker','o','MarkerSize',4)

レーダー センサーが取り付けられたプラットフォームの作成

シナリオにタワー プラットフォームを追加します。

tower = platform(scene,'Position',[-100,0,0],'Dimensions', ...
    struct('Length',5,'Width',5,'Height',30,'OriginOffset',[0 0 -15]));

プラットフォーム プロッターを使用してタワーを表示します。

towerPlotter = platformPlotter(tp,'DisplayName','Tower','Marker','s','MarkerSize',2);
plotPlatform(towerPlotter,tower.Position,tower.Dimensions,quaternion(tower.Orientation,'rotvecd'))

タワーの頂上にモノスタティック レーダーを取り付けます。

radar = radarDataGenerator(1,'DetectionMode','Monostatic', ...
    'UpdateRate',5, ...
    'MountingLocation',[0, 0, 30], ...
    'FieldOfView',[4, 30],...
    'MechanicalAzimuthLimits',[-60 60], ...
    'MechanicalElevationLimits',[0 0], ...
    'HasElevation',true, ...
    'RangeResolution',200, ...
    'AzimuthResolution',20, ...
    'ElevationResolution',20);
tower.Sensors = radar;

coveragePlotter を追加し、モノスタティック レーダーのカバレッジと初期ビームをプロットします。カバレッジをプロットする際、plotCoverage オブジェクト関数は、センサー カバレッジの構成を指定する 2 番目の引数を必要とします。レーダー シナリオ scene に対して coverageConfig 関数を使用し、構成を取得します。

radarPlotter = coveragePlotter(tp,'Color','b','DisplayName','radar beam');
plotCoverage(radarPlotter,coverageConfig(scene))

レーダーが生成する検出結果をプロットするための検出プロッターを作成します。

detPlotter = detectionPlotter(tp,'DisplayName','Detection','MarkerFaceColor','r','MarkerSize',4);

シナリオの実行と theaterPlot の更新

レーダー シナリオを反復し、レーダー検出結果を生成します。プラットフォーム、レーダー カバレッジ、および検出結果をプロットします。

rng(2019) % for repeatable results
while advance(scene)
    % Plot target.
    plotPlatform(targetPlotter,target.Position, ...
        target.Dimensions,quaternion(target.Orientation,'rotvecd'))

    % Plot sensor coverage.
    plotCoverage(radarPlotter,coverageConfig(scene))

    % Extract target pose from the view of the tower and use the extracted
    % pose to generate detections.
    poseInTower = targetPoses(tower);
    [detections, numDets] = radar(poseInTower,scene.SimulationTime);
    detPos = zeros(numDets,3);
    detNoise = zeros(3,3,numDets);

    % Obtain detection pose relative to the scenario frame. Also, obtain
    % the covariance of the detection.
    for i=1:numDets
        a = detections;
        detPos(i,:) = tower.Trajectory.Position + detections{i}.Measurement';
        detNoise(:,:,i) = detections{i}.MeasurementNoise;
    end

    % Plot any generated detections with the covariance ellipses.
    if ~isempty(detPos)
        plotDetection(detPlotter,detPos,detNoise)
    end
end

Figure contains an axes object. The axes object with xlabel X (m), ylabel Y (m) contains 6 objects of type line, patch. One or more of the lines displays its values using only markers These objects represent Trajectory, Target, Tower, radar beam, Detection.

Figure 内の検出箇所をズームインすることで、生成された検出結果に対してプロットされた共分散楕円を視覚的に確認できます。

まとめ

この例では、theaterPlot オブジェクトの編成について学習しました。また、theaterPlot オブジェクトを使用して、シンプルなレーダー シナリオを可視化する方法についても学習しました。