MATLAB自动驾驶工具箱的简单使用

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中自带的例子
在这里插入图片描述
在这里插入图片描述

发布了8 篇原创文章 · 获赞 4 · 访问量 999

猜你喜欢

转载自blog.csdn.net/rmrgjxeivt/article/details/105004328