carla icon indicating copy to clipboard operation
carla copied to clipboard

Replace the vehicle model

Open CoderXuans opened this issue 1 year ago • 14 comments
trafficstars

My colleague provided me with an FBX file for the exterior. Can I replace only the exterior of the existing vehicle in CARLA without changing the original vehicle dynamics model?

CoderXuans avatar Oct 08 '24 02:10 CoderXuans

Hi, you may want to read this guid. https://carla.readthedocs.io/en/0.9.15/tuto_A_add_vehicle/

While I looked for the link, I found this guid. https://carla.readthedocs.io/en/0.9.15/tuto_content_authoring_vehicles/

PatrickPromitzer avatar Oct 08 '24 08:10 PatrickPromitzer

@PatrickPromitzer The tutorial method involves creating and exporting to obtain the mesh, the skeleton, and the physics asset. However, when I used a ready-made FBX file, I found that there was only one content. I converted the model drawn by my colleague in SolidWorks to FBX format using 3D Max.

CoderXuans avatar Oct 08 '24 09:10 CoderXuans

You only need the first link in that case. It should not make a different between one whole object and many small parts if you only want it to drive. You still have to add the tires (bones) to the FBX file, and prepare it like the guide tells you.

You will not be able the open doors as example if you only have one object.

PatrickPromitzer avatar Oct 08 '24 12:10 PatrickPromitzer

Hi,Sorry, I forgot to mention that my model is an unmanned ship. The tutorial includes setting up four wheels; should I set the wheels or not?

CoderXuans avatar Oct 09 '24 01:10 CoderXuans

If you want it to drive on the ground, yes. I am not sure if it is currently possible to have an vehicle without wheels which can drive. The wheels are the reason the vehicles drive around.

There is an option to deactivate gravity if you want it to float. If you use this option, you can try adding it without wheels and push it around with some code. It would be difficult with collision, but an interesting concept.

PatrickPromitzer avatar Oct 09 '24 07:10 PatrickPromitzer

Okay, thank you for your suggestion.

CoderXuans avatar Oct 09 '24 07:10 CoderXuans

Hello! did you manage to solve the problem, or do you still need help? greetings

Rodrigo-Villarias avatar Oct 18 '24 08:10 Rodrigo-Villarias

Hello, I have successfully implemented the unmanned ship with four small wheels. Now I am facing a new problem. When I run the leaderboard test, I want to replace both the ego vehicle and other road participants with my recently implemented model, which is named ship_small_whe. I searched the entire project for get_world().get_actors().filter('vehicle.*') and replaced it with get_world().get_actors().filter('vehicle.myship.ship_small_whe'). However, it has not been replaced with my desired ship_small_whe. Can you help with this issue? Thank you.

CoderXuans avatar Oct 18 '24 09:10 CoderXuans

The fastest option that I would recommend is to go to the blueprint Vehicle_Factory and delete all vehicles, and add a class with only your vehicle, so in the scene it will spawn only that one, and regarding your vehicle when you go to do the manual control use “--filter (the name of your vehicle)”

Rodrigo-Villarias avatar Oct 18 '24 10:10 Rodrigo-Villarias

~HH$YG(9UZ~90N5} }RYBJF My vehicle is the 29th one. Do I just need to delete all the previous 29 vehicles?

CoderXuans avatar Oct 18 '24 10:10 CoderXuans

Yes, this will ensure that only yours can spawn

Rodrigo-Villarias avatar Oct 18 '24 11:10 Rodrigo-Villarias

It worked, thank you.

CoderXuans avatar Oct 18 '24 11:10 CoderXuans

If I want to adjust the number of background vehicles, do you have any suggestions?

CoderXuans avatar Oct 19 '24 00:10 CoderXuans

@Rodrigo-Villarias Sorry to bother you, but I have another question about the traffic lights. Even though I moved them underground and ran the evaluation code for the leaderboard, the traffic lights still appear. I moved the nearby low houses underground, and they disappeared, but when I tried to back up the map data and delete the traffic lights, clicking play caused Unreal Engine to crash.

CoderXuans avatar Oct 19 '24 01:10 CoderXuans