毫米波雷達使用仿真學習
示例場景
一輛移動的主車和道路150m處靜止的車,主車初始速度50km/h,檢測到靜止車后制動減速度為3m每平方秒,在距離靜止車前1m停止
m檔案matlab代碼如下
clear;clc;
%% 創建駕駛場景
addpath(fullfile(matlabroot,'toolbox','shared','tracking','fusionlib'));
rng default;
initialDist=150;
initialSpeed=50;
brakeAccel=3;
finalDist=1;
[scenario,egoCar]=helperCreateSensorDemoScenario('FCW',initialDist,initialSpeed,brakeAccel,finalDist);
%% 構建雷達
radarSensor=radarDetectionGenerator(...
'SensorIndex',1,...
'UpdateInterval',0.1,...
'SensorLocation',[egoCar.Wheelbase+egoCar.FrontOverhang 0],...
'Height',0.2,...
'FieldOfView',[20 5],...
'MaxRange',150,...
'AzimuthResolution',4,...
'RangeResolution',2.5,...
'ActorProfiles',actorProfiles(scenario));
%% 構建顯示FCW駕駛場景
[bep,figScene]=helperCreateSensorDemoDisplay(scenario,egoCar,radarSensor);
metrics=struct;
while advance(scenario) %此結構可以使場景仿真
gTruth=targetPoses(egoCar);
time=scenario.SimulationTime;
[dets,~,isValidTime]=radarSensor(gTruth,time);
if isValidTime
helperUpdateSensorDemoDisplay(bep,egoCar,radarSensor,dets);
metrics=helperCollectScenarioMetrics(metrics,gTruth,dets);
end
helperPublishSnapshot(figScene,time>=9.1);
end
注:
(1)僅用于自學使用
(2)參考書目《智能網聯汽車自動駕駛仿真技術》–作者:崔勝民
(3)運行環境matlab2019a版本
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/266729.html
標籤:其他
