11-28-2006, 09:21 AM,
|
|
rookie1
Member
|
Posts: 231
Threads: 32
Joined: Nov 2006
|
|
I've committed some enhancement to the AI. Now it's able to navigate Monaco and Circuit de Pau using a G4.
Currently the biggest handicap AI has is the tire model. It's using a very much simplified version to calculate the friction force,
Friction = mu * Weight
The friction coefficient mu is taken from the track definition - treaded friction coefficient (0.9). This value seems a bit low for a car like G4, resulting a lower speed limit (hence slower) around the corner. However, it's too high for some other cars.
I'm not sure how to improve this, short of doing the full Pacejka calculation, which maybe overly complicated.
|
|
11-28-2006, 02:39 PM,
|
|
joevenzon
Administrator
|
Posts: 2,679
Threads: 52
Joined: Jun 2005
|
|
Check out:
Code: double sp = (*it)->GetTire()->GetSigmaHat(); //ideal slip ratio given tire loading
double uhat = (*it)->GetTire()->GetFx(sp); //maximum tire friction given ideal slip ratio
This should give you a better approximation than the equation you're currently using. You might want to back off of the ideal value somewhat. Also, you should take uhat and multiply it by ((1.0-tread)*friction1 + tread*friction2) where tread is the tire's tread and friction1 and friction2 are the friction coefficients for the track surface.
|
|
11-29-2006, 05:40 PM,
|
|
kcid
Member
|
Posts: 136
Threads: 8
Joined: Jan 2006
|
|
Just on a sidenote, I now get a linker error when compiling on windows in Dev cpp about AI here it is: Code: [Linker error] undefined reference to `AI::update(float, float, TRACK*)'
Nathan looked at the code and couldn't find anything wrong with it.
|
|
11-29-2006, 08:47 PM,
|
|
rookie1
Member
|
Posts: 231
Threads: 32
Joined: Nov 2006
|
|
kcid Wrote:Just on a sidenote, I now get a linker error when compiling on windows in Dev cpp about AI here it is: Code: [Linker error] undefined reference to `AI::update(float, float, TRACK*)'
Nathan looked at the code and couldn't find anything wrong with it. Can you check whether ai.h and ai.cpp are part of your dev cpp project?
|
|
11-30-2006, 01:42 AM,
|
|
rookie1
Member
|
Posts: 231
Threads: 32
Joined: Nov 2006
|
|
Commited a change to calculate friction coefficient base on Joe's suggestion. This takes into consideration individual car's tire data. So it should be better than the previous code using a fixed value for all cars.
|
|
11-30-2006, 09:07 AM,
|
|
kcid
Member
|
Posts: 136
Threads: 8
Joined: Jan 2006
|
|
Thanks rookie1 that worked, the ai.cpp and ai.h where not added to the file yet, I've uploaded a updated dev cpp project file into svn. Thankx
|
|
|