MATLAB自动驾驶工具箱的简单使用
自动驾驶工具箱的简单使用
文章目录1. 开环场景1.1 场景的建立与使用1.2 使用现有场景2. 闭环场景3.使用UNREAL 4引擎进行SCENARIO SIMULATION
文章目录
1. 开环场景
开环场景
1.1 场景的建立与使用
场景的建立与使用
drivingScenarioDesigner
输入命令,打开场景编辑器
随便加入一些道路和车辆
加入车辆行驶路径点,并加入一台camera
导出到SIMULINK,自动生成slx与mat文件
SCENARIO模块输出的车辆数据格式如下,可用Bus模块分解,也可作为结构体使用matlab function 解码
1.2 使用现有场景
使用现有场景
如图所示,matlab附带众多标准化的试验场景
2. 闭环场景
闭环场景
与开环场景类似,
SIMULINK中设置如下
数据打包如下
function egoActor = packEgo(pos,vel,yaw,yawRate)
% Pack ego information into a single ego actor bus
%
% Imoprtant note:
% Output is a bus of type BusActorsActors. This is the same bus used by the
% Scenario Reader to output an individual actor. If you change the
% output bus name of Scenario Reader, change the output bus name here
% as well by clicking on 'Edit Data' in the menu above.
egoActor = struct(...
'ActorID',2,...
'Position', [pos(1) pos(2) 0], ...
'Velocity', [vel(1) vel(2) 0], ...
'Roll', 0, ...
'Pitch', 0, ...
'Yaw', yaw, ...
'AngularVelocity', [0 0 yawRate]);
3.使用使用UNREAL 4引擎进行
引擎进行SCENARIO SIMULATION
参照MATLAB2019B中自带的例子
作者:你看不见我写的blog