AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

How do I use my own car model?

Open n1ckfg opened this issue 9 years ago • 17 comments

Looking to change the specs of the default car model--is there anything addressing this in the documentation?

n1ckfg avatar Nov 21 '17 21:11 n1ckfg

If you're just looking to change the physics and are OK with keeping the same visual model, the simplest thing would be to edit the parameters of the included uasset file for the SUV (in AirSim Content/VehicleAdv/SUV/)

If you have a completely custom mesh, then you can set it up like any other wheeled vehicle, but instead parent it to CarPawn. And then change the CarPawn constructor to point to the correct assets.

mitchellspryn avatar Nov 22 '17 05:11 mitchellspryn

Thanks! Yup, just looking to change the physics, don't care about the appearance of the geo for now. Have you got anything there that would affect the throttle command? (Is there a drivetrain model?)

n1ckfg avatar Nov 22 '17 19:11 n1ckfg

For throttle, there are a few things you can try.

First, open the blueprint SuvCarPawn, and navigate to the VehicleMovement component:

image

There are a few relevant parameters you can play with:

  • Max RPM: this controls the top speed of the car.
  • Torque Curve: this controls the acceleration. To up it, add a few more points and slide it up.

There are drivetrain / transmission models, but those usually affect handling (i.e. turning) more than acceleration.

Do keep in mind that there will need to be some manual tuning; I have found that copy-pasting actual data from real-world tests done on car components (e.g. torque curves from engines) usually doesn't give very good results.

mitchellspryn avatar Nov 22 '17 23:11 mitchellspryn

Awesome, I'll play with this!

n1ckfg avatar Nov 29 '17 18:11 n1ckfg

Would you please provide a more detailed tutorial on how add a custom mesh vehicle to AirSim? Thank you!

benjamin-lange avatar Mar 16 '18 09:03 benjamin-lange

Hi, I would also be happy to have more infos on how to use a custom mesh car/vehicle. Thank you

chioveri avatar Apr 09 '18 06:04 chioveri

@chioveri

May be this works for you, I will try it out as soon as I find the time: https://github.com/Microsoft/AirSim/blob/master/docs/settings.md The documentation deals with all sorts of parameters that can be set in the "/Documents/Airsim/settings.json file". Have a look at the "pawn paths" section.

benjamin-lange avatar Apr 19 '18 13:04 benjamin-lange

Hi guys,

I´m also having difficulties to change the mesh of the car. Just the mesh. Anyone knows how to do it? I tried different approaches like changing SpawnCar Path to a new blueprint and also trying to change only the Skeletal Mesh to a new Mesh.

If someone has already done this, could you exemplify how to do it?

image

image

Best regards, Fernando Damasio

fernandodamasio avatar Oct 19 '18 20:10 fernandodamasio

@fernandodamasio I did not look into your code problem. But here is a skeleton settings.json for the custom model I use: "SettingsVersion": 1.2, "SimMode": "Car", "PawnPaths": { "DefaultCar": {"PawnBP":"Class'/Game/TruckTrailer/Truck/Blueprints/Truck.Truck_C'"} } You have to adjust the path in "DefaultCar" to your setup. Please refer to the documentation for details. Look under "Other Settings" paragraph "PawnPaths".

benjamin-lange avatar Oct 22 '18 14:10 benjamin-lange

@fernandodamasio I did not look into your code problem. But here is a skeleton settings.json for the custom model I use: "SettingsVersion": 1.2, "SimMode": "Car", "PawnPaths": { "DefaultCar": {"PawnBP":"Class'/Game/TruckTrailer/Truck/Blueprints/Truck.Truck_C'"} } You have to adjust the path in "DefaultCar" to your setup. Please refer to the documentation for details. Look under "Other Settings" paragraph "PawnPaths".

Hi @benjamin-lange

I tried to change only the mesh inside the cars' blueprint. It didn´t work. So, I guess I need another car to change it? I mean, I can't change just the mesh / appearance of the Airsim car.

Appreciate your help.

Best regards, Fernando Damasio

fernandodamasio avatar Oct 23 '18 15:10 fernandodamasio

@fernandodamasio , your are welcome.

I tried to change only the mesh inside the cars' blueprint. It didn´t work.

I recommend leaving the default blueprint alone. Just to clarify what you tried to do, you tried to change the mesh as it is shown in the following screenshot?

image

If so then you might break the animations associated with the mesh which could cause more problems. That is if you want to use the default vehicle in the future you have to fix these problems.

So, I guess I need another car to change it?

Yes, I recommend that. At least copy the original Blueprint located in project_name\Plugins\AirSim\Content\VehicleAdv\SUV and rename it before you experiment on it. ;-) After you made your changes try out the pawn path method as stated above.

For your experiments with custom vehicle Blueprints in Airsim have a look into this free asset from the marktplace or simply use the car model from the Blueprint vehicle template. To get the vehicle template create a new project using the Blueprint vehicle template and then extract the Blueprint from it. Then use the pawn paths in the settings to setup the vehicle Blueprint for Airsim. I think there is a way to import the vehicle template content into your current project without creating a new project as well, but I do not know the details for this procedure.

benjamin-lange avatar Oct 24 '18 08:10 benjamin-lange

Hi @benjamin-lange

Thank you very much for your quick response and also congrats for the Airsim project!

Regards,

fernandodamasio avatar Oct 24 '18 15:10 fernandodamasio

Hello! Thanks, @benjamin-lange , @mitchellspryn and everyone else who has contributed to solving this issue I am attempting to change the default car in my AirSim project

Here's what I have done so far:

  1. Imported my new fbx asset for the car. It has the same skeletal hierarchy and nomenclature as the SUV pawn.
  2. Created a physics asset for it. This is set up in a similar way to the SUV blueprint which is the airsim default. The wheels are set to kinematic bodies and the chassis has the default physics setting instead of kinematic. I'm using single hull convex collisions on all bodies for my mesh
  3. Created a BP for my new skeletal mesh for the car. The BP I created has the CarPawn as its parent
  4. Changed the Airsim settings.json file to include the pawn path to my new blueprint

When I hit play, I do see my new car show up instead of the default old one. However, the car doesn't seem to respond to any input when I hit the arrow keys. Am I missing a step or something else?

Thanks!

karanparikh91 avatar Dec 26 '18 06:12 karanparikh91

@karanparikh91, have you tried using the "WASD" keys to move the vehicle?

benjamin-lange avatar Jan 02 '19 07:01 benjamin-lange

@benjamin-lange thanks for your reply.

Turns out the car was not exported properly from Blender. My colleague found this blog post useful in fixing the problem blog post: https://forums.unrealengine.com/development-discussion/content-creation/66676-help-blender-vehicle-to-ue4

I've got things working correctly now.

karanparikh91 avatar Jan 11 '19 14:01 karanparikh91

Hi @benjamin-lange my_own_vehicle_skeleton

I have my own own project and my own vehicle model with the following skeleton [see image]. I have created a child blueprint class from AIRSIM carpawn and selected a mesh of my own vehicle. What else I should do in addition to that to use my vehicle ?

If I try to play. Iam getting the following error. [image] load_error

my_own_vehicle_skeleton

My json settings are follows.

{ "SettingsVersion": 1.2, "SimMode": "Car", "PawnPaths": { "DefaultCar": { "PawnBP": "Class'/Game/Mower/Blueprints/Mower_AIRSIM.Mower_AIRSIM'" } } }

thejeshk avatar Feb 23 '20 12:02 thejeshk

Hello @benjamin-lange, @karanparikh91 @mitchellspryn @fernandodamasio >

I am having difficulties adding custom vehicle into my own project.

Here's what I have done so far: Followed same steps as @karanparikh91

I have created my own project

  1. Imported my new fbx asset for the car. It has the same skeletal hierarchy but different bone names. [Note: Is it important to have the same name bone names?]
  2. Has physics asset. Wheels are set to kinematic bodies. I'm using single hull convex collisions on all bodies for my mesh
  3. Created a BP for my new skeletal mesh for the car. The BP I created has the CarPawn as its parent
  4. Changed the Airsim settings.json file to include the pawn path to my new blueprint

When I hit play, I do see my new car flying from somewhere and dropping down (even though the player start is on the floor) But it doesn't seem to respond to any input when I hit the arrow keys. Am I missing a step or something else?

Thanks! TK

thejeshk avatar Feb 23 '20 18:02 thejeshk