今天看啥  ›  专栏  ›  Ashy咸鱼干

毫米波雷达使用仿真学习实例

Ashy咸鱼干  · CSDN  ·  · 2021-03-04 20:19

毫米波雷达使用仿真学习

示例场景

一辆移动的主车和道路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
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33

注:
(1)仅用于自学使用
(2)参考书目《智能网联汽车自动驾驶仿真技术》–作者:崔胜民
(3)运行环境matlab2019a版本




原文地址:访问原文地址
快照地址: 访问文章快照