How to add a vehicle/truck in carla using Unreal Engine Editor 4 + Blender for beginners
ฝัง
- เผยแพร่เมื่อ 9 ก.พ. 2025
- My research project involves adding truck models into Carla for simulation. However, the current documentation on Carla carla.readthed... is bit difficult for me to follow, especially for beginners. Hence, it took me a while to figure out everything, and I want to make this tutorial video for my own record in case I forgot how to do it later lol Hopefully this can also be helpful to other Carla users.
P.S It's a rough video I made so pls don't judge it lol
This video mainly talks about
1. How to use Blender to make models ready for importing into Unreal Engine Editor 4
2. How to import models into Unreal Engine Editor 4
Softwares involved:
1. Carla
2. Unreal Engine Editor 4 (I followed Carla Linux Build tutorial to download it)
3. Blender (for 3D modelling)
Website I use to get 3D models:
www.cgtrader.com/
Other useful resources:
1. github.com/car...
2. github.com/car...
3. github.com/car...
Good luck all.
Hello, and thank you for the video, I couldn't make it without your guide. Here are some little tips I found during the process to help other people out:
- At 2:25 : Assign wheel vertex before joining all object of the 3d model. Wheels are likely already in a specific object of your 3d model which make the vertex selection way easier.
- At 3:25 : Select all wheels with ctrl click and modify their size at the same time. That way all wheel have the same hitbox and your vehicle will not have parasit vibration
Thank you for sharing this!
Thank you very much for this tutorial, it saved my bachelor project.
In version 0.9.13 I just had to make one change and instead of Cylinder use Wheel_Shape settings for wheels to work properly.
And for those, who's model consist from more parts, you can merge this parts by clicking alt+p in blender, that also took me some time to find out.
Hey I tried changing cylinder to wheel_shape and the python code to drive the vehicle does not work now and UE4 /carla shuts down. Do you have any idea why and how to resolve it?
When you change a collision mash, other parameters of the wheel may unset.
Check that tire config is appropriately set. Also check that the wheel is assigned in the vehicle blueprint.
I can see my throttle, brake and steer working but my vehicle is not moving forward. what do i do? I am using 0.9.14
Very cool man, thanks
I used your tutorial to add an UAV to the thing, pretended every propeller was a wheel and added the drone without physics in my simulations (that would not work)
Hi I’m Japanese so I’m not good at English.
Sorry.
When I replaced mesh, the vertex group was disappeared.(3:13 in the movie)
Do you know why was it disappeared?
Do I have to set up anything in blender?
I'm not sure why that's the case. I don't think you need to set up anything specific in Blender to enable it.
met same problem,how to fix?
Same issue on my side, has anyone figure it out?
Dear Haowei. Can I ask a question? Where can I download the Tesla FBX file
Good afternoon, I would like to tell you that I am trying to do this process, but it is not working
Dear Haowei, I really appreciate for your video, it helps a lot for adding a 4 wheeled vehicle. BTW, do you have experience on adding a 2 wheeled vehicle?
I've never done that oops
Hi, I'm also interested in doing so. I'm also new to this project. It would be great if you could show me some guidelines.
carlaue4 could not be complied. try rebuilding from source manually. How did you run it?
Could you make a video to add a map (random city map in world) and configure that with carla ? Thnx
Thank your tutorial~
Is the car working for you after following this tutorial? And are you using the same versions of Linux and Unreal Engine as his?
@@theAK7
I have had success getting the vehicle to work.
My Linux is ubuntu18.04、UnrealEngine_4.24、Carla version: 0.9.11
p.s. my english is not good. 🥲
@@jasontian7641 Did you use the same truck as used in the video?
@@theAK7 Yes. But it is easy to roll over when turning, and the center of gravity may need to be adjusted?
@@jasontian7641 Are you working on an individual project (own interest / university project) or is it a company related project ? (I hope you understand what I mean here)
I'm asking this because even i'm working on the similar project as my final year university project.
We added a tractor with your mentioned steps, but it is not moving when we open it in Carla, the throttle and all other buttons are responsive but the vehicle is not moving. Help Please !
Hi, I probably don't know as much as you do at this moment. Please take a look at other people's comments and hopefully you could find something useful!
Hey Hoawei, how do I export SM_TeslaM3_v2 from UE engine. Right now I have found the files related to Tesla on the file explorer of carla under the Content/Carla/Static/Vehicles/4Wheeled/Tesla. The files inside the Tesla folder are in .uassert , .uexp etc format. How do I export those into blender?
Looking forward for your reply
Not sure if this solution still works in the current version: You need to go to Unreal Engine Editor, under Static->Vehicles->4Wheeled->Tesla, right click on SM_TeslaM3_v2, asset actions->export
Hey HI, First of all Thank You for such an informative video. I was wondering if i could add another type of vehicle as in a plane or a air-based vehicle into the unreal carla simulation which can be controlled via Python API. Thanks in advance.
Hi, unfortunately I haven't involved in any latest work with UE4 so I am not really the best person to answer this.
when i replace the mesh with my custom made vehicle then all vertex groups are deleted and idk why. I see that when you change the tesla mesh to truck mesh, you keep the vertex groups (Wheel_Front_Left, Wheel_Front_Right, Wheel_Rear_Left, Wheel_Rear_Right)
do i add them manually and give them the same name?
hey i got the same issue, could you solve it?
@@alejandroargote5064 @daviddugar3483 I did it and you can add them manually using the same name
Hi Haowei, Do you have experience in adding a 2-wheeler in the Carla simulator? I am following Carla's documentation on How to add a 2-Wheeler. But Does not help me. First, I don't understand How to bind Bones to a 3D model. The reference skeleton provided by Carla has too many Bones. Can you please help me? I am stuck at this Point For 1 month.
I am facing the same consequences. How didb you manage that?
Hi does a custom vehicle, in your case the Truck, could it be enabled to work with ROS2? I mean if that 's the case would it be necessary to create a new URDF in ROS2 also, and would that integration be possible?
That's a good question. I never tried anything with ROS2. Not sure if you can import such a model into it though.
Hi Haowei, thank you for sharing us this. I would like to ask if you or anyone has experience to modify SM_sc mesh, which is related to the raycast imaging in CARLA. I would like to downsize the resolution of the vehicle's mesh. Could I use UE4 to edit this or I should use other modeling softwares like Blender to get it?
Unfortunately this is not something that I know about.
@@haoweizhang8485 Thank you. I found the solution. Man must export the model as fbx file with every LODs and modify them in the 3D modeling software, such as blender.
Where did you get the SM_TeslaM3_v2.fbx file. I don't know where to download it.
You need to go to Unreal Engine Editor, under Static->Vehicles->4Wheeled->Tesla, right click on SM_TeslaM3_v2, asset actions->export
Hi bro, do you know how to get that file now. I still can't make it. Thanks
Hi Haowei, thank you for your video. Have you created a new scene in Carla by RoadRunner or other software?
Hi Bo, unfortunately, I haven't tried that :(
Hi Haowei , I wonder if I could add a 2-wheeled robot similar to the Segway-Ninebot? or 3-wheeled robot with an auxiliary support wheel.
Hi you might be able to do that although I'm not sure about that. The Blender part should be the same as if you are working with 4-wheel vehicles. Maybe you can check if current UE4 has support for 2-wheelers?
Hi, I created the vehicle for Carla. When I open the Carla simulator, Vehicle is flying. How can I fix? Vehicle is not stand on flat ground
Maybe the bounding box was set up incorrect?
@@haoweizhang8485 Bounding box Is it the center of gravity of the car?
@@haoweizhang8485 Can you help me please ?
@@mertbacaksz6565 I haven't used Carla for quite a while so I am not very familiar with the current settings. I think you need to set your bounding box so the bottom of the box is tied to the bottom of vehicle wheels.
mert merhaba carla'da sorunun çözebildin mi aracını yolda koşturabiliyor musun ?
make launch command shows this error "LogOutputDevice: Error: Ensure condition failed: VendorId != EGpuVendorId::Unknown " .Do you have any idea to fix it
Sorry I have no idea. Maybe you can check out issues on GitHub
Hi Haowei, how can I modify the mass & moment of inertia of the vehicle during the process of adding this new car model? Thanks!
unfortunately i don't know how to do that :(
@@haoweizhang8485 Thank you for your help. The reason I wanna add a new model, I that I need to simulate the dynamic feature of my model rally car. And I need to make sure my car in the CARLA has the same moment of inertia with my car in the real world. Do you have any suggestion about how can I achieve this goal? Thank you very much!
@@shockleyzheng2372 I am honestly not an expert in doing this :( The sources I usually look for are in Carla's official documentation and its GitHub issues. Maybe it's worth a try looking it up there?
@@haoweizhang8485 yeah. I will check that. Anyway, Thank you a lot for your continious help.
Hi Haowei, thank you for your video. May i ask how did you launch the carla.in the ue4? Did you go to the CarlaUe folder and open the .uproject file in UE4. I failed to launch this file and it said i do not have source code. Thank you for your help!
I was following the Linux Build on Carla official documentation page and I launched it simply by `make launch-only`. Hope this helps!
Hello Haowei Zhang , Why can't imported models show colors?
Yeah, I dont think it shows colors. You might need to set it by setting other parameters, e.g., materials.
Hello,
it is a nice tutorial. I followed the steps exactly like you described. However, when I use the newly added truck with manual_control.py, the vehicle does not move when pressing W. I could see the wheels rotating. Can you help me with this?
Thanks in advance.
Hi thank you! I can think of two possibilities. One is the version issue. It's possible that you are using a different version of UE4 and Carla as I did, and somehow such an issue could happen. Second is maybe you accidentally missed some steps? Hmmm, btw did you make sure the bounding box of the vehicle does not wrap the wheels at 14:06?
@@haoweizhang8485 Thanks for the quick reply. My Unreal Editor version is Version: 4.26.2-0+++UE4+Release-4.26. And I am using Windows-build version of CARLA. I get the following warning when I run manual_control.py
WARNING: Version mismatch detected: You are trying to connect to a simulator
that might be incompatible with this API
WARNING: Client API version = 0.9.13
WARNING: Simulator API version = 0.9.13-1-g8854804f-dirty
However, in the latest carla documentation about adding a new vehicle, there are few other steps like Step 5 of bind and model the vehicle and step 8 of import and configure the vehicle. Do you think these steps are causing my issue?
@@gkh5204 It's possible that those steps are causing your issue. btw, the version mismatch might be because you are running a simulator that is a modified version.
Hey, G Kh, i got the same problem as you, my carla and UE4 version are same with you. Have you solved your problem? Can I have your solution? Thx
@@gkh5204 same issue
did you find any solution??
Hi Haowei, nice to see your video. It is very helpful and detailed. My question is, when I try to import the Tesla animation, I can't open that uasset file with my UE4 editor. And My UE4 editor will not show that file in the Content browser. My UE4 editor is version 4.26.2-0+++UE4+Release-4.26. Do you know how to solve that problem? Thanks! 在复制现有的animation时,我无法打开uasset文件。
Are you sure you used the correct Tesla file? What I used is in Static->Vehicles->4Wheeled->Tesla, and you can right click on SM_TeslaM3_v2, asset actions->export to get a SM_TeslaM3_v2.fbx file.
@@haoweizhang8485 yeah. These files will not even show in my Content Browser when i am in that folder. Btw, are you using carlar 0.9.10? I tried 0.9.10 0.9.8 0.9.9, none of them works for me. Do you think it is because my unreal editor version is older than the carlar uasset file version? Which unreal editor version are you using? Thanks!
@@shockleyzheng2372 Hmmm, my UE4 is 4.24.3. I chose the Linux Build option in Carla 0.9.11. Maybe that's why you are having these errors.
@@haoweizhang8485 So my ue4 version is newer than yours. Then if you can open those files, i should also could.
I did not used linux build carla. I donload the .rar file from github and extract the files. So do you think i shoul use linux build version?
Traceback (most recent call last):
File "manual_control.py", line 1380, in
main()
File "manual_control.py", line 1372, in main
game_loop(args)
File "manual_control.py", line 1269, in game_loop
world = World(sim_world, hud, args)
File "manual_control.py", line 218, in __init__
self.restart()
File "manual_control.py", line 247, in restart
blueprint = random.choice(get_actor_blueprints(self.world, self._actor_filter, self._actor_generation))
File "C:\Users\msi\anaconda3\envs\carla-sim\lib
andom.py", line 261, in choice
raise IndexError('Cannot choose from an empty sequence') from None
IndexError: Cannot choose from an empty sequence
Hallo Mr.Zhang, I'm a new carla learner, I have some problems on Obstacle detection. If it is possible, I want you to teach me some about that, and I definitely pay for that. btw may I know your wechat number if you have. sorry to bother you and Thank you.
Sorry I ain't no professional at Carla :(((((
@@haoweizhang8485 or you can just teach me to do some easy obstacles detecting? Is that ok?😂
Or we can talk in private. If I am allowed to get your Wechat or WhatsApp 😅Thank you ~
Hi Haowei, Thank you for your video. I have created the truck and imported into carla. When I retrieving the lidar data, i am not able to get any pointcloud data on the truck sample. Do you have any solution for this?
It's been a while since I last worked on this. I recall that I had to make some edits in the code save the lidar pointcloud data.