- update weather's datas
- update shadow's driver git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6678 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 7670b62d3a4334e53ea9b5eca41997a0b8f23c8b Former-commit-id: b29a7f61f16cffb7a05a0edfe22dfc4383522923
This commit is contained in:
parent
b632ad3aa1
commit
3232ecbaa4
5 changed files with 150 additions and 91 deletions
|
@ -44,7 +44,7 @@ CarModel::CarModel()
|
|||
TYRE_MU(0),
|
||||
TYRE_MU_F(0),
|
||||
TYRE_MU_R(0),
|
||||
MU_SCALE(0),
|
||||
MU_SCALE(0.9),
|
||||
MIN_MU_SCALE(0),
|
||||
|
||||
BRAKESCALE(0),
|
||||
|
@ -61,13 +61,17 @@ CarModel::CarModel()
|
|||
CD_BODY(0),
|
||||
CD_WING(0),
|
||||
CD_CX(0),
|
||||
KZ_SCALE(0.43f),
|
||||
|
||||
KZ_SCALE(0),
|
||||
BUMP_FACTOR(0),
|
||||
BUMP_FACTORLEFT(0),
|
||||
BUMP_FACTORRIGHT(0),
|
||||
AVOID_MU_SCALE(0.9),
|
||||
|
||||
lftOH(0),
|
||||
rgtOH(0),
|
||||
AVOID_KZ_SCALE(0.43f),
|
||||
WIDTH(2),
|
||||
BRAKE_FACTOR(1),
|
||||
CT_FACTOR(1),
|
||||
|
||||
HASTYC(false),
|
||||
TYRECONDITIONFRONT(0),
|
||||
TYRECONDITIONREAR(0)
|
||||
|
@ -148,7 +152,7 @@ double CarModel::CalcMaxSpeed(double k, double k1, double kz, double kFriction,
|
|||
}
|
||||
else
|
||||
{
|
||||
Mu = MIN(MuF, MuR); // oTmpCarParam->oSkill;
|
||||
Mu = MIN(MuF, MuR);
|
||||
LogSHADOW.debug("MU = %.f\n", Mu);
|
||||
}
|
||||
|
||||
|
@ -168,69 +172,9 @@ double CarModel::CalcMaxSpeed(double k, double k1, double kz, double kFriction,
|
|||
}
|
||||
|
||||
double Speed = factor * sqrt((Cos * GRAVITY * Mu + Sin * GRAVITY * SGN(k) + kz) / Den);
|
||||
/*if (oDriver->CarCharacteristic.IsValidX(Speed))
|
||||
Speed *= oDriver->CarCharacteristic.CalcOffset(Speed);*/
|
||||
|
||||
//Speed = oDriver->CalcHairpin(Speed,AbsCrv);
|
||||
LogSHADOW.debug("CarModel CalcMaxSpeed = %.f\n", Speed);
|
||||
|
||||
return Speed;
|
||||
/*
|
||||
double M = MASS + FUEL;
|
||||
|
||||
double mua, muf, mur;
|
||||
|
||||
if( AERO == 1 )
|
||||
{
|
||||
double MU_F = kFriction * TYRE_MU_F;
|
||||
double MU_R = kFriction * TYRE_MU_R;
|
||||
|
||||
muf = MU_F * MU_SCALE;
|
||||
mur = MU_R * MU_SCALE;
|
||||
mua = (MU_F + MU_R) * 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
double MU = kFriction * TYRE_MU;
|
||||
|
||||
mua = MU * MU_SCALE;// * 0.975;
|
||||
}
|
||||
|
||||
double cs = cos(RollAngle);
|
||||
double sn = sin(RollAngle);
|
||||
|
||||
double absK = MX(0.001, fabs(k));
|
||||
double sgnK = SGN(k);
|
||||
|
||||
double num, den;
|
||||
|
||||
if( AERO == 1 )
|
||||
{
|
||||
num = M * (cs * GRAVITY * mua + sn * G * sgnK);
|
||||
den = M * (absK - KZ_SCALE * kz) - (CA_FW * muf + CA_RW * mur + CA_GE * mua);
|
||||
}
|
||||
else
|
||||
{
|
||||
// num = M * (G * mu + sn * G * sgnK);
|
||||
num = M * (cs * G * mua + sn * G * sgnK);
|
||||
// den = M * (absK - 0.00 * kz) - CA * mu_df;
|
||||
// den = M * (absK - 0.10 * kz) - CA * mu_df;
|
||||
// den = M * (absK - 0.20 * kz) - CA * mu_df;
|
||||
// den = M * (absK - 0.25 * kz) - CA * mu_df;
|
||||
// den = M * (absK - 0.29 * kz) - CA * mu_df;
|
||||
// den = M * (absK - 0.33 * kz) - CA * mu_df;
|
||||
// den = M * (absK - 0.42 * kz) - CA * mu_df;
|
||||
den = M * (absK - KZ_SCALE * kz) - CA * mua;
|
||||
}
|
||||
|
||||
if( den < 0.00001 )
|
||||
den = 0.00001;
|
||||
|
||||
double spd = sqrt(num / den);
|
||||
|
||||
if( spd > 200 )
|
||||
spd = 200;
|
||||
|
||||
return spd;*/
|
||||
}
|
||||
|
||||
double CarModel::CalcBreaking(double k0, double kz0, double k1, double kz1, double spd1, double dist, double kFriction, double RollAngle , double TiltAngle) const
|
||||
|
@ -385,7 +329,8 @@ double CarModel::CalcAcceleration(double k0, double kz0, double k1, double kz1,
|
|||
// 3m/ss @ 60m/s
|
||||
// 1m/ss @ 75m/s
|
||||
// 0m/ss @ 85m/s
|
||||
Quadratic accFromSpd(0.001852, -0.35, 17.7); // approx. clkdtm
|
||||
//Quadratic accFromSpd(0.001852, -0.35, 17.7); // approx. clkdtm
|
||||
Quadratic accFromSpd(21.0/5400, -43.0/60, 30); // approx. clkdtm
|
||||
double OldV = 0.0;
|
||||
// Power (kW) = Torque (Nm) x Speed (RPM) / 9.5488
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// my own planet ...
|
||||
#define GRAVITY 9.81
|
||||
|
||||
class CarModel
|
||||
class CarModel
|
||||
{
|
||||
public:
|
||||
CarModel();
|
||||
|
@ -33,7 +33,7 @@ public:
|
|||
double CalcMaxSpdK() const;
|
||||
double CalcMaxLateralF(double spd, double kFriction , double kz = 0.0) const;
|
||||
|
||||
double CalcMaxSpeedCrv() const;
|
||||
double CalcMaxSpeedCrv() const;
|
||||
|
||||
void CalcSimuSpeeds( double spd0, double dy, double dist, double kFriction, double& minSpd, double& maxSpd ) const;
|
||||
void CalcSimuSpeedRanges( double spd0, double dist, double kFriction, double& minSpd, double& maxSpd, double& maxDY ) const;
|
||||
|
@ -70,12 +70,19 @@ public:
|
|||
double CD_CX;
|
||||
double KZ_SCALE; // bump sensitivity.
|
||||
double BUMP_FACTOR; // bump sensitivity factor.
|
||||
double BUMP_FACTORLEFT;
|
||||
double BUMP_FACTORRIGHT;
|
||||
double WIDTH; // width of car (m).
|
||||
bool HASTYC;
|
||||
double TYRECONDITIONFRONT;
|
||||
double TYRECONDITIONREAR;
|
||||
double BUMP_FACTORLEFT;
|
||||
double BUMP_FACTORRIGHT;
|
||||
double AVOID_MU_SCALE; // scaling of MU to use for this car.
|
||||
double lftOH;
|
||||
double rgtOH;
|
||||
double AVOID_KZ_SCALE; // bump sensitivity.
|
||||
double WIDTH; // width of car (m).
|
||||
double BRAKE_FACTOR; // higher number = slower braking
|
||||
double CT_FACTOR;
|
||||
|
||||
bool HASTYC;
|
||||
double TYRECONDITIONFRONT;
|
||||
double TYRECONDITIONREAR;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -444,6 +444,10 @@ void TDriver::InitTrack( tTrack* pTrack, void* pCarHandle, void** ppCarParmHandl
|
|||
m_cm.NEEDSINLONG = (GfParmGetNum(hCarParm, SECT_PRIV, PRV_NEED_SIN, NULL, 0) != 0);
|
||||
m_cm.USEDACCEXIT = (GfParmGetNum(hCarParm, SECT_PRIV, PRV_USED_ACC, NULL, 0) != 0);
|
||||
m_cm.BRAKESCALE = GfParmGetNum(hCarParm, SECT_PRIV, PRV_BRAKESCALE, NULL, 1.0);
|
||||
m_cm.AVOID_MU_SCALE = GfParmGetNum(hCarParm, SECT_PRIV, PRV_AVOID_MU_SCALE, NULL, 0.9f);
|
||||
m_cm.AVOID_KZ_SCALE = GfParmGetNum(hCarParm, SECT_PRIV, PRV_AVOID_KZ_SCALE, NULL, 0.43f);
|
||||
m_cm.BRAKE_FACTOR = GfParmGetNum(hCarParm, SECT_PRIV, PRV_BRAKE_FACTOR, NULL, 1.00f);
|
||||
m_cm.CT_FACTOR = GfParmGetNum(hCarParm, SECT_PRIV, PRV_CTFACTOR, NULL, 1.00f);
|
||||
|
||||
FACTORS.RemoveAll();
|
||||
|
||||
|
@ -468,13 +472,45 @@ void TDriver::InitTrack( tTrack* pTrack, void* pCarHandle, void** ppCarParmHandl
|
|||
SPDC_TRAFFIC = int(GfParmGetNum(hCarParm, SECT_PRIV, PRV_SPDC_TRAFFIC, 0, 2));
|
||||
SPDC_EXTRA = int(GfParmGetNum(hCarParm, SECT_PRIV, PRV_SPDC_EXTRA, 0, 3));
|
||||
STEER_CTRL = int(GfParmGetNum(hCarParm, SECT_PRIV, PRV_STEER_CTRL, 0, 0));
|
||||
AVOID_WIDTH = GfParmGetNum(hCarParm, SECT_PRIV, PRV_AVOID_WIDTH, 0, 0.5);
|
||||
AVOID_WIDTH = GfParmGetNum(hCarParm, SECT_PRIV, PRV_AVOID_WIDTH, 0, 0.5f);
|
||||
STAY_TOGETHER = GfParmGetNum(hCarParm, SECT_PRIV, PRV_STAY_TOGETHER, 0, 0);
|
||||
STEER_K_ACC = GfParmGetNum(hCarParm, SECT_PRIV, PRV_STEER_K_ACC, 0, 0);
|
||||
STEER_K_DEC = GfParmGetNum(hCarParm, SECT_PRIV, PRV_STEER_K_DEC, 0, 0);
|
||||
PIT_START_OFFSET = GfParmGetNum(hCarParm, SECT_PRIV, PRV_PIT_START_OFFS, 0, 0);
|
||||
PIT_STOP_OFFSET = GfParmGetNum(hCarParm, SECT_PRIV, PRV_PIT_STOP_OFFS, 0, 0);
|
||||
PIT_ENTRY_OFFSET = GfParmGetNum(hCarParm, SECT_PRIV, PRV_PIT_ENTRY_OFFS, 0, 0);
|
||||
PIT_EXIT_OFFSET = GfParmGetNum(hCarParm, SECT_PRIV, PRV_PIT_EXIT_OFFS, 0, 0);
|
||||
|
||||
STEERCONTROL = int(GfParmGetNum(hCarParm, SECT_PRIV, PRV_STEER_CONTROL, 0, 2));
|
||||
STEERCONTROL = MX(0, MN(4, STEERCONTROL));
|
||||
STEERCONTROL_AVOID = int(GfParmGetNum(hCarParm, SECT_PRIV, PRV_STEER_CONTROL_AV, 0, STEERCONTROL));
|
||||
STEERCONTROL_AVOID = MX(0, MN(4, STEERCONTROL_AVOID));
|
||||
STEERCONTROL_RECOVERY = int(GfParmGetNum(hCarParm, SECT_PRIV, PRV_STEER_CONTROL_RE, 0, 0));
|
||||
STEERCONTROL_RECOVERY = MX(0, MN(4, STEERCONTROL_RECOVERY));
|
||||
MAXCATCHTIME = GfParmGetNum(hCarParm, SECT_PRIV, PRV_MAXCATCHTIME, 0, 99);
|
||||
ACCSTEERLOOKAHEAD = GfParmGetNum(hCarParm, SECT_PRIV, PRV_ACCSTEERLOOKAHEAD, 0, 0.00f);
|
||||
DECSTEERLOOKAHEAD = GfParmGetNum(hCarParm, SECT_PRIV, PRV_DECSTEERLOOKAHEAD, 0, 0.10f);
|
||||
STEERLOOKAHEAD = GfParmGetNum(hCarParm, SECT_PRIV, PRV_STEERLOOKAHEAD, 0, 0.02f);
|
||||
STEERSMOOTHFACTOR = GfParmGetNum(hCarParm, SECT_PRIV, PRV_STEERSMOOTHFACTOR, 0, 1.0f);
|
||||
SKIDFACTOR = GfParmGetNum(hCarParm, SECT_PRIV, PRV_SKIDFACTOR, 0, 0.4f);
|
||||
SKIDFACTOR_TRAFFIC = GfParmGetNum(hCarParm, SECT_PRIV, PRV_SKIDFACTOR_TRAFFIC, 0, 0.6f);
|
||||
MAX_DAMAGE = (int)GfParmGetNum(hCarParm, SECT_PRIV, PRV_MAX_DAMAGE, 0, 5000);
|
||||
PIT_TEST = (int)GfParmGetNum(hCarParm, SECT_PRIV, PRV_PIT_TEST, 0, 0);
|
||||
TWDIST = GfParmGetNum(hCarParm, SECT_PRIV, PRV_TWB4D, 0, -1000.0f);
|
||||
INITIAL_FUEL = GfParmGetNum(hCarParm, SECT_PRIV, PRV_INITIAL_FUEL, 0, -1);
|
||||
m_coastAccel = GfParmGetNum(hCarParm, SECT_PRIV, PRV_COAST_ACCEL, NULL, 0.1f);
|
||||
AVOID_SCALE = GfParmGetNum(hCarParm, SECT_PRIV, PRV_AVOID_SCALE, NULL, 1.0f);
|
||||
STOPUPDATEDIST = GfParmGetNum(hCarParm, SECT_PRIV, PRV_STOP_UPDATE_DIST, NULL, 500.0f);
|
||||
LASTUPDATEDIST = GfParmGetNum(hCarParm, SECT_PRIV, PRV_LAST_UPDATE_DIST, NULL, -1.0f);
|
||||
RESUMEUPDATEDIST = GfParmGetNum(hCarParm, SECT_PRIV, PRV_RESUME_UPDATE_DIST, NULL, -1.0f);
|
||||
FACTORVARIANT = (int)GfParmGetNum(hCarParm, SECT_PRIV, PRV_FACTORVARIANT, NULL, 0.0f);
|
||||
STEERYAWFACTOR = GfParmGetNum(hCarParm, SECT_PRIV, PRV_STEER_YAW_FACTOR, NULL, 0.08f);
|
||||
STEERAVGKMOD = (int)GfParmGetNum(hCarParm, SECT_PRIV, PRV_STEER_AVGK_MOD, NULL, 0.0f);
|
||||
AEROBOOSTFACTOR = GfParmGetNum(hCarParm, SECT_PRIV, PRV_AERO_BOOST_FACTOR, NULL, 1.00f);
|
||||
OVERTAKE_SPEED = GfParmGetNum(hCarParm, SECT_PRIV, PRV_OVERTAKE_SPD, NULL, 2.00f);
|
||||
|
||||
AVOID_SCALE = MX(0.0, MN(1.0, AVOID_SCALE));
|
||||
|
||||
m_ClutchDelta = GfParmGetNum(hCarParm, SECT_PRIV, PRV_CLUTCH_DELTA,0,(float)m_ClutchDelta);
|
||||
LogSHADOW.debug("#m_ClutchDelta %g\n", m_ClutchDelta);
|
||||
|
||||
|
@ -490,19 +526,19 @@ void TDriver::InitTrack( tTrack* pTrack, void* pCarHandle, void** ppCarParmHandl
|
|||
m_Shift = GfParmGetNum(hCarParm, SECT_PRIV, PRV_SHIFT, 0, (float)m_Shift);
|
||||
LogSHADOW.debug("#m_Shift %g\n",m_Shift);
|
||||
|
||||
m_TclSlip = GfParmGetNum(hCarParm, SECT_PRIV, PRV_TCL_SLIP, 0, m_TclSlip);
|
||||
m_TclSlip = GfParmGetNum(hCarParm, SECT_PRIV, PRV_TCL_SLIP, 0, 2.0);
|
||||
LogSHADOW.debug("#m_TclSlip %g\n",m_TclSlip);
|
||||
|
||||
m_TclRange = GfParmGetNum(hCarParm, SECT_PRIV, PRV_TCL_RANGE, 0, m_TclRange);
|
||||
m_TclRange = GfParmGetNum(hCarParm, SECT_PRIV, PRV_TCL_RANGE, 0, 8.0);
|
||||
LogSHADOW.debug("#m_TclRange %g\n",m_TclRange);
|
||||
|
||||
m_TclFactor = GfParmGetNum(hCarParm, SECT_PRIV, PRV_TCL_FACTOR, 0, m_TclFactor);
|
||||
LogSHADOW.debug("#m_TclFactor %g\n",m_TclFactor);
|
||||
|
||||
m_AbsSlip = GfParmGetNum(hCarParm, SECT_PRIV, PRV_ABS_SLIP, 0, m_AbsSlip);
|
||||
m_AbsSlip = GfParmGetNum(hCarParm, SECT_PRIV, PRV_ABS_SLIP, 0, 3.0);
|
||||
LogSHADOW.debug("#m_AbsSlip %g\n",m_AbsSlip);
|
||||
|
||||
m_AbsRange = GfParmGetNum(hCarParm, SECT_PRIV, PRV_ABS_RANGE, 0, m_AbsRange);
|
||||
m_AbsRange = GfParmGetNum(hCarParm, SECT_PRIV, PRV_ABS_RANGE, 0, 5.0);
|
||||
LogSHADOW.debug("#m_AbsRange %g\n",m_AbsRange);
|
||||
|
||||
m_DeltaAccel = GfParmGetNum(hCarParm, SECT_PRIV, PRV_ACCEL_DELTA , 0, (float)m_DeltaAccel);
|
||||
|
@ -510,10 +546,6 @@ void TDriver::InitTrack( tTrack* pTrack, void* pCarHandle, void** ppCarParmHandl
|
|||
LogSHADOW.debug("FLY_HEIGHT %g\n", FLY_HEIGHT );
|
||||
LogSHADOW.debug( "BUMP_MOD %d\n", BUMP_MOD );
|
||||
|
||||
/*m_TclSlip = GfParmGetNum(hCarParm, SECT_PRIV, PRV_TCL_SLIP , 0, (float)m_TclSlip);
|
||||
m_TclRange = GfParmGetNum(hCarParm, SECT_PRIV, PRV_TCL_RANGE , 0, (float)m_TclRange);
|
||||
m_AbsSlip = GfParmGetNum(hCarParm, SECT_PRIV, PRV_ABS_SLIP , 0, (float)m_AbsSlip);
|
||||
m_AbsRange = GfParmGetNum(hCarParm, SECT_PRIV, PRV_ABS_RANGE , 0, (float)m_AbsRange);*/
|
||||
LogSHADOW.debug( "#Car TCL SLIP = %g - TCL RANGE = %g - ABS SLIP = %g - ABS RANGE = %g\n", m_TclSlip, m_TclRange, m_AbsSlip, m_AbsRange );
|
||||
|
||||
AdjustBrakes(hCarParm);
|
||||
|
|
|
@ -42,8 +42,10 @@
|
|||
#include "teammanager.h"
|
||||
|
||||
#define SECT_PRIV "private"
|
||||
#define PRV_GEAR_UP_RPM "gear up rpm"
|
||||
#define PRV_SHIFT "shift"
|
||||
#define PRV_MU_SCALE "mu scale"
|
||||
#define PRV_AVOID_MU_SCALE "avoid mu scale"
|
||||
#define PRV_RAIN_MU "mu scale rain"
|
||||
#define PRV_ACCEL_DELTA "accel delta"
|
||||
#define PRV_ACCEL_DELTA_RAIN "accel delta rain"
|
||||
|
@ -51,10 +53,21 @@
|
|||
#define PRV_BRAKEFORCE "brake force"
|
||||
#define PRV_FLY_HEIGHT "fly height"
|
||||
#define PRV_FACTOR "factor"
|
||||
#define PRV_FACTOR0 "factor 0"
|
||||
#define PRV_FACTORVARIANT "factor variant"
|
||||
#define PRV_AERO_BOOST_FACTOR "aero boost"
|
||||
#define PRV_AERO_MOD "aero mod"
|
||||
#define PRV_BUMP_MOD "bump mod"
|
||||
#define PRV_SIDE_MOD "side mod"
|
||||
#define PRV_RL_RIGHT_MARGIN "rl right margin"
|
||||
#define PRV_RL_LEFT_MARGIN "rl left margin"
|
||||
#define PRV_RIGHT_MARGIN "right margin"
|
||||
#define PRV_LEFT_MARGIN "left margin"
|
||||
#define PRV_MAX_SPEED "max speed"
|
||||
#define PRV_AVOID_KZ_SCALE "avoid kz scale"
|
||||
#define PRV_KZ_SCALE "kz scale"
|
||||
#define PRV_AVOID_BRAKE_FACTOR "avoid brake factor"
|
||||
#define PRV_AVOID_WIDTH "avoid width"
|
||||
#define PRV_BUMP_FACTOR "bump factor"
|
||||
#define PRV_BUMP_FACTOR_LEFT "bump factor left"
|
||||
#define PRV_BUMP_FACTOR_RIGHT "bump factor right"
|
||||
|
@ -69,18 +82,39 @@
|
|||
#define PRV_SPDC_TRAFFIC "spd ctrl traffic"
|
||||
#define PRV_SPDC_EXTRA "spd ctrl extra"
|
||||
#define PRV_STEER_CTRL "steer ctrl"
|
||||
#define PRV_STEER_CONTROL "steer control"
|
||||
#define PRV_STEER_CONTROL_AV "steer control avoid"
|
||||
#define PRV_STEER_CONTROL_RE "steer control recovery"
|
||||
#define PRV_STEER_YAW_FACTOR "steer yaw factor"
|
||||
#define PRV_STEER_AVGK_MOD "steer avgk mod"
|
||||
#define PRV_STAY_TOGETHER "stay together"
|
||||
#define PRV_PIT_ENTRY_OFFS "pit entry offset"
|
||||
#define PRV_PIT_EXIT_OFFS "pit exit offset"
|
||||
#define PRV_PIT_START_OFFS "pit start offset"
|
||||
#define PRV_PIT_STOP_OFFS "pit stop offset"
|
||||
#define PRV_PIT_START_OVERRIDE "pit start override"
|
||||
#define PRV_PIT_EXIT_OVERRIDE "pit exit override"
|
||||
#define PRV_PIT_TEST "pit test"
|
||||
#define PRV_MAXCATCHTIME "max catch time"
|
||||
#define PRV_ACCSTEERLOOKAHEAD "accel steer lookahead factor"
|
||||
#define PRV_DECSTEERLOOKAHEAD "brake steer lookahead factor"
|
||||
#define PRV_SKIDFACTOR "steer skid factor"
|
||||
#define PRV_SKIDFACTOR_TRAFFIC "steer skid factor traffic"
|
||||
#define PRV_STEERLOOKAHEAD "steer lookahead"
|
||||
#define PRV_STEERSMOOTHFACTOR "steer smooth factor"
|
||||
#define PRV_STAY_TOGETHER "stay together"
|
||||
#define PRV_PITSTRAT "pitstrat"
|
||||
#define PRV_PITSTOP "chkpitstop"
|
||||
#define PRV_CHKQUALIF "chkqualiftime"
|
||||
#define PRV_PIT_ENTRY_OFFS "pit entry offset"
|
||||
#define PRV_PIT_EXIT_OFFS "pit exit offset"
|
||||
#define PRV_MAX_BRAKING "max braking"
|
||||
#define PRV_FUELPERMETERS "fuel per meters"
|
||||
#define PRV_FUELPERLAPS "fuel per lap"
|
||||
#define PRV_RESERVE "reserve"
|
||||
#define PRV_DAMAGE "damage"
|
||||
#define PRV_MAX_DAMAGE "max damage"
|
||||
#define PRV_FULL_FUEL "full fuel"
|
||||
#define PRV_INITIAL_FUEL "initial fuel"
|
||||
#define PRV_TWB4D "tw factor"
|
||||
#define PRV_VERBOSE "strategyverbose"
|
||||
#define PRV_NEED_SIN "use sin long"
|
||||
#define PRV_USED_ACC "acc exit"
|
||||
|
@ -95,16 +129,24 @@
|
|||
#define PRV_TCL_FACTOR "tcl factor"
|
||||
#define PRV_ABS_SLIP "abs slip"
|
||||
#define PRV_ABS_RANGE "abs range"
|
||||
#define PRV_COAST_ACCEL "coast accel"
|
||||
#define PRV_AVOID_SCALE "avoid scale"
|
||||
#define PRV_STOP_UPDATE_DIST "stop update dist"
|
||||
#define PRV_RESUME_UPDATE_DIST "resume update dist"
|
||||
#define PRV_LAST_UPDATE_DIST "last update dist"
|
||||
#define PRV_OVERTAKE_SPD "overtake speed"
|
||||
#define PRV_BRAKE_FACTOR "brake factor"
|
||||
#define PRV_CTFACTOR "ctfactor"
|
||||
|
||||
#define NBR_BRAKECOEFF 50 // Number of brake coeffs
|
||||
|
||||
const double SPD_MIN = 0;
|
||||
const double SPD_MAX = 120;
|
||||
const int SPD_N = 20;
|
||||
const int SPD_N = 20;
|
||||
const double SPD_STEP = (SPD_MAX - SPD_MIN) / SPD_N;
|
||||
const double K_MIN = -0.1;
|
||||
const double K_MAX = 0.1;
|
||||
const int K_N = 100;
|
||||
const int K_N = 100;
|
||||
const double K_STEP = (K_MAX - K_MIN) / K_N;
|
||||
|
||||
// The "SHADOW" logger instance.
|
||||
|
@ -342,10 +384,39 @@ private:
|
|||
int STEER_CTRL;
|
||||
double STEER_K_ACC;
|
||||
double STEER_K_DEC;
|
||||
double OVERTAKE_SPEED;
|
||||
double STAY_TOGETHER; // dist in m.
|
||||
double AVOID_WIDTH; // in m.
|
||||
double PIT_STOP_OFFSET; // dist in m.
|
||||
double PIT_START_OFFSET; // dist in m.
|
||||
double PIT_ENTRY_OFFSET; // dist in m.
|
||||
double PIT_EXIT_OFFSET; // dist in m.
|
||||
double MAXCATCHTIME;
|
||||
double ACCSTEERLOOKAHEAD;
|
||||
double DECSTEERLOOKAHEAD;
|
||||
double STEERLOOKAHEAD;
|
||||
double STEERSMOOTHFACTOR;
|
||||
double SKIDFACTOR;
|
||||
double SKIDFACTOR_TRAFFIC;
|
||||
double INITIAL_FUEL;
|
||||
int MAX_DAMAGE;
|
||||
int PIT_TEST;
|
||||
int FACTORVARIANT;
|
||||
double STEERYAWFACTOR;
|
||||
int STEERAVGKMOD;
|
||||
double AEROBOOSTFACTOR;
|
||||
double STOPUPDATEDIST;
|
||||
double LASTUPDATEDIST;
|
||||
double RESUMEUPDATEDIST;
|
||||
double AEROCOLDFACTOR;
|
||||
double AEROFULLFACTOR;
|
||||
double AEROEMPTYFACTOR;
|
||||
double BRAKE_FACTOR;
|
||||
double AVOID_SCALE;
|
||||
int STEERCONTROL;
|
||||
int STEERCONTROL_AVOID;
|
||||
int STEERCONTROL_RECOVERY;
|
||||
double TWDIST;
|
||||
|
||||
tSituation *m_Situation; // situation
|
||||
int m_driveType;
|
||||
|
@ -374,8 +445,8 @@ private:
|
|||
double m_TclRange; // TCL range
|
||||
double m_TclSlip; // Max TCL slip
|
||||
double m_TclFactor; // TCL scale
|
||||
float m_AbsSlip;
|
||||
float m_AbsRange;
|
||||
double m_AbsSlip;
|
||||
double m_AbsRange;
|
||||
|
||||
double m_DriftAngle; // Drifting angle
|
||||
double m_AbsDriftAngle; // fabs(Drifting angle)
|
||||
|
@ -387,6 +458,7 @@ private:
|
|||
double m_ClutchDelta;
|
||||
double m_ClutchRange;
|
||||
double m_ClutchRelease;
|
||||
double m_coastAccel;
|
||||
|
||||
double suspHeight;
|
||||
|
||||
|
|
|
@ -420,6 +420,9 @@ void LinePath::PropagateBreaking( int start, int len, const CarModel& cm, int st
|
|||
|
||||
double trackRollAngle = atan2(m_pPath[i].Norm().z, 1);
|
||||
double trackTiltAngle = 1.1 * atan2(delta.z, dist);
|
||||
double brakeFactor = -1;
|
||||
double kz = -1, mu = -1;
|
||||
|
||||
double u = cm.CalcBreaking( m_pPath[i].k, m_pPath[i].kz, m_pPath[j].k, m_pPath[j].kz, m_pPath[j].spd, dist, m_pTrack->GetFriction(i, m_pPath[i].offs),
|
||||
trackRollAngle, trackTiltAngle);
|
||||
|
||||
|
|
Loading…
Reference in a new issue