Newton 3.14 vehicle problem

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Newton 3.14 vehicle problem

Postby e3dalive » Tue Feb 16, 2016 3:26 am

there is no doubt that you've written very realistic car model, i really like it, and some people might actually already started using it, if they create their city as 1 whole mesh with no gaps, unlike me or dynamic long roads like in ETS2.
The video was just to show you in wireframe mode the gaps between meshes.
Awesome hopefully you will resolve this bug and please tell me what do i need to overwrite in engine to enable reverse?
Does the function in wheel GetRPM return rotations per minute or radians per minute?
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Newton 3.14 vehicle problem

Postby Julio Jerez » Tue Feb 16, 2016 7:44 am

e3dalive wrote:Does the function in wheel GetRPM return rotations per minute or radians per minute?

report rotations per minute.

e3dalive wrote:Awesome hopefully you will resolve this bug and please tell me what do i need to overwrite in engine to enable reverse?

oh do no worry I believe it will be it will be fixed with next check in.

I though not was should be working, I will verify, I am adding the basics car demo, that will test that functionality.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 3.14 vehicle problem

Postby e3dalive » Wed Feb 17, 2016 5:35 am

awesome, and now the final wait begins))
Also i noticed one thing, below the road i have ground, usually about 0.1-1 meters beneath it, the closer the ground to the road the less are the jumping, also in bad places where one road is intersecting another i have higher car jumps then the average one.
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Newton 3.14 vehicle problem

Postby e3dalive » Mon Feb 22, 2016 3:41 am

in your latest svn ApplyTorque function is missing in BodyPartEngine, did you change it to something? Car still jumps up between meshes
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Newton 3.14 vehicle problem

Postby Julio Jerez » Mon Feb 22, 2016 1:58 pm

Oh yes I remove that function by accident, I was making comparison with the code in 3.13 before I added that functionality for you.
Yes I know the tire still jumps, I am making some changes in the model because I realized that the are some problem with tire moving a high speed and large mass ratios, that explain many thongs, and I need to fix that first.
I am doing the stability test with a simple car, the car can only move straight, and now is better but not quite there yet, there is still something adding non linearity.
do not use it yet let my get this working first and then I add the fix for the tire jumps.

do not get code yet, give a few more day to complete what I am doing first.
because with these stability problems it will not work.
Basically I am running test when I set all variable Fix and change one to see where the source of error is coming from. In general it come from bad constraint rows not being orthogonal.
I think I found one with the tire differential, so I need to get that one stable.

Fix the Jumps is actually the eassy part of all of this.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 3.14 vehicle problem

Postby e3dalive » Thu Feb 25, 2016 9:52 am

it's nice that you are fixing it, but i think at present only jumping bug requires attention, because other that that without adding too much torque to wheels car is driving very realistically.
I also wanted to ask, you have cloth in your engine, is it possible to do something like this for a car http://www.youtube.com/watch?v=S5KCw6dm2Yk ?
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Newton 3.14 vehicle problem

Postby Julio Jerez » Thu Feb 25, 2016 10:41 am

It is more than just the jump, I think I have it fix now, but I am going over the vehicle model
there is some that is still wrong, for example I notice that is behave differently when making left turn or right turns, I underhand a small error because order in which the object are solver, but not the differences I am seem.
I think I will have a workable mode by the weekend, but I need to find these error first.

on eh deformable bodies, Yes that a plan, for newton 3.15 but it will be quiet different that how the do it, they use some that is call position base physics, which is not physics at all, so it si incompatible with how newton works.
After the car and the feature I listed, I will add a new type of bodies to newton the Rigid Particle, and I will add one a rope as a demo, then for there I will add cloth and deformable bodies, and fluids
But is all have to work with one unified solver.
That will be the focus of 3.15 for now I just want to get the car done.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 3.14 vehicle problem

Postby Julio Jerez » Thu Feb 25, 2016 10:57 am

also I believe the new fix on the vehicle make is drive even more nicely that the previous one.
I saw you video https://www.youtube.com/watch?v=jVGazeobVew

and is I very very cool, the vehicle can stay is eh road even when changing lane a high speed, and the is quite an achievement hard to get by tuning parameters. But I like to get even better than that and simpler to tune, because for most people is hard to get a sweet spot that make work lie your setting.

Believe or not there are way to code that in by adding stability derivatives. which is nothing by adding a function that record the changes of all variables by perturbing one by a small amount while keeping every think else fix, I will add something like that for auto steering
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 3.14 vehicle problem

Postby e3dalive » Mon Feb 29, 2016 12:00 pm

i saw you commiting new vehicle code is it stable and free of jumping bug or you still working on it?
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Newton 3.14 vehicle problem

Postby Julio Jerez » Mon Feb 29, 2016 1:20 pm

No that one is does not have the wheel jumping bug fixed yet.
I thought I was going to get that fix this weekend but this it is a harder problem than thought.
I can get it to work by doing something that I do no really want to, I rather fix the problem correctly,

The problem has to do with the contact being calculated by the engine rather than by the vehicle code.
if it solve by the engine, the it will made one call for each body the tire is colliding with.
and that is what is wrong. in your case you have multiple meshes, example when the tire goes across two different meshes.
when the happen the solve does now how to discriminate these two contacts because they are both correct.
The way to discriminate one is by doing a convex ray cast and before the newton update, and save the closest bodies the tire should collide with, the use those bodies as a filter fro when the vehicle need to collide.
I did that but I found out that the function convex Ray Cast is busted when dealing with non uniform scale objects, and the tire are non uniform, so I have to have that fixed first.
Once this is fixed then I believe the vehicles will be completed.

Can you get the latest code and just try the vehicle tell me what do you think about.
For my side this is the most accurate to realistic vehicle model yet, I finally fond what was wrong with the tire model, and now behaves predictable. You can see wen driving the vehicle inertia.
also you can see the vehicle slip angle followed the tire sleep angle, with is the condition for stable driving. I have no try yet steady unstable drifting (drifting) but now that eth tire model behave in tune with the physics of real tire, I believe that should be possible.
I will try tat afet I get the jump bug fixed. Should be these week. :oops:

BTW the vehicle is a rear wheel drive car, and it is quiet drivable. so that tell me we are on the right track.
According to the book, rear wheel drive car are more stable and maneuverable that front wheel drive, but as you know, almost no one can get a rear wheel drive to drive stable. I about 95% of all video games, the use four wheel drive, and even eh ones that let you select the mode, they actually cheat, and apply tire force on all wheels, by only integrate the wheel you select as drivable. the rest is jut kinematic.
Only game like Forza, and Grand tourism do a realistic simulations, but the use Lagrangian Mechanic to derive a physics models for a type of vehicle which once is created it can no be changes easily.
Some time I thought of going that route, but that model is not really suitable for a general purposes physic engine, is more for a dedicated vehicle simulator, with a different solver for different vehicle time. I want to go the other way, I want a unified solve that take care of all the dynamics.

Please try the vehicle and let me know what you think.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 3.14 vehicle problem

Postby e3dalive » Wed Mar 02, 2016 4:35 pm

hey i've uploaded the video, the ar bounciness has been reduced but sometimes it still knocks it over :D. https://youtu.be/--gPlRahmkg In order to get it to work in engine i has to add this in my update function
Code: Select all

void CNewEngine::Update(dFloat timestep, dFloat gasVal)
{
   gasVal = 0.0f;
   CustomVehicleController::BodyPartEngine::Update(timestep, gasVal);
then i do my calculations and at the end of function use ApplyTorque

What else i noticed, for the new cars the amount of torque i apply seems to give much less speed then in linear cast version, probably i need to multiply it by 2 somewhere...
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Newton 3.14 vehicle problem

Postby Julio Jerez » Wed Mar 02, 2016 5:33 pm

e3dalive wrote:hey i've uploaded the video, the ar bounciness has been reduced but sometimes it still knocks it over

yes I expected that it should happens lest but it will still happens, I am making a big change on eh collision system, because other wise is a chicken and the egg problem. to fix so that is behaves like the 3.13 car It has to be solved low level,

e3dalive wrote:What else i noticed, for the new cars the amount of torque i apply seems to give much less speed then in linear cast version, probably i need to multiply it by 2 somewhere...


yes by that is no a bad thing, in fact that a very good :mrgreen: .
what you are seeing is part of an experiment that I am trying now that the physics are all bease of realistic vehicle equations, I can try some of the design practice that are use to make vehicle stable.

In general these is call stability derivatives. Which in control theory mean find a point in which the system is stable, the apply a small perturbation to one parameter and see if the gradient is negative,
if the gradient is negative, it mean the system is stable and will recover. if is no then it mean that system unstable. check out this video series that I have being following
https://www.youtube.com/watch?v=hnsooFbJJq4
(he gives an mathematics of drifting, and now I underhand why drifting happens, so when everything is in place I should be able to do it) :mrgreen: .

for that I am fixing the gear Box so that the vehicle achieves a constant speed the I am applying the steering change to see how the vehicle behave after a small change of the steering angle.
Vehicle dynamics people call that procedure "steady state cornering", and is very important.
Basically is a method for making stable vehicle that can drive in road.
Code: Select all
void CustomVehicleController::BodyPartEngine::SetGear(int gear)
{
return;
...

this is why you can no accelerate pass the top speed of first gear.
sorry about that.
Unfortunately I have to stop to fix the collision Bug first, but tshi will be worth doing.

I also saw that I nee to [put a limit of how much the wheel can get outside their space when teleporting the body
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Newton 3.14 vehicle problem

Postby e3dalive » Mon Mar 07, 2016 2:52 am

and a week has passed on :)
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Newton 3.14 vehicle problem

Postby Sweenie » Mon Mar 07, 2016 2:57 am

e3dalive wrote:and a week has passed on :)


I'm sure private life and work has priority. Just be patient. :)
Sweenie
 
Posts: 490
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: Newton 3.14 vehicle problem

Postby Julio Jerez » Mon Mar 07, 2016 8:02 am

yes I know, like I said to fix the bump I could special case it bu writing a fix for the RayConvexCast function. but that will only extend the a problem that has being bothering me for a long time.

Before Newton 3.00 the collision system worked in global space. this is a problem because of round errors.
for Newton 3.xx I made the collision system work local in local space. this make the collision more precise but at the expense of a much more complex system, specially when using non uniform collision. I managed to get almost everything working, with the expectation of the above function for non uniform scale, but that was time consuming and very error prone.
Fixing the RayConvexCast is no trivial if all the low level support was not in place. the big problem with local space implementation is that adding any new fumtionality needs to be replicated in different way on each collision shape.
It turned out that RayConvexCast I need to fix the wheel jumping bug, basically I nee to use as a filter to decide with collision is closer to the tire. but since the tire is a non uniform scale shape, it was a big problem.
since that function is going to be use a more for planned feature, I already use for Player controller and now for the car, and will be use as a sensor for the articulated player, I decided to grab the bull by the horns and fix the problem for real. I spend the week refactoring the collision system.

I checked the code in, but now the vehicle is broken because I need to go over implement the function but I did no have time for that, I believe it is the last of the low lever function.
Do not desperate this change is for the better.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 4 guests

cron