You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Can Unreal physics engine be used for simulink models to verify the physics of simulation
10 views (last 30 days)
Show older comments
I recently saw that there is a visualisation block in simulink. It helps to visualise simulink models in a virtual environment of Unreal scenes. I want to know is this visualisation only for photo realistic or it includes physics too (Eg:- Gravity, collisions etc). This is incase of using Prebuilt Unreal scenes that Simulink uses. Looking forward for the response.
Accepted Answer
Nishan Nekoo
on 10 Oct 2023
The answer is yes, it does include physics and is not just for visualization only!
With reference to this documentation page: https://www.mathworks.com/help/sl3d/scenario-simulation.html
You can use Simulink and MATLAB interfaces to "Access advanced features available in the Unreal Engine, such as collision detection, and the physics engine..."
A basic example:
More complex example and associated webinar series:
17 Comments
VIGNESH BALAJI
on 17 Oct 2023
Thanks a lot for providing a detailed information on this. I am interested in the Physics engine feature of Unreal engine. I have a follow up on this, I saw that Unreal scenes can be used with Simulink in 3 ways -
- Using inbuilt scene in Simulink
- Using a custom compiled scene in Simulink
- Using Co-Simulation at the same time running both Unreal and Simulink
Can I use the Physics engine in all the three methods or ways ?
VIGNESH BALAJI
on 18 Oct 2023
Thanks a lot for your reply, can you suggest me some inbuit scenes for water interaction and a quadrotor.
Nishan Nekoo
on 18 Oct 2023
Unfortunately we do not have any inbuilt scenes for water interaction right now.
VIGNESH BALAJI
on 9 Feb 2024
Can I model ropes with unreal ? Is there any examples for it with matlab available ?
Nishan Nekoo
on 9 Feb 2024
Hi Vignesh, unfortunately we do not have any examples of modeling ropes (or any other deformable body) with MATLAB in the Unreal environment. Depending on your use case, perhaps the rope behavior can be approximated using multiple primitives linked together heirarchically.
Can you provide more information on what you are hoping to model here?
VIGNESH BALAJI
on 9 Feb 2024
Sure, I can provide you a detailed information on it.
I am trying to model hanging ropes (catenaries) which are moving slowly (quasi-statically) in space as their end points move slowly (0.5 m/s) the hanging cable also moves.
I built a simulink model for it with analytical equations for a catenary and did optimisation of potential energies to always get the right shape of the hanging cable. Although the model is working, I have attached a video below as a zip file for your reference. Please take a look at it.
I would like to have a physical simulator (which acts like a model) to verify my correctness of my numerical calculations in my model and it can also be used for my further development to verify the model I am developing.
I hope I explained it. Please do let me know if you have any questions about what I am trying to do.
Nishan Nekoo
on 9 Feb 2024
Edited: Walter Roberson
on 20 Feb 2024
Hi Vignesh,
I think the most effective way to model this in Unreal is to use the Cable Component from Unreal: https://docs.unrealengine.com/4.27/en-US/Basics/Components/CableComponent/
You would need to carefully tune the parameters of the cable and the physics settings in Unreal to get realistic physical behavior.
You can control the movement of those Cable Components from Simulink by following a similar process to the one described in this video: https://www.youtube.com/watch?v=fNd0fVYxkGg&ab_channel=MATLAB
I hope that helps, all the best!
Nishan
VIGNESH BALAJI
on 9 Feb 2024
Thanks a lot for the suggestion and resources.
Once, I make this I can put it out as a FEX package like an open source plugin in the community for others to use it for their works.
I do have 2 questions -
- Does Simulink have a direct connection to Unity just like Unreal ?
- I heard Unity has better Cable modelling than Unreal like Obi Rope package ?
Please let me know.
Nishan Nekoo
on 9 Feb 2024
Unfortunately, we do not have a similar interface to Unity using Simulink 3D Animation. However, you can use the ROS Toolbox to connect to Unity such as in this example: https://www.mathworks.com/help/ros/ug/pick-and-place-workflow-in-unity-3d-using-ros.html.
I am not familiar with the cable modelling capabilities in either Unreal or Unity so I cannot comment on this topic.
Nishan
VIGNESH BALAJI
on 12 Feb 2024
@Nishan Nekoo
Thanks a lot for the suggestions. I have been looking into Unreal engine with simulink. Can you please let me know if there are examples of multi-rotors (quadrotors) with simulink - Unreal connection examples. I was not able to see it on my initial google search.
Nishan Nekoo
on 12 Feb 2024
@VIGNESH BALAJI this page has several examples that use the Simulation 3D UAV Vehicle block which models a quadcopter by default.
VIGNESH BALAJI
on 13 Feb 2024
@Nishan Nekoo thanks, I tried the example in a simulink project. I did get an error stating it does not support my operating system Ubuntu. On looking further in Matlab Documentation. It says Unreal co-simulation is only possible in Windows and not available on Ubuntu (Linux). Is it true ?
Further, Is it possible to have Force Sensors for the quadrotors in Unreal simulation ? I saw other sensors in UAV toolbox like Lidar, Camera, Ultrasound etc and no force sensor was available. Please let me know the possibility of force sensor as a lot of things are dependent on it.
I am looking forward for your reply.
Nishan Nekoo
on 13 Feb 2024
Unfortunately, Linux is not supported for Unreal co-simulation as of release R2023b. Support for Linux may be added in a future MATLAB release.
The Simulation 3D UAV vehicle only visualizes the UAV given a certain translation and rotation in a 3D environment. To analyze the physical behavior of the quadcopter system, I would recommend using the Quadcopter drone model in Simscape and performing physical modeling of the queadcopter system instead.
VIGNESH BALAJI
on 20 Feb 2024
Edited: VIGNESH BALAJI
on 20 Feb 2024
@Nishan Nekoo can you please help me with the answers for this installation procedure to try out Simulink-Gazebo link - https://nl.mathworks.com/matlabcentral/answers/2082173-unable-to-install-gazebo-plugin-for-simulink-co-simulation?s_tid=prof_contriblnk ?
Nishan Nekoo
on 20 Feb 2024
Hi @VIGNESH BALAJI I am not sure about the answer to this question, I would recommend reaching out to our Tech Support team who can work directly with you to resolve the issue.
VIGNESH BALAJI
on 21 Feb 2024
@Nishan Nekoo Thanks a lot for your answer. I have contacted them in Installation section. I hope i will receive a reply. Thanks a lot for your help :)
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)