Using Unreal Engine 5 Part 1 (Datasmith, DUALSHOCK 4)
Introduction
I have decided to use Unreal Engine 5 to simulate robots. I have been creating robots in both hardware and software, and I intend to use my experience in this area.
After using it a little, I can import CAD data of robots I have designed, and the programming is the same type as Node-RED, so I will be able to use it right away. There are a lot of things I want to do.
Gathering Information First
First, I looked at what Unreal Engine 5 can do.
▼I found a helpful video. It seems to be used in fields other than game development.
The automobile example is interesting. It seems to be able to do real-time rendering, compare different color products, and run them on a simulation. I see…
▼It seems that some materials are already prepared, such as objects and people.
https://www.unrealengine.com/ja/metahuman
▼This page has a collection of Unreal Engine related information. There is also a tutorial.
https://gamemakers.jp/category/game-create/tutorial/
▼I see on the news page that there is a plug-in that performs fluid simulation.
https://gamemakers.jp/article/2024_04_06_65321/
▼The Cat Can Understand series was introduced; it’s about Unreal Engine 4, but it seems to be a good reference.
Run Unreal Engine 5
I have installed and started Unreal Engine 5.1.1, running in Windows environment.
▼Download page is here.
https://www.unrealengine.com/ja/download
▼You can launch it with the Epic Games Launcher. You can also add assets from the Marketplace.
![](https://404background.com/wp-content/uploads/2024/04/babe0ff5de726262fc62d9fbee23458a-1024x514.jpg)
▼This time I created a project for a third person.
![](https://404background.com/wp-content/uploads/2024/04/413ced2bec4a3c1d8e017ee3efa10989-1024x605.jpg)
▼When opened, it looks like this. Press the green triangle button in the upper column to operate it.
![](https://404background.com/wp-content/uploads/2024/04/b7b84fa7d52def3747fd6492c057a527-1024x550.jpg)
Import CAD data from Fusion360
I have imported a robot designed in Fusion360, a 3D CAD software.
I use Datasmith CAD Importer.
▼It was introduced in this article.
https://metatimecg.com/how-to-use-datasmith/
▼Plugins can be added by going to Edit → Plugins.
![](https://404background.com/wp-content/uploads/2024/04/image-1024x267.png)
▼CAD data can be imported from “Import File” in Datasmith.
![](https://404background.com/wp-content/uploads/2024/04/0113b56b3e33b5a692782561670fb2e8.png)
I imported what I created during the hackathon. First, please see the data from the Fusion360 design.
▼This is a robot that carries a smartphone.
▼Data designed with Fusion360 is here.
![](https://i2.wp.com/404background.com/wp-content/uploads/2024/04/35b1548d9e67511b5f35d30c3be2ff74.jpg?ssl=1)
![](https://i2.wp.com/404background.com/wp-content/uploads/2024/04/fda2224132567c670f87752068c0f352-1024x663.jpg?ssl=1)
▼When rendered in Fusion360, it looks like this.
![](https://i0.wp.com/404background.com/wp-content/uploads/2024/04/9b7a7a1f9250ce1613bf661e4d5d6b8b.jpg?ssl=1)
![](https://i1.wp.com/404background.com/wp-content/uploads/2024/04/f9ad212dc483634f9a62ce8bcee69afb.jpg?ssl=1)
▼The actual product is shown here. I cut the wood with a laser cutter, assembled it, and painted it red. It can be operated with a PS4 controller.
![](https://i0.wp.com/404background.com/wp-content/uploads/2023/08/IMG_1924-1018x1024.jpg?ssl=1)
![](https://i1.wp.com/404background.com/wp-content/uploads/2023/08/IMG_1928-1024x755.jpg?ssl=1)
▼When imported into Unreal Engine 5, it looks like this. The color data also seems to be transferred.
![](https://404background.com/wp-content/uploads/2024/04/3021026a966a908bdcbb09a2bbfe460a-1024x502.jpg)
▼It also seems to be able to import OBJ and FBX. This article was easy to understand.
https://metatimecg.com/ue5-how-to-import-3dmodel/
Operate with PS4 controller
I set it up so that it can be controlled with the PS4 controller (DUALSHOCK 4). I often use the PS4 controller to control the robot as well.
▼I often use it connected to a microcontroller.
▼I was able to operate it after setting it up based on this article. I am using a plugin called Windows RawInput.
https://qiita.com/suramaru517/items/a42199126a6b634c55ca
Edit the DefaultInput.ini in the project’s Config folder, but it may be hard to locate. You can view it in Explorer by closing the project once and right clicking on it when you open it.
▼Right click on it and you will see “Show in Explorer”. This will make it easier to open.
![](https://404background.com/wp-content/uploads/2024/04/44ef8ad67bbcde7b9e371aabe38a1ed9.png)
I prepared a controller program in a flow editor called Blueprint based on the article.
▼Create a new Blueprint class from the flow icon.
![](https://404background.com/wp-content/uploads/2024/04/5114b653dac0eaf6b3bacb22070a5fde.png)
▼I chose Player Controller.
![](https://404background.com/wp-content/uploads/2024/04/1a132915b84fdd79a11b637ac3336753.png)
▼I saved it to Blueprints folder.
![](https://404background.com/wp-content/uploads/2024/04/091725d449c1bfaf541241cf0ba60ddc.png)
There was a text in the article for copying and pasting the macro with Ctrl+V anywhere, and the macro was added.
▼The flow style is the same as in Node-RED!
![](https://404background.com/wp-content/uploads/2024/04/e1d2d4df57915ae46b2e2242d89f8791-1024x446.png)
By the way, the connection between the PC and the controller sometimes disconnected quickly, but it was simply a low battery. Normally, I connect to the PC with a wired connection.
Sometimes it would not respond even when connected, but reopening the project would solve the problem.
▼Two shots with controlling!
![](https://404background.com/wp-content/uploads/2024/04/fd8fb5a26fd835c5948847e67271d4a3.jpg)
Finally
I have only used it a little, but it seems useful to be able to control the characters right away and use the materials provided. I don’t want to write a program for character manipulation or anything like that…
When I usually design with CAD, I am concerned about the dimensions when the data is imported. I will look at this again in more detail. I think I can simulate a robot with a camera on it or something.
▼This is what it looks like when contrasted without changing the size. They may be about the same size.
![](https://i2.wp.com/404background.com/wp-content/uploads/2024/04/2116b3bb87cf85728f52d6a3671e7d8c.png?ssl=1)
![](https://i1.wp.com/404background.com/wp-content/uploads/2024/04/69666c5170548314732c19b91eab9528.jpg?ssl=1)
Discover more from 趣味的ロボット研究所
Subscribe to get the latest posts sent to your email.