Problem [SOLVED]Asymmetric thrust in my car

Matias Saibene

Development hell
Joined
Jul 7, 2012
Messages
1,030
Reaction score
581
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
Hello forum friends.

I recently started a new project inspired by the flying car from Slovakia. Now I run into a problem: I defined 4 contact points for the wheels but when I apply thrust my car always turns to the right.
I ported the code to Orbiter Windows and the force display tells me that the car has something pulling it sideways to the right.

I've reviewed the code many times, and I've tried changing practically everything, but I can't find a solution.

Maybe you guys can review the code and tell me what I'm doing wrong.

I am attaching the GitHub repository where the code is and two compiled versions (so you can test it directly).

https://github.com/MatiasSaibene/KV_AirCar_orbiter_addon
 

Attachments

  • KleinVision_AirCar_Windows.zip
    403.4 KB · Views: 0
  • KleinVision_AirCar_Linux.zip
    440.4 KB · Views: 0

LordCroussette

Quebec City's Resident Base Builder
Addon Developer
Donator
Joined
Jan 26, 2013
Messages
215
Reaction score
705
Points
108
Location
Québec, Canada
Preferred Pronouns
He/Him
I recently started a new project inspired by the flying car from Slovakia. Now I run into a problem: I defined 4 contact points for the wheels but when I apply thrust my car always turns to the right.
Well, I'm no expert on contact points, so I don't know if I'll be much help. But, Orbiter was not made with ground vehicles in mind. Vessels are designed to use three contact points for the "wheels", which have to be set up in a specific order. #1 for the front gear, #2 for the left gear, and #3 for the right gear.

Using four contact points for the wheels, or if they aren't set up in the correct order, might be the cause of your problem. I would suggest replacing the two contact points of the front wheels with a single one placed between them. And place the fourth on the roof.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,537
Reaction score
2,272
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
If its a real car, I would have told you to check the track...

In that case, make sure the fourth touchdown point has the same friction constant as the first three.
 

Matias Saibene

Development hell
Joined
Jul 7, 2012
Messages
1,030
Reaction score
581
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
That's exactly what I did. I changed the touchdown points on the front wheels to just one. So on the wheels I only have 3 touchdown points.

https://github.com/MatiasSaibene/KV...944ea82eaa3a74856625131523/Linux/AirCar.h#L28
Code:
static const int wheels = 14;
static TOUCHDOWNVTX tdvtx_wheels[wheels] = {
    {(TDP1_Location), 2e4, 1e3, 1.6, 1},
    {(TDP10_Location), 2e4, 1e3, 1.6, 1},
    {(TDP3_Location), 2e4, 1e3, 1.6, 1},
    {(TDP4_Location), 2e4, 1e3, 3.0},
    {(TDP5_Location), 2e4, 1e3, 3.0},
    {(TDP6_Location), 2e4, 1e3, 3.0},
    {(TDP7_Location), 2e4, 1e3, 3.0},
    {(TDP8_Location), 2e4, 1e3, 3.0},
    {(TDP9_Location), 2e4, 1e3, 3.0},
    {(TDP_WING1_Location), 2e4, 1e3, 3.0},
    {(TDP_WING2_Location), 2e4, 1e3, 3.0},
    {(TDP_WING3_Location), 2e4, 1e3, 3.0},
    {(TDP_WING4_Location), 2e4, 1e3, 3.0}
};

I imagined that Orbiter is not prepared for cars, so I designed my project thinking about an airplane but with the only difference that it has the mesh of a car.
It's very strange because I started my project just like the I.Ae37 which I had no problems with and I programmed it very similar to how I'm doing the AirCar.
I thought it would be an Orbiter Linux bug, but I tried it on Orbiter Windows (OpenOrbiter) and get the same result.

EDIT:
I'm using @Blake's Blender Mesh Tools with an include file so that Blender writes the positions of the objects to variables that have the same names.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,537
Reaction score
2,272
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Well, as I read it, TDP4_Location still touches the ground. I see no obvious place for a lateral force, if you are not using aerodynamic surfaces in your model. The control surface definitions could cause weird behaviour then, though
 

Matias Saibene

Development hell
Joined
Jul 7, 2012
Messages
1,030
Reaction score
581
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
Well, as I read it, TDP4_Location still touches the ground. I see no obvious place for a lateral force, if you are not using aerodynamic surfaces in your model. The control surface definitions could cause weird behaviour then, though
I'm going to leave 3 touchdown points just for the wheels and I'm going to try.
 

Matias Saibene

Development hell
Joined
Jul 7, 2012
Messages
1,030
Reaction score
581
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
Well, as I read it, TDP4_Location still touches the ground. I see no obvious place for a lateral force, if you are not using aerodynamic surfaces in your model. The control surface definitions could cause weird behaviour then, though
It worked! Thanks a lot!
 
Top