主要内容

Simulate Simple Driving Scenario and Sensor in Unreal Engine Environment

自动化驾驶工具箱™提供用于可视化传感器的块,以便在使用EpicGames®中使用Unreal引擎®的仿真环境中的传感器。该模型在预构建场景中模拟了一个简单的驾驶场景,并使用Fisheye摄像头传感器捕获来自场景的数据。使用此模型来了解配置和模拟场景,车辆和传感器的基础知识。有关虚幻引擎仿真环境的更多背景,请参阅自动驾驶的虚幻发动机仿真.

模型概述

这model consists of these main components:

Inspect Scene

在模拟3D场景配置块中,Scene name参数确定发生模拟的场景。此模型使用Large Parking Lot场景,但你可以在几个预设的场景中选择。要探索场景,您可以打开与3D场景对应的2D图像。

data = load('sim3d_SpatialReferences.mat');spatialref = data.spatialReference.largeparkinglot;数字;imshow('sim3d_largeparkinglot.jpg',spatialRef) set(gca,'YDir',“正常”)

要了解如何探索其他场景,请参阅相应的场景参考页面。

Scene view此块的参数确定虚幻引擎窗口显示场景的视图。在这个街区,Scene view设定为Egovehicle., which is the name of the ego vehicle (the vehicle with the sensor) in this scenario. During simulation, the Unreal Engine window displays the scene from behind the ego vehicle. You can also change the scene view to the other vehicle. To display the scene from the root of the scene (the scene origin), selectroot.

天气tab of the block controls the sun position and scene weather. This scene is configured to take place at noon and is cloudy with light rain.

检查车辆

这Simulation 3D Vehicle with Ground Following blocks model the vehicles in the scenario.

  • EGO车辆块车辆包含Fisheye相机传感器。该车辆被建模为红色掀背车。

  • 目标车辆块是传感器捕获数据的车辆。该车辆被建模为绿色SUV。

在仿真过程中,两辆车都在停车场直行50米。目标车辆直接在自助式车辆前面10米。

X,Y, 和Yaw输入端口控制这些车辆的轨迹。XY在世界坐标的场景中,这是米的。Yawis the orientation angle of the vehicle and is in degrees.

EGO车辆从(45,0)至(45,50)的位置,从起源逆时针定向90度。要模拟此位置,输入端口值如下:

  • X是一个恒定的价值45.

  • Y是模拟时间的倍数。数字时钟块每0.1秒输出仿真时间5秒,这是模拟的停止时间。然后将这些模拟时间乘以10以产生Y价值观[0 1 2 3 ... 50]或1米,总共50米。

  • Yaw是一个恒定的价值90.

这target vehicle has the sameXYawvalues as the ego vehicle. TheY目标车辆的价值总是超过10米Yvalue of the ego vehicle.

在这两种工具,Initial position [X, Y, Z] (m)最初的旋转(Roll, Pitch, Yaw] (deg)parameters reflect the initial[X, Y, Z][偏航,俯仰,卷]价值观the vehicles at the beginning of simulation.

要创建更现实的轨迹,您可以交互地从场景中获取航路点,并将这些航点指定为具有地面块的模拟3D车辆的输入。看选择虚幻引擎模拟的航点.

两辆车也有可选的光控input port enabled. This port enables you to specify a logical vector specifying whether the headlights, brake lights, reverse lights, or turn signal lights are on. Both vehicles have a1in the second position of the vector, which turns on their low beam headlights. For more details on enabling and controlling vehicle lights, see theSimulation 3D Vehicle with Ground Followingblock reference page.

Inspect Sensor

这Simulation 3D Fisheye Camera block models the sensor used in the scenario. Open this block and inspect its parameters.

  • Mounting选项卡包含确定传感器安装位置的参数。Fisheye相机传感器安装在自助式车辆顶部的中心。

  • Parameterstab contains the intrinsic camera parameters of a fisheye camera. These parameters are set to their default values, with the exception of theMapping coefficientsparameter. In this parameter, the second coefficient is decreased from0to-0.0005.to model lens distortion.

  • 地面真理选项卡包含用于输出传感器的位置和方向以仪表和弧度的参数。在此模型中,块输出这些值,以便您可以在模拟期间看到它们的改变。

这block outputs images captured from the simulation. During simulation, the Video Viewer block displays these images.

Simulate Model

模拟模型。仿真开始时,可​​视化引擎可能需要几秒钟才能初始化,特别是当您第一次运行时。这AutoVrtlEnvwindow shows a view of the scene in the 3D environment.

视频查看器块显示了Fisheye相机的输出。

To change the view of the scene during simulation, use the numbers 1–9 on the numeric keypad.

For a bird's-eye view of the scene, press 0.

After simulating the model, try modifying the intrinsic camera parameters and observe the effects on simulation. You can also change the type of sensor block. For example, try substituting the 3D Simulation Fisheye Camera with a 3D Simulation Camera block. For more details on the available sensor blocks, seeChoose a Sensor for Unreal Engine Simulation.

看Also

||||||

相关话题