File Exchange

image thumbnail

Vehicle Dynamics Blockset Interface for Unreal Engine 4 Projects

Simulink integration for Unreal Engine 4

100 Downloads

Updated 15 Nov 2019

The Vehicle Dynamics Blockset includes several built-in scenes in which you can drive a virtual vehicle. This support package provides the following additional content:
• AutoVrtlEnv.exe: A compiled Unreal Engine game that includes additional scenes such as a double lane change with cone markers and the ability to have two cars in the same scene (e.g., for overlaying results)
• AutoVrtlEnv.uproject: A project file that you can open with the Unreal Engine Editors to customize the pre-built 3D scenes
• MathWorks Simulation Plugin: A plugin necessary to connect an Unreal Engine compiled scene with Simulink
Additional information on how to use these features is included within the support package files.
• Setup Document: Please type the MATLAB command open('AVE_README.pdf') for setup instructions.

Comments and Ratings (57)

calia qi

Hi
When I created a new C ++ UE4 file and selected the matlab plug-in enable, the following problems occurred. There is less information in this regard, thank you.(plugin MathWorksSimulation failed to load because module mathworkssimulation could not be loaded.There may be an operation system error or the moudles may not be properly set up)

Mike Sasena

Hi again, Calia. I would recommend you contact our Technical Support team (https://www.mathworks.com/support.html). They can get more information about what you're trying to accomplish and help you find a solution.

calia qi

Hi
I encountered a problem, I know that AutoVrtlEnv.uproject has an interface vehicle with simulink. I have a uproject file myself, how could I find the simvehicle module in my own uproject file. In other words, how to build the unreal model into the simvehicle.

Mike Sasena

Hi Calia,

Please check out these instructions:
https://www.mathworks.com/help/vdynblks/ug/support-package-for-customizing-scenes.html

It walks you through the process of installing this support package and copying the necessary files (including the AutoVrtlEnv.uproject file) into the folders you'll need to begin testing.

calia qi

Hi,Where is the AutoVrtlEnv.uproject ? I can only find the AutoVrtlEnv.exe in matlab folder. Thanks

Sam Reinsel

Hi Ben, James,

Currently the only supported version of Unreal is 4.19, so you would not be able to use the plugin in UE4.23.

I've actually encountered this "Failed to compile" on a PC that only had Visual Studio 2015 installed. In my case, The build log for the project (located at "C:\Local\AutoVrtlEnv\Saved\Logs\AutoVrtlEnv.log") included a line specifically calling out that VS2017 was required to build this project (it may not be the same in your case, but the build log may help identify the issue). This seems to be a recent change to Unreal Engine itself.

https://docs.unrealengine.com/en-US/GettingStarted/RecommendedSpecifications/index.html

In my case, installing VS2017 on my machine and executing step 5 again successfully compiled and opened. So that may be a starting point on resolving the issue.

Hi there,
I have followed the installation steps up until #5, at which point I receive an error message stating that "AutoVrtlEnv could not be compiled".
I am using R2019b and Unreal Engine v4.23.

Is this down to a version issue, or is it the same problem as Ben described below?

Many thanks

Hi,

I am having an issue with step 5 in "Set Up Environment and Open Unreal Editor" in the set up instructions where UE4Editor-AutoVrtlEnv.dll is missing. Then trying to rebuild I receive "AutoVrtlEnv" could not be compiled.

I have installed R2019b, update 1 and Unreal Engine ver 4.19.2.

Has anyone else had this issue? Any advice?

Cheers.

It would be great if the documentation for these blocks had their respective units specified in them (i.e. does the rotation port of the "Actor Transform Set" block take radians or degrees?)

Mike Sasena

Hi Patrick,
The suggested fixes have been moved into the next MATLAB Update, which is expected to come out soon. You can find more information on how to check for the latest updates here:
https://www.mathworks.com/help/install/ug/update-mathworks-license-and-software.html

Hi there,
I'm encountering the same problem as Wang wrote below. I have visited Bug Report 2075910 and see there are no suggested fixes yet.
Can anyone advise me if the full error message in due to the one windows update issue, or if I have multiples issues stopping running this example?

MATLAB System block 'SimpleScenarioAndSensorModel3DSimulation/Ego Vehicle/PlantParser/Passenger Vehicle Ray Trace Set/Simulation
3D Actor Ray Trace Read' error occurred when invoking 'setupImpl' method of 'Simulation3DActorRayTraceRead'. The error was thrown
from '
'C:\Program Files\MATLAB\R2019b\toolbox\shared\sim3d\sim3d\+sim3d\Engine.p' at line 0
'C:\Program Files\MATLAB\R2019b\toolbox\shared\sim3d\sim3d\+sim3d\Engine.p' at line 0
'C:\Program Files\MATLAB\R2019b\toolbox\shared\sim3dblks\sim3dblks\Simulation3DActor.p' at line 0
'C:\Program Files\MATLAB\R2019b\toolbox\shared\sim3dblks\sim3dblks\Simulation3DActorRayTraceRead.p' at line 0
'C:\Program Files\MATLAB\R2019b\examples\driving\main\SimulateASimpleDrivingScenarioAndSensorIn3DEnvironmentExample.m' at line
159'.
Caused by:
Error using SimulateASimpleDrivingScenarioAndSensorIn3DEnvironmentExample (line 159)
Invalid default value for property 'engine' in class 'sim3d.Engine':
No method 'Start' with matching signature found for class 'System.Diagnostics.Process'.

Hello All,

The error message “No method 'Start' with matching signature found for class 'System.Diagnostics.Process'.” is related to a Windows update that includes .Net 4.8 (528049).
Please see Bug Report 2075910 for a solution: https://www.mathworks.com/support/bugreports/2075910

wang

I encountered a problem. Any suggestions

MATLAB System block 'SCRReferenceApplication/Camera Actor Transform Set /Simulation 3D Actor Transform Write' error occurred when invoking 'setupImpl' method of 'Simulation3DActorTransformWrite'. The error was thrown from '
'C:\MATLAB\R2019a\toolbox\shared\sim3d\sim3d\+sim3d\Engine.p' at line 0
'C:\MATLAB\R2019a\toolbox\shared\sim3d\sim3d\+sim3d\Engine.p' at line 0
'C:\MATLAB\R2019a\toolbox\shared\sim3dblks\sim3dblks\Simulation3DActor.p' at line 0
'C:\MATLAB\R2019a\toolbox\shared\sim3dblks\sim3dblks\Simulation3DActorTransformWrite.p' at line 0'.
Caused by:
Invalid default value for property 'engine' in class 'sim3d.Engine':
No method 'Start' with matching signature found for class 'System.Diagnostics.Process'.

Nevermind, found the problem. This plugin is great tho

YIran Zhang

yixiao wang

Mike Sasena

Hi Sampath. Thanks for your feedback. The purpose of this support package isn't to provide a generic implementation. It is an add-on that provides extra content and customization capabilities specifically for MathWorks' automotive customers. Feel free to reach me through our product page (https://www.mathworks.com/products/vehicle-dynamics/expert-contact.html) if you'd like to discuss your applications / requirements in more detail.

Why is this a part of the vehicle dyanmics blockset? Unreal affords general application for visualization - so Simulink (and Mathworks) should provide a generic implementation to ferry data back and forth. Right now, the way I see, its tied down to having license for particular blockset.

Mike Sasena

Hi Sen,
We migrated the plugin from the Epic Games Marketplace into this support package. Everything you need should be available from this download. We just updated this download today (May 22), so you could try updating. If that version doesn't work, please reach out to me via our product page (https://www.mathworks.com/products/vehicle-dynamics/expert-contact.html), and I can help troubleshoot.

Sen Yang

Hi Mike,
I downloaded this project and installed unreal engine 4.19.
However, when I tried to open AutoVrtlEnv.uproject, a dialog popped up which asks whether to open Epic Games Marketplace to download MathWorksSimulation plugin.
I opened Epic Games Marketplace and searched key word "MathWorks", and I found "MathWorks Interface" code plugin, but I could not find where to download this plugin.
Are "MathWorks Interface" and "MathWorksSimulation" the same?

I also tried to open AutoVrtlEnv.uproject without "MathWorksSimulation" plugin, and error happened, which says "CreateExport: Failed to load Outer for resource 'AMathWorksPassengerVehicleMesh': Sim3dPassVeh /Game/Maps/HwStrght.HwStrght:PersistentLevel.Sim3dPassVeh_1" (and Veh2).
I guess this is because I haven't had MathWorksSimulation plugin included.

Could you please tell me how to download and use the MathWorksSimulation plugin?

Thank you very much!

Mike Sasena

Hi Yu. Please refer to the AVE_README.pdf that comes with this support package to determine which version of Unreal Engine is supported, as this will evolve over time. Note that the R2019a version of the documentation only says that we use 4.19 (it does not say 4.19.0 specifically). I've used 4.19.2 successfully, for example.

Yu Wang

guess do use version 4.19.0 to run the simulation. I dont know why epic games makes many modifications between each version.

Mike Sasena

Hi Tim,
We'd be happy to help you get this set up, but we'll need more information. Please use the button in the "Have Questions?" section of the Vehicle Dynamics Blockset product page to contact us (link below). We can then work with you directly to get this working.

https://www.mathworks.com/products/vehicle-dynamics/expert-contact.html

Hi,

I've tried following both method instructions in AVE_README.pdf, and tried all the related examples, but can't get anywhere.

Always get this error:
-----------
MATLAB System block 'DLCReferenceApplication/Visualization/3D Engine/3D Engine/Simulation 3D Engine 1/Simulation 3D Engine' error occurred when invoking 'setupImpl' method of 'Simulation3DEngine'. The error was thrown from '
'C:\Program Files\MATLAB\R2018b\toolbox\shared\sim3d\sim3d\+sim3d\Engine.p' at line 0
'C:\Program Files\MATLAB\R2018b\toolbox\shared\sim3d\sim3d\+sim3d\Engine.p' at line 0
'C:\Program Files\MATLAB\R2018b\toolbox\shared\sim3d\sim3d\+sim3d\Project.p' at line 0
'C:\Program Files\MATLAB\R2018b\toolbox\shared\sim3dblks\sim3dblks\Simulation3DEngine.p' at line 0'.
Caused by:
Invalid default value for property 'engine' in class 'sim3d.Engine':
3D simulation engine interface setup error (1). Please check the toolbox preferences and ini-file.
---------
Any Suggestions ?
Thank you.

Victor Sim

Hi Mike,
I'm getting this message when running the script for Method B:
Error using sim3d.Engine/setup
Invalid default value for property 'engine' in class 'sim3d.Engine':
Invalid MEX-file 'C:\Program Files\MATLAB\R2018b\toolbox\shared\sim3d\sim3d\SetupSimulation3DInterface.mexw64':
The specified module could not be found.

Do you know how to fix this?
Thanks

Sam Reinsel

I suggest starting with the Vehicle Reference Applications:
https://www.mathworks.com/help/vdynblks/ug/scene-interrogation-with-camera-and-ray-tracing-reference-application.html
https://www.mathworks.com/help/vdynblks/ug/double-lane-change-reference-application.html
The shipped version of the game supports multiple scenes (see https://www.mathworks.com/help/vdynblks/ref/simulation3dconfig.html).
You need Unreal Engine Editor and the package only to build a custom scene.
Here is a link to the getting started instructions for Unreal Engine Editor:
https://docs.unrealengine.com/en-US/GettingStarted
The package includes AVE_README.pdf that describes the further steps.

Could you please tell me how to use this package.I'm a beginner

Mike Sasena

Shahzeb, as mentioned in the AVE_README.pdf, this support package was designed to work with Unreal Engine version 4.19. Please install that specific version of Unreal and try again. If you still have problems, you can contact us through the product page at https://www.mathworks.com/products/vehicle-dynamics/expert-contact.html.

Hi I have installed Unreal Engine 4.21.1 and I think the Method b is not running and there is compiling error. I don't know how to work with co-simulation as I am new to it.
Can anybody please provide me the startup link or document?
Thanks

Mike Sasena

One additional piece of information. Make sure that you set the initial position for the Simulation 3D Actor Set block (https://www.mathworks.com/help/vdynblks/ref/simulation3dactortransformset.html) to be the same as initial position in the Vehicle Body block mentioned below in my last post. The former specifies the first frame when we initialize the 3D engine. The latter sets the starting position of the vehicle once the simulation begins. Both blocks should reference the same value.

Mike Sasena

Tao, the initial position of the vehicle is set within the reference model for the Vehicle Body (3DOF or 6DOF) block. See https://www.mathworks.com/help/vdynblks/ref/vehiclebody6dof.html in the documentation. if you want help with your specific application, you can contact us through the product page at https://www.mathworks.com/products/vehicle-dynamics/expert-contact.html.

tao zhong

Hi, changing the initial value of Vehicle Transform Set block doesn't work for me, the car always starts from the same place. How should I change the starting place? Thanks.

Starting in R2018b, the Vehicle Dynamics Blockset product documentation includes specific information about the scenes, including object locations. See https://www.mathworks.com/help/vdynblks/vehicle-scenarios.html in the documentation

Peter Corke

It would be really great to have a Mac version. Unreal engine is well supported for Mac, pity that this tool doesn't allow it.

Mike Sasena

Carlos. Thank you for your interest, but we do not have any announcements on Mac-supported games at this time.

Any news on when will the games be compiled for Mac?

Mike Sasena

Sudhandshu, Method A in the AVE_README.pdf specifies the path to AutoVrtlEnv.exe using the variable “src_root”. At the end of the code snippet, you can use the command "setenv('PATH', winPath)" to update the Windows path. This will allow MATLAB to find AutoVrtlEnv.exe when it tries to launch the game.

As for your question about “Vehicle Dynamics Blockset doesn’t download on R2018a”, can you please be more specific? What is it that you’re trying to do and what error message are you seeing? If you're starting the download from FileExchange, it may use the latest MATLAB version. You can instead start the download from R2018a's "Add-On Explorer" to ensure you get that specific version.

I am using 2018a version, Vehicle Dynamics Blockset doesn't download on that, anyone knows why?

I don't find the instructions very clear, can I get someone to help me? For example, in Method A: Setup MathWorks Environment for Using AutoVrtlEnv.exe: I do not know what path to add. Also, where can I find AutoVrtlEnv.exe on my pc?

Mike Sasena

Yufei, the current implementation is limited to exchanging data with specific objects defined in the scenes provided with Vehicle Dynamics Blockset. We have received similar requests for interfacing with user-defined objects, but cannot announce when such a feature would become available.

Yufei Quek

Hi, is it possible to configure the interface between Simulink and Unreal Engine? For example, to obtain transformation data from a custom object in UE4 instead of using the provided Sim 3D objects?

Mike Sasena

Christopher, apologies for the inconvenience. There was a slight delay in publishing our materials on the Epic Games Marketplace. The files should now be available at this link:
https://www.unrealengine.com/marketplace/mathworks-interface

The MathWorks Simulation Plugin doesn't seem to be available in the Unreal marketplace. Is there anywhere else we can get this from?

Mikhail

Looking forward to having Vehicle Dynamics Blockset work on Linux with the same featureset as on Windows.

Multiplexer

Multiplexer

Multiplexer

Multiplexer

Vincent Hu

Mike Sasena

Karan, thank you for your interest. We do plan to compile the games for Linux and Mac, but I don’t have a specific date for when these will be available.

Is it possible for you guys (Mathworks) to recompile this game from unreal editor for Linux? Or does it have any components that only work on windows?

MATLAB Release Compatibility
Created with R2018a
Compatible with R2018a to R2019b
Platform Compatibility
Windows macOS Linux