Tires popping up on flat terrain

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Tires popping up on flat terrain

Postby JoshKlint » Tue Dec 11, 2018 6:35 pm

This is using my own multi-body vehicle implementation. How can I prevent this problem? It looks like the tires are hitting the edges of terrain triangles and causing the vehicle to jump around.



Swept collision did not help. I tried using both a cylinder and a chamfer cylinder.
JoshKlint
 
Posts: 163
Joined: Sun Dec 10, 2017 8:03 pm

Re: Tires popping up on flat terrain

Postby Julio Jerez » Tue Dec 11, 2018 7:13 pm

wow, look better that I expected it was going to look.

ccd does not fixed that problem since the tire velocity never point on the direction of the force pushing it. the only way to fix that is by adding a material call back that overload the contacts and recalculate the by using a convex cast.
There is support for that in the engine but since not one ever used I do no spend time on it.
The only person I remenber ever did was Walaber.

David made a multibody vehicle that is integrated in the sand box already, also Metingplastic made his own multibody vehicle, which I am sure they both will have have same problem.
I can add the call back system to rectify the contacts and you can just pick the code and modified for your vehicle.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Tires popping up on flat terrain

Postby JoshKlint » Tue Dec 11, 2018 7:51 pm

Yes, that would be great. The vehicle is turning out pretty good.

JoshKlint
 
Posts: 163
Joined: Sun Dec 10, 2017 8:03 pm

Re: Tires popping up on flat terrain

Postby Julio Jerez » Tue Dec 11, 2018 8:06 pm

ok I will do it this Saturday. I do not have time this week days.
I am glad you decide to make your own, this way you do no have do depend on the engine for feature just for core support. with the latest change it should be good enough.

On the bright side if you pull it off you will be probable the only game engine with a multibody vehicle that does no have any special coding just straight bodies and joints and that gives you a lot of control.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Tires popping up on flat terrain

Postby Dave Gravel » Tue Dec 11, 2018 8:20 pm

Yes my implementation get the same popping problem over terrain.
I have get it work only with the raycast vehicle in my old tests.
I get a mesh edge corner problem too, the tire can stay gluted on.

In the video you can see it happening when the tire is over the stair corner.
You search a nice physics solution, if you can read this message you're at the good place :wink:
OrionX3D Projects & Demos:
https://orionx3d.sytes.net
https://www.facebook.com/dave.gravel1
https://www.youtube.com/user/EvadLevarg/videos
User avatar
Dave Gravel
 
Posts: 800
Joined: Sat Apr 01, 2006 9:31 pm
Location: Quebec in Canada.

Re: Tires popping up on flat terrain

Postby Julio Jerez » Tue Dec 11, 2018 9:08 pm

cool Now we only need Melting Plastic to post here and we have enough people to justify a fix. 8)
I already have your demo David, we can use it to add an contact overload functions.
I see what I can do,
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Tires popping up on flat terrain

Postby MeltingPlastic » Wed Dec 12, 2018 12:12 pm

I'm here - and Id love to see a fix to this! I also made a motorcycle that could desperately use this fix as well:

https://www.youtube.com/watch?v=8Zkb2HEsil4
MeltingPlastic
 
Posts: 237
Joined: Fri Feb 07, 2014 11:30 pm

Re: Tires popping up on flat terrain

Postby Julio Jerez » Wed Dec 12, 2018 5:10 pm

Wow, that bike is really cool.
The people has spoken, it shall be done.
I start fixing the problem tonight.
Is not really hard at all.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Tires popping up on flat terrain

Postby Julio Jerez » Wed Dec 12, 2018 6:34 pm

I start adding the fix, I set David Gravel vehicle demo to be the default while we are making the fix.
basically this is a simple as doing this

Code: Select all
      // setting up a use contact handle to calculate tire collision with terrain
      int defualtMaterial = NewtonMaterialGetDefaultGroupID(world);
      m_tireMaterial = NewtonMaterialCreateGroupID(world);

      NewtonMaterialSetCallbackUserData(world, m_tireMaterial, defualtMaterial, this);
      NewtonMaterialSetContactGenerationCallback(world, m_tireMaterial, defualtMaterial, OnContactGeneration);
      //NewtonMaterialSetCollisionCallback(world, m_tireMaterial, materialsList[i], OnTireAabbOverlap, OnTireContactsProcess);



what that does is that is set tire collision with any pair associate to generate the contact not be the internal collision system, but an external collision system.

in the case what we will do is that in eh callback will do a convex raycast, to get the tire contact with terrain system bodies, since this only happen with these kind of objects.

I have no implement the call back yet, I will do it tonight, there are some trick that make it work better, but I hope you get the idea.

The functionality has been there for so long and not one even use t that I am no sure it is still working, so I have to test it. at oen point I was considering removing all together.

The was how contact were calculate in the vehicle in 1.53. and was never used again.
anyway I will continues tonight.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Tires popping up on flat terrain

Postby Julio Jerez » Thu Dec 13, 2018 10:34 am

ok I added more set up for special tire collision. I extracted from the vehicle model in the engine.
Is not working fully yet. It let the tire penetation the gorung bu that's I think the I have one axis wron or I am setting the wrong penetration.

I will debug later, but for teh people who wnat to get a head tart the demos is
../applications\demosSandbox\sdkDemos\demos\BasicMultibodyVehicle.cpp

look at the call back function.
static int OnTireContactGeneration

and for the tire terrain material setup of the call back look at the constructor
VehicleControllerManagerDG::VehicleControllerManagerDG

for assigning the material to the tire shape look at funtion NewtonBody* VehicleTireCreate

all the funtionality in the low lever engine seems to be intact, so I did not have to make any chnage there.

David if you drive the car slowlling you will see the tire penetation the ground tshi si sbecause assume some vehicle param, that I nee to veryfy and one that woprking the is sopeu be fine.

My guess is the penetartion is wrong because eventually some tires stroggle to come out, so the contact part is ok, the mapping seem wrong. just nee to be debugged.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Tires popping up on flat terrain

Postby Sweenie » Thu Dec 13, 2018 11:05 am

When I saw the motorcycles it reminded me that the Gyroscopic forces you added seems to be gone now. Did you disable it? In Demo 10 in the UnityPlugin the racket doesn't align itself like it did before.
I thought the gyro effect could improve the motorcycle stability. But then I read some article that said that it isn't the gyroscopic effect that keeps a bike upright but instead something called "The Trail".
Never heard of it before, i may have slept on that lesson in school :oops:
https://sites.google.com/site/bikephysi ... -the-trail
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Tires popping up on flat terrain

Postby Julio Jerez » Thu Dec 13, 2018 11:25 am

Temporarily I have disabled for joints, I will address that next year.
It has to do with a big change in the joint system, where before the time derivative of the joint degree of greadom was calculated by the engine by assuming the pin was fixed to the second body.

For most joint this is true, but in some cases this is not the case, example is a tow hinge joint, the ping is fix to neither.
So I am planing to move that out of the low level and each joint will pass the pin angular velocity as is it was independent of the bodies.

It is a big interface change, so I place on hold for after I get the optimizations and will be the beginning of 3.15
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Tires popping up on flat terrain

Postby Julio Jerez » Thu Dec 13, 2018 11:34 am

As for that paper, thats like flat earth stuff.
There are always self appointed experts trying to invent new law of physics that are never parsimonious.
They deny gyro, coriolis, even the principle of Bernoulli forces yet they have not problem flight on an airplane.
These morons are always in the search of some anomally they or no one can understand yet to use it as weapon to reject the best ideas humanity ever had.

Gyro torques is a consequence of conservation of angular momentum, is what keeps the bike upright, it is a fact of nature, has you seen those cheap toy bikes that has a big nickel at the center?
Or has you rolled a penny? What keeps the penny upright when spinning on that crackpot brand new law of motocicle physics? Is there a law for each case, or each configuration. what does it mean that the fork on a tire is what keep the bike upright.
what keep the bike upright is quiet simple.

the bike has what is call a fix point.
fix point are point on a equation where the values are zero.
the fix point in this case be the apex what all the force pas by the center of mass of the bike.
you determine if the fix point is stable of unstable you do this test.
1 apply a small perturbation
if the total potential energy increases this is call stable equilibrium.
if the total potential energy decreases, it is call unstable equilibrium.
if is remain contact is called indifferent equilibrium.

for a ball on the ground is clear that the center of mass remain unchanged so it indifferent equilibrium.
for a bike it is clear that the center of mass will go down so the equilibrium is unstable and the bike flops.
however when the tire of a bike are speeding, each tire has an annual momentum vectors that is permenducual to the plane of the bike.
if the bike try to flop to either side, the angular momentum vector will be permutated, but a small amount, and if the toque that make the bike flops is smaller that the perturbation of the angular moment of both tire, the net change is zero.
if no different that what make a flywheel stay up when spinning. That paper is nothing but horse *.
I do not waste time anymore with this super intellectual morons.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Tires popping up on flat terrain

Postby Julio Jerez » Thu Dec 13, 2018 12:14 pm

ok I think I found one bug and I have fixed. ther may be other I have not test more.
later I will replace the flat plane for a terrain, and see if it drives

you guys can start getting the relevant pieces of code.

since you are making your one vehicle, Sweenie remind me of some tricks that are very practical when making the tires. so that the solve has to deal with less non linarities, these are all legitimate and in no way are blatant hack.
I will post them later.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Tires popping up on flat terrain

Postby JoeJ » Thu Dec 13, 2018 2:27 pm

Julio Jerez wrote:Temporarily I have disabled for joints, I will address that next year.
It has to do with a big change in the joint system, where before the time derivative of the joint degree of greadom was calculated by the engine by assuming the pin was fixed to the second body.

For most joint this is true, but in some cases this is not the case, example is a tow hinge joint, the ping is fix to neither.
So I am planing to move that out of the low level and each joint will pass the pin angular velocity as is it was independent of the bodies.

It is a big interface change, so I place on hold for after I get the optimizations and will be the beginning of 3.15


Offtopic - but this sounds very interesting to me.
I was just thinking about trying at the 'Super Joint' :mrgreen: once more.
This joint would allow motors for both rotation and arbitary translation.
Useful to make a ragdoll like the Rayman character, which has only a torso and feet but no limbs in between. This would allow me to contiunue work on walking ragdoll while avoiding the data complexity of a real human body (i don't have so much time for this now). Also it would allow a LOD system for ragdoll physics, or a hundred of walkers maybe.

Do you think this could work after the change?
So far it works only if i put the pins at the COM of both torso and foot body, and IIRC even then it becomes unstable when attaching the second foot.
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Next

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 10 guests