Install Support Package for Customizing Scenes
To customize scenes in your installation of the Unreal® Editor and simulate within these scenes in Simulink®, you must first install the Automated Driving Toolbox Interface for Unreal Engine 4 Projects.
These installation instructions apply to R2023b. If you are using a previous release, see the documentation for Other Releases.
Verify Software and Hardware Requirements
Before installing the support package, make sure that your environment meets the minimum software and hardware requirements described in Unreal Engine Simulation Environment Requirements and Limitations.
Install Support Package
To install the Automated Driving Toolbox™ Interface for Unreal Engine® 4 Projects support package, follow these steps:
On the MATLAB® Home tab, in the Environment section, select Add-Ons > Get Add-Ons.
In the Add-On Explorer window, search for the Automated Driving Toolbox Interface for Unreal Engine 4 Projects support package. Click Install.
You must have write permission for the installation folder.
Set Up Scene Customization Using Support Package
The Automated Driving Toolbox Interface for Unreal Engine 4 Projects support package includes these components:
AutoVrtlEnvfolder — An Unreal Engine project folder containing the
AutoVrtlEnv.uprojectfile and corresponding supporting files. This project contains editable versions of the prebuilt scenes that you can select from the Scene name parameter of the Simulation 3D Scene Configuration block.
MathWorkSimulation— A plugin that establishes the connection between Simulink and the Unreal Editor. It is required for co-simulation.
MathWorksAutomotiveContent— A plugin that contains the elements of automotive objects that can be modified using Unreal Editor. It is required for co-simulation.
RoadRunnerMaterials— A plugin that contains the features of objects and base materials used in roadrunner scenes.
RoadRunnerProject folder — A folder containing prebuilt
scenes which you can directly edit using the RoadRunner scene editing software. This folder contains these
Scenes— A folder containing the scene files for all prebuilt scenes.
Assets— A folder containing assets used to build the prebuilt scenes.
RoadRunnerScenes folder — A folder containing the
Unreal Engine project and corresponding executable for a scene that was created
by using the RoadRunner scene editing software. This folder contains these
RRScene— An Unreal Engine project folder containing the
RRScene.uprojectfile and corresponding supporting files. This project contains an editable version of the scene used in the Highway Lane Following with RoadRunner Scene example.
WindowsPackage— A folder containing the executable
RRScene.exeand supporting files. Use this executable to co-simulate the Simulink models explained in the Highway Lane Following with RoadRunner Scene example.
To set up scene customization, you must copy the
AutoVrtlEnv project and
plugin folder onto your local machine. To customize the RoadRunner scene used in the Highway Lane Following with RoadRunner Scene example, you must
also copy the
RRScene project onto your local machine and download
RoadRunnerMaterials plugin and copy it into your local project.
After you install and set up the support package, you can begin customizing scenes. If you want to use a project developed using a prior release of the Automated Driving Toolbox Interface for Unreal Engine 4 Projects support package, you must migrate the project to make it compatible with the currently supported Unreal Editor version. See Migrate Projects Developed Using Prior Support Packages. Otherwise, see Customize Scenes Using Simulink and Unreal Editor.
AutoVrtlEnv Project to Local Folder, and,
MathWorksAutomotiveContent Plugins to Unreal Editor
To copy all the support package components to a folder on your local machine and
configure your environment so that you can customize scenes, use the
copyExampleSim3dProject function. For example, this code copies the
localFolder = "C:\project" sim3d.utils.copyExampleSim3dProject(localFolder);
RRScene Projects to Local Folder
To customize the scene in the
RRScene project folder, copy the
project onto your local machine. To edit the prebuilt scenes directly using
RoadRunner, copy the
RoadRunnerProject project onto your local
Specify the path to the support package folder that contains the projects. Also specify a local folder destination to copy the projects. This code uses the support package path and local folder path from previous section.
rrProjectSupportPackageFolder = fullfile( ... matlabshared.supportpkg.getSupportPackageRoot, ... "toolbox","shared","sim3dprojects","roadrunner", ... "RoadRunnerProject"); rrProjectLocalFolder = fullfile(localFolder,"roadrunner/RoadRunnerProject");
RoadRunnerProjectproject from the support package folder to the local destination folder.
if ~exist(rrProjectLocalFolder,"dir") copyfile(rrProjectSupportPackageFolder,rrProjectLocalFolder); end
All the prebuilt scenes and the assets are now located in the specified local folder.
Repeat Step 1 and 2 to copy the
RRSceneproject to the local destination folder.
rrSceneSupportPackageFolder = fullfile( ... matlabshared.supportpkg.getSupportPackageRoot, ... "toolbox","shared","sim3dprojects","driving", ... "RoadRunnerScenes","RRScene"); rrSceneLocalFolder = fullfile(localFolder,"RRScene"); if ~exist(rrSceneLocalFolder,"dir") copyfile(rrSceneSupportPackageFolder,rrProjectLocalFolder); end
RRScene.uprojectfile and all of its supporting files are now located in a folder named
RRScenewithin the specified local folder.