このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
センサー カバレッジ、検出、および追跡の可視化
鳥瞰図プロットを構成および使用して、自車の周囲のセンサー カバレッジ、検出、および追跡の結果を表示します。
概要
自車の周囲の 2 次元マップの車両座標に記録されたデータを表示することは、センサー カバレッジ、検出、および追跡の結果を解析する際の重要な部分です。
を使用して、一定期間におけるこの情報のスナップショットを表示したり、データをストリームして表示を効率的に更新したりします。birdsEyePlot
この例では、事前に記録されたセンサー データおよび追跡結果を読み取ります。これには次が含まれます。
車線の情報
ビジョン オブジェクト
レーダー オブジェクト
位置、速度、共分散行列、および追跡のラベル
最も重要なオブジェクト
上記の情報は、1 秒あたりの更新数 10 で記録されたビジョン検出を除き、1 秒あたりの更新数 20 の高レートで記録されています。
センサーの構成ファイルでは、ビジョン センサーとレーダー センサーの位置とカバレッジ領域が 2 つのカバレッジ モードで定義されます。これらのカバレッジ領域が鳥瞰図プロットに表示されます。
birdsEyePlot
オブジェクトは、非常に特殊な車両座標系を設定することに注意してください。この車両座標系で、X 軸は車両の前方向を指し、Y 軸は車両の左方向を指し、Z 軸は地面から上方向を指します。座標系の原点は通常、後車軸の中心として定義され、センサーの位置は原点を基準として定義されます。詳細については、Automated Driving Toolbox の座標系を参照してください。
シーンの範囲およびセンサー カバレッジの定義
鳥瞰図プロットを構成するには、2 つの手順に従います。最初の手順で鳥瞰図プロットが作成され、前述の座標系が設定されます。ここで、x 軸は上向きになり、y 軸は左向きになります。各方向の座標軸の範囲を定義できます。この前向きの例では、シーンを自車の前方 90 メートル、両側 35 メートルまでに定義します。
% Create a bird's-eye plot and limit its axes BEP = birdsEyePlot('Xlimits', [0 90], 'Ylimits', [-35 35]);
2 番目の手順で、鳥瞰図のプロッターが作成されます。鳥瞰図プロットは、それぞれが特定のデータ型をプロットするために構成された、以下のさまざまなプロッターを提供します。以下が含まれます。
coverageAreaPlotter - センサーのカバレッジ領域をプロット
detectionPlotter - オブジェクト検出をプロット
trackPlotter - 追跡、不確実性の追跡、および移動残像をプロット
laneBoundaryPlotter - 車線境界線をプロット
pathPlotter - オブジェクトの軌跡をプロット
% Create a coverageAreaPlotter for a vision sensor and two radar modes cap(1) = coverageAreaPlotter(BEP,'FaceColor','blue','EdgeColor','blue'); cap(2) = coverageAreaPlotter(BEP,'FaceColor','red','EdgeColor','red'); cap(3) = coverageAreaPlotter(BEP,'FaceColor','red','EdgeColor','red');
センサー構成データを読み込みます。センサー構成には、以下が含まれます。
座標軸の原点 (X,Y) を基準としたセンサーの位置 (メートル単位)
センサーの範囲 (メートル単位)
x 軸を基準としたセンサーのヨー角 (度単位)
センサーの視野 (FOV) (度単位)
load('SensorConfigurationData.mat'); % Use the sensor configuration to plot the sensor coverage areas. Vision % sensor uses the shaded blue coverage area and radar modes are shaded in % red. for i = 1:3 plotCoverageArea(cap(i), [sensorParams(i).X, sensorParams(i).Y],... sensorParams(i).Range, sensorParams(i).YawAngle, sensorParams(i).FoV); end % Add title title('Bird''s-Eye Plot')
上記の表示は、ビジョン センサーおよび 2 つのレーダー センサー モードのカバレッジを示しています。
ビジョン センサーは車の中心にある原点 (後車軸) の前方 3.30 メートルに配置され、範囲は 150 メートル、FOV は 38 度です。
レーダーは車の中心にある原点の前方 3.38 メートルに配置されています。レーダーの長距離モードは範囲が 174 メートル、FOV が 20 度ですが、中距離モードは範囲が 60 メートル、FOV が 90 度です。カバレッジ領域は、自車の前方 90 メートルおよび両側 35 メートルで打ち切られることに注意してください。
この例では、前方のシナリオを示します。ただし、自車の周囲 のカバレッジ領域を定義できます。たとえば、車両の後面から逆方向にカバーするセンサーは、ヨー角 で方向付けられます。
次の数行は、次の手順の準備として、記録されたデータを読み取ります。
% Load recorded data from a file load('BirdsEyePlotExampleData.mat', 'dataToDisplay'); % Skip to the 125th time step, where there are 5 vision detections and % multiple radar objects and tracks. timeStep = 125; % Extract the various data from the recorded file for that time step [visionObjectsPos, radarObjectsPos, laneBoundaries, trackPositions, ... trackVelocities, trackCovariances, trackLabels, MIOlabel, MIOposition, ... MIOvelocity] = readDataFrame(dataToDisplay(timeStep));
検出のプロット
次に、プロッターを作成して、記録されたビジョンおよびレーダーの検出を表示します。
% create a vision detection plotter put it in a struct for future use bepPlotters.Vision = detectionPlotter(BEP, 'DisplayName','vision detection', ... 'MarkerEdgeColor','blue', 'Marker','^'); % Combine all radar detections into one entry and store it for later update bepPlotters.Radar = detectionPlotter(BEP, 'DisplayName','radar detection', ... 'MarkerEdgeColor','red'); % Call the vision detections plotter plotDetection(bepPlotters.Vision, visionObjectsPos); % Repeat the above for radar detections plotDetection(bepPlotters.Radar, radarObjectsPos);
追跡および最も重要なオブジェクトのプロット
鳥瞰図プロットに追跡を追加するときに、位置、速度、および位置の共分散の各情報を指定します。プロッターは追跡の移動軌跡を処理しますが、これは単一のフレームであるため、移動残像はありません。
% Create a track plotter that shows the last 10 track updates bepPlotters.Track = trackPlotter(BEP, 'DisplayName','tracked object', ... 'HistoryDepth',10); % Create a track plotter to plot the most important object bepPlotters.MIO = trackPlotter(BEP, 'DisplayName','most important object', ... 'MarkerFaceColor','black'); % Call the track plotter to plot all the tracks plotTrack(bepPlotters.Track, trackPositions, trackVelocities, trackCovariances, trackLabels); % Repeat for the Most Important Object (MIO) plotTrack(bepPlotters.MIO, MIOposition, MIOvelocity, MIOlabel);
車線境界線のプロット
車線境界線のプロットには、
オブジェクトを利用できます。これを使用するために、車両境界線が parabolicLaneBoundary オブジェクトとして保存されており、これを指定してプロッターを呼び出します。parabolicLaneBoundary
% Create a plotter for lane boundaries bepPlotters.LaneBoundary = laneBoundaryPlotter(BEP, ... 'DisplayName','lane boundaries', 'Color',[.9 .9 0]); % Call the lane boundaries plotter plotLaneBoundary(bepPlotters.LaneBoundary, laneBoundaries);
記録ファイルからのシナリオの表示
記録ファイルには、時間依存のセンサー検出、追跡情報、および車線境界線が含まれます。次のコードは、記録を再生して、上記で構成した鳥瞰図プロットに結果を表示する方法を示しています。
メモ: ビジョン検出は、1 つおきのフレームで提供されています。このような場合、新しいセンサー検出がないことを示すと役立ちます。これを行うにはただ、空の配列を適切なプロッターに渡し、前の検出を表示から削除します。
% Rewind to the beginning of the recording file timeStep = 0; numSteps = numel(dataToDisplay); % Number of steps in the scenario % Loop through the scenario as long as the bird's eye plot is open while timeStep < numSteps && isvalid(BEP.Parent) % Promote the timeStep timeStep = timeStep + 1; % Capture the current time for a realistic display rate tic; % Read the data for that time step [visionObjectsPos, radarObjectsPos, laneBoundaries, trackPositions, ... trackVelocities, trackCovariances, trackLabels, MIOlabel, MIOposition, ... MIOvelocity] = readDataFrame(dataToDisplay(timeStep)); % Plot detections plotDetection(bepPlotters.Vision, visionObjectsPos); plotDetection(bepPlotters.Radar, radarObjectsPos); % Plot tracks and MIO plotTrack(bepPlotters.Track, trackPositions, trackVelocities, trackCovariances, trackLabels); plotTrack(bepPlotters.MIO, MIOposition, MIOvelocity, MIOlabel); % Plot lane boundaries plotLaneBoundary(bepPlotters.LaneBoundary, laneBoundaries); % The recorded data was obtained at a rate of 20 frames per second. % Pause for 50 milliseconds for a more realistic display rate. You % would not need this when you process data and form tracks in this % loop. pause(0.05 - toc) end
まとめ
この例では、鳥瞰図プロット オブジェクトおよびこのオブジェクトに関連付けられているさまざまなプロッターのいくつかを構成して使用する方法を説明しました。
追跡および最も重要なオブジェクトのプロッターや、さまざまな記録ファイルでの鳥瞰図プロットを使用してみてください。
サポート関数
readDataFrame - dataFrame で提供されるデータから個別のフィールドを抽出します。
function [visionObjectsPos, radarObjectsPos, laneBoundaries, trackPositions, ... trackVelocities, trackCovariances, trackLabels, MIOlabel, MIOposition, ... MIOvelocity] = readDataFrame(dataFrame) visionObjectsPos = dataFrame.visionObjectsPos; radarObjectsPos = dataFrame.radarObjectsPos; laneBoundaries = dataFrame.laneBoundaries; trackPositions = dataFrame.trackPositions; trackVelocities = dataFrame.trackVelocities; trackCovariances = dataFrame.trackCovariances; trackLabels = dataFrame.trackLabels; MIOlabel = dataFrame.MIOlabel; MIOposition = dataFrame.MIOposition; MIOvelocity = dataFrame.MIOvelocity; end