Re: Vehicle configuration

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Vehicle configuration

Postby e3dalive » Thu Mar 19, 2015 6:23 am

that idea sounds great
even in current state your car physics already suppressed havok/bullet and probably latest PhysX vehicle, people who tested new version said it's much better then what was before.
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Vehicle configuration

Postby e3dalive » Tue Sep 29, 2015 5:26 am

few suggestions about code:
CalculateAkermanParameters (leftRearTire, rightRearTire, leftFrontTire, rightFrontTire); this must eat array, or use some internal tire array
tire->m_data could be made into old tire->GetInfo(ptr*)
problems:
there is no function GetTireRotationSpeed which would help get rotation speed of wheel for my engine calculations
missing tire-material based functions: tire->GetContactCount();tire->GetContactJoint(i); tire->GetContactBody(i);
what function in engine must i overload to supply my own torque per axle? GetNominalTorque?
it seems either i forgot the lib or you forget the declaration, because linker did't liked it:
Code: Select all
>CNWCar.obj : error LNK2019: unresolved external symbol "public: __thiscall CustomVehicleController::BodyPartEngine::BodyPartEngine(class CustomVehicleController * const,class CustomVehicleController::BodyPartEngine::Info const &)" (??0BodyPartEngine@CustomVehicleController@@QAE@QAV1@ABVInfo@01@@Z) referenced in function "public: void __thiscall CNWCar::BuildBasicCar(struct BasciCarParameters const &)" (?BuildBasicCar@CNWCar@@QAEXABUBasciCarParameters@@@Z)
2>CNWCarEngine.obj : error LNK2001: unresolved external symbol "public: __thiscall CustomVehicleController::BodyPartEngine::BodyPartEngine(class CustomVehicleController * const,class CustomVehicleController::BodyPartEngine::Info const &)" (??0BodyPartEngine@CustomVehicleController@@QAE@QAV1@ABVInfo@01@@Z)
2>CNWCarEngine.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CustomVehicleController::BodyPartEngine::~BodyPartEngine(void)" (??1BodyPartEngine@CustomVehicleController@@UAE@XZ) referenced in function __unwindfunclet$??0CNewEngine@@QAE@QAVCustomVehicleController@@ABVInfo@BodyPartEngine@1@@Z$0
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Vehicle configuration

Postby Julio Jerez » Tue Sep 29, 2015 12:41 pm

OH yes I nee to add DLL expert/import to some function I will do today.
I will also add some more missing interfaces I did not focus on that either, so it will be few iterations
until we come up to a flexible interface.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Vehicle configuration

Postby e3dalive » Thu Oct 01, 2015 6:30 am

there is also one more function missing, that is very usefull UpdateInfo for tire, it will let me do realtime car tweaking.
Your old function GetAligningTorque is missing, i remember you added that value for testing force feedback, you can bring it back later on.
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Vehicle configuration

Postby Julio Jerez » Thu Oct 01, 2015 11:07 am

yes I will add those later, let me get the edge collision bug which is the biggest right bug now.
this is difficult to ping point when is happen because the mismatch between the inputs and the update loop.

I wrote some debug code that can reproduces, but I still can no determine why this happens.
for example when I track tire for contact generation.

since I know the the floor is a texalated flat plane, all elevation should be zero. so eh cont high should be th epenetaretion tolerance, pluse at some point the numbe of contact can me mor ethan one whne going across an edge

    0 -0.002489 // one frame
    0 -0.002788 // one frame
    0 -0.003111 -0.000022 // when a across an edge
    //in this frame there was no contact because the tire jumped.
    0 -0.004266 -0.001700 // tire bounce back an penetrate one extra millimeter

the contact count is correct, I though that was the bug, that is correct.
by for some reason the tire jumps more than is need to when the are multiple contacts. and I still do no see why.
I will debug more tonight
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Vehicle configuration

Postby Julio Jerez » Thu Oct 01, 2015 1:23 pm

the other thing is the stress test, the test I did was on a very simple map, has you try the 50 or 75 vehicle that you were targeting on a complex map?
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Vehicle configuration

Postby e3dalive » Fri Oct 02, 2015 3:04 am

before i can do that i need the function UpdateInfo and GetInfo for wheel, because i need to calibrate car at runtime, and only after i can create 50 cars to test, at present my car is not stable for some reason. It would be very good if you can add update/get info style functions to breaks as well in order for me to calibrate correct amount of brake settings to stop cars. i've added dump of the scene, serialised it the same way you do demossanndbox, but for some reason it freezes demos http://109.120.172.56:27015/dep/scene.rar
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Vehicle configuration

Postby e3dalive » Wed Oct 14, 2015 6:57 am

so how are you doing on fixing car jumping bug?
e3dalive
 
Posts: 87
Joined: Thu Feb 05, 2015 5:20 am

Re: Vehicle configuration

Postby collerblade » Tue Oct 27, 2015 10:58 am

guys.
I tried the new car api. It is way better then the last one i used (1.5 years ago), now the wheels are true newton bodies, there is handbrake.... But i noticed 1 thing what i could not fix: newton bodies can only rotate a half turn on every frame. So the omega of the wheels is limited, thats why my car cannot take the second gear (automatic shift). Tire radius is 30cm witch is about normal car's tire radius. If i take that higher (for example 40cm (0.4) ), the car works correctly. I didnt tweak any other parameters, i use the same as in the SuperCar demo (except tire radius and width, and positions). Sould i lower the maximum speed? It looks it can change the crownGearRatio value (witch i dont know what is), so my rpm can go higher. Or sould i lower the rpmAtPeakHorsePower, so my car finaly can change gears.

My second note:
The viper car maximum speed is >240km/h. Still the car speed (even with 0.4m wheels) cant go above 136km/h on a flate infinite plane (in gear 6). Is that a normal behavior? (This "effect" was the same in the old code as well)

Ty collerblade
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

Re: Vehicle configuration

Postby JoeJ » Tue Oct 27, 2015 11:38 am

collerblade wrote:newton bodies can only rotate a half turn on every frame


Sounds like tedious work, but would it be possible to simulate groups of bodies at higher framerate than the rest of the world, like cars and ragdolls at 120Hz, world at 60 Hz?
User avatar
JoeJ
 
Posts: 1147
Joined: Tue Dec 21, 2010 6:18 pm

Re: Vehicle configuration

Postby collerblade » Tue Oct 27, 2015 2:37 pm

is it possibile with newton? I dont know.. but i dont think so..

Julio:
why is there a NewtonBodySetMaxRotationPerStep() call for the wheels? Is sets the wheels rotation speed to the exact limit (Pi/2). But they cant go faster anyway... why is that call neseserry?

e3dalive:
You made a high speed car with this model. What wheel radius are u using?

Ty
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

Re: Vehicle configuration

Postby Julio Jerez » Tue Oct 27, 2015 3:37 pm

collerblade wrote:Julio:
why is there a NewtonBodySetMaxRotationPerStep() call for the wheels? Is sets the wheels rotation speed to the exact limit (Pi/2). But they cant go faster anyway... why is that call neseserry?

Here is an example, say you are simulation an body in orbit using the law of gravitation.
you calculate the force and you move the body, say the force is and speed is so high that in each step the body spins a full revolution, now what for have is that teach correction force will pull the body toward the other body until the collapse.
this indicate that the is a limit as to how fast you can run a simulation until it become unstable.
if you know the case where this error can be removed for eth simulation like in the case of a spinning tire, the you can relax the condition for stability. The has to do with stability dynamics system.
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Vehicle configuration

Postby collerblade » Tue Oct 27, 2015 4:22 pm

ok TY Julio
but how about the tire problem now? witch direction do i go? do i have to incrasse the tire radius, for a normal car? That looks very stupid. A normal wheel is around 50-60cm wide (diameter), that means 30cm radius at max. What shold i do now? With parameter do i have to tune?
I tried decresse the max speed, but that made my car very powerless too.
Also tried to decrasse torque parameters, but that also went wrong. I can change them only around 10% or i will get a nice assertion fail for various reasons (for example one of these):
Code: Select all
dAssert(m_rpmAtIdleTorque > 0.0f);
dAssert(m_rpmAtIdleTorque < m_rpmAtPeakHorsePower);
dAssert(m_rpmAtPeakTorque < m_rpmAtPeakHorsePower);
dAssert(m_rpmAtPeakHorsePower < m_rpmAtReadLineTorque);
dAssert(m_idleTorque > 0.0f);
dAssert(m_peakTorque > m_peakPowerTorque);
dAssert(m_peakPowerTorque > m_redLineTorque);
dAssert(m_redLineTorque > 0.0f);
dAssert((m_peakTorque * m_rpmAtPeakTorque) < m_peakHorsePower);


Im sure there is a solution. Im waiting for e3dalive's answer.

collerblade
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

Re: Vehicle configuration

Postby Julio Jerez » Tue Oct 27, 2015 4:29 pm

can you just pass a large angle to NewtonBodySetMaxRotationPerStep()?
Julio Jerez
Moderator
Moderator
 
Posts: 11039
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Vehicle configuration

Postby collerblade » Wed Oct 28, 2015 4:55 am

can you just pass a large angle to NewtonBodySetMaxRotationPerStep()?

I tried that, but the Pi/2 limit remains. U told me this is the limit in NewtonGameDynamics..

There are 2 promlems here:

1.
I realized, that the engine body is the one which is limited. This is the shift up condition:
Code: Select all
dFloat W = omega.m_x * m_data.m_crownGearRatio;
...
if(W > m_data.m_rpmAtPeakHorsePower)
   setGear(gear+1);

The omega.m_x is limited to 90 (Pi/2*60fps), and it cant go upper than this. My m_crownGearRatio is 4.4 (for 30cm tire radius). The rpmAtPeakHorsePower is to big and the shift condition newer succeeded. It i set the tire radius to 40cm (as i told before), the m_crownGearRatio becomes 5.95 so the shift up condition is true before the omega hits the limit.
There are 2 solutions for this. Eider i incrasse the m_crownGearRatio or i decrasse the rpmAtPeakHorsePower. (or i incrasse the tire radius, which i dont want)

2.
The second problem is the car speed limit. This is also related, to omega problems. It the tire radius is 30cm, than the maximum speed is (on 60fps) Pi/2*0.3*60*3.6 ~=101km/h. This is to small. If i use 40cm wheels, the maximum speed becomes 135km/h, as i measured earlier. I dont see any solution for this problem beside incrassing tire radius...


e3dalive:
Have u faced the same limitations? Did u incrassed the tire radius? Your videos looks awesome, but i cant reproduce the same behavior.

Ty
collerblade
 
Posts: 88
Joined: Mon Apr 05, 2010 12:09 pm

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 1 guest