git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@727 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: c17cacb31203dca272c14a2ad027ec84051d1e25
Former-commit-id: 0b684725a7c997bef2bc6af955641b6e364cfb3b
This commit is contained in:
wdbee 2009-02-08 19:31:34 +00:00
parent 82ee054b90
commit 6debe1ecd9
8 changed files with 50 additions and 29 deletions

View file

@ -12,6 +12,17 @@
<!DOCTYPE params SYSTEM "../../../src/libs/tgf/params.dtd">
<params name="" type="template" mode="mw">
<section name="simplix private">
<attnum name="avoid width" min="0.0" max="3.0" val="0.0"/>
<attnum name="border outer" min="0.0" max="3.0" val="0.0"/>
<attnum name="bump mode" min="0" max="2" val="0"/>
<attnum name="scale_brake" min="0.1" max="2.0" val="0.90"/>
<attnum name="scale_mu" min="0.1" max="2.0" val="1.00"/>
<attnum name="scale bump" min="0" max="1" val="0.01"/>
<attnum name="scale bump outer" min="0" max="2" val="0.01"/>
<attnum name="lookaheadfactor" min="0.0" max="0.5" val="0.25"/>
<attnum name="speed limit base" min="0.01" max="1.0" val="0.025"/>
<attnum name="speed limit scale" min="0.01" max="1.0" val="8"/>
<attnum name="scale min mu" min="0.1" max="1.0" val="0.7"/>
<attnum name="pit use first" min="0" max="1" val="1"/>
<attnum name="pit use smooth" min="0" max="1" val="1"/>
<attnum name="pitlane entry offset" min="-10" max="10" val="2.0"/>

View file

@ -2,8 +2,8 @@
<!--
file : g-track-3.xml
created : 28 Mar 2008
last modified : 21 Nov 2008
copyright : (C) 2008 Wolf-Dieter Beelitz
last modified : 08 Feb 2009
copyright : (C) 2008-2009 Wolf-Dieter Beelitz
-->
<!-- This program is free software; you can redistribute it and/or modify -->
<!-- it under the terms of the GNU General Public License as published by -->
@ -12,6 +12,9 @@
<!DOCTYPE params SYSTEM "../../../src/libs/tgf/params.dtd">
<params name="" type="template" mode="mw">
<section name="simplix private">
<attnum name="avoid width" min="0.0" max="3.0" val="0.25"/>
<attnum name="border outer" min="0.0" max="3.0" val="1.25"/>
<attnum name="lookaheadfactor" min="0.0" max="0.5" val="0.25"/>
<attnum name="pit use first" min="0" max="1" val="1"/>
<attnum name="pit use smooth" min="0" max="1" val="1"/>
<attnum name="pitlane entry offset" min="-10" max="10" val="3.0"/>

View file

@ -9,8 +9,8 @@
//
// File : unitclothoid.cpp
// Created : 2007.11.25
// Last changed : 2008.12.21
// Copyright : © 2007-2008 Wolf-Dieter Beelitz
// Last changed : 2009.02.08
// Copyright : © 2007-2009 Wolf-Dieter Beelitz
// eMail : wdb@wdbee.de
// Version : 2.00.000
//--------------------------------------------------------------------------*
@ -115,10 +115,11 @@ void TClothoidLane::MakeSmoothPath(
//GfOut("Step: %d\n",Step);
for (int I = 0; I < L; I++)
{
OptimisePath(Step, Delta, 0 /*, Opts.Smooth*/);
OptimisePath(Step, Delta, 0);
}
Step >>= 1;
}
if (Opts.BumpMod)
{
//GfOut("AnalyseBumps:\n");
@ -132,7 +133,7 @@ void TClothoidLane::MakeSmoothPath(
//GfOut("Step: %d\n",Step);
for (int I = 0; I < L; I++)
{
OptimisePath(Step, Delta, Opts.BumpMod /*, Opts.Smooth*/);
OptimisePath(Step, Delta, Opts.BumpMod);
CalcCurvaturesZ();
CalcFwdAbsCrv(FwdRange);
CalcMaxSpeeds(Step);

View file

@ -7,8 +7,8 @@
//
// Datei : unitclothoid.h
// Erstellt : 2007.11.17
// Stand : 2008.12.19
// Copyright: © 2007-2008 Wolf-Dieter Beelitz
// Last changed : 2009.02.08
// Copyright: © 2007-2009 Wolf-Dieter Beelitz
// eMail : wdb@wdbee.de
// Version : 2.00.000
//--------------------------------------------------------------------------*
@ -106,7 +106,7 @@ class TClothoidLane : public TLane
/* const TParam& Param, */
const TOptions& Opts);
bool SaveToFile(const char* Filename); // Save to file
bool SaveToFile(const char* Filename); // Save to file
void SavePointsToFile(const char* TrackLoad);
bool LoadPointsFromFile(const char* TrackLoad);

View file

@ -298,7 +298,8 @@ TDriver::TDriver(int Index):
oSpeedScale(0.0),
oTreatTeamMateAsLapper(false),
oTeamEnabled(true),
oCarsPerPit(1)
oCarsPerPit(1),
oBumpMode(1)
{
// GfOut("#TDriver::TDriver() >>>\n");
int I;
@ -534,6 +535,8 @@ void TDriver::InitTrack
snprintf(Buf,sizeof(Buf),"%s/tracks/%s.xml",
BaseParamPath,oTrackName);
Handle = TUtils::MergeParamFile(Handle,Buf);
double ScaleBrake = GfParmGetNum(Handle,TDriver::SECT_PRIV,PRV_SCALE__BRAKE,NULL,1.0f);
double ScaleMu = GfParmGetNum(Handle,TDriver::SECT_PRIV,PRV_SCALE__MU,NULL,1.0f);
// Override params for car type with params of track
snprintf(Buf,sizeof(Buf),"%s/%s/%s.xml",
@ -652,10 +655,12 @@ void TDriver::InitTrack
// ... Adjust pitting
// Adjust driving ...
Param.oCarParam.oScaleBrake =
Param.oCarParam.oScaleBrake = ScaleBrake *
GfParmGetNum(Handle,TDriver::SECT_PRIV,PRV_SCALE_BRAKE,NULL,0.85f);
GfOut("#Scale Brake: %g\n",Param.oCarParam.oScaleBrake);
oBumpMode =
GfParmGetNum(Handle,TDriver::SECT_PRIV,PRV_BUMP_MODE,NULL,oBumpMode);
Param.oCarParam.oScaleBump =
GfParmGetNum(Handle,TDriver::SECT_PRIV,PRV_SCALE_BUMP,NULL,Param.oCarParam.oScaleBump);
Param.oCarParam.oScaleBumpLeft =
@ -668,7 +673,7 @@ void TDriver::InitTrack
GfParmGetNum(Handle,TDriver::SECT_PRIV,PRV_SCALE_BUMPOUTER,NULL,(float) Param.oCarParam.oScaleBump);
GfOut("#Scale Bump Outer: %g\n",Param.oCarParam.oScaleBumpOuter);
Param.oCarParam.oScaleMu =
Param.oCarParam.oScaleMu = ScaleMu *
GfParmGetNum(Handle,TDriver::SECT_PRIV,PRV_SCALE_MU,NULL,Param.oCarParam.oScaleMu);
GfOut("#Scale Mu: %g\n",Param.oCarParam.oScaleMu);
@ -1112,31 +1117,31 @@ void TDriver::FindRacinglines()
GfOut("# ... make smooth path ...\n");
oRacingLine[oRL_FREE].MakeSmoothPath // Calculate a smooth path
(&oTrackDesc, Param, // as main racingline
TClothoidLane::TOptions(1));
TClothoidLane::TOptions(oBumpMode));
}
else if (oSituation->_raceType == RM_TYPE_QUALIF)
{
if (!oRacingLine[oRL_FREE].LoadSmoothPath // Load a smooth path
(oTrackLoadQualify,
&oTrackDesc, Param, // as main racingline
TClothoidLane::TOptions(1)))
TClothoidLane::TOptions(oBumpMode)))
{
GfOut("# ... make smooth path ...\n");
oRacingLine[oRL_FREE].MakeSmoothPath // Calculate a smooth path
(&oTrackDesc, Param, // as main racingline
TClothoidLane::TOptions(1));
TClothoidLane::TOptions(oBumpMode));
oRacingLine[oRL_FREE].SavePointsToFile(oTrackLoadQualify);
}
}
else if (!oRacingLine[oRL_FREE].LoadSmoothPath // Load a smooth path
(oTrackLoad,
&oTrackDesc, Param, // as main racingline
TClothoidLane::TOptions(1)))
TClothoidLane::TOptions(oBumpMode)))
{
GfOut("# ... make smooth path ...\n");
oRacingLine[oRL_FREE].MakeSmoothPath // Calculate a smooth path
(&oTrackDesc, Param, // as main racingline
TClothoidLane::TOptions(1));
TClothoidLane::TOptions(oBumpMode));
//oRacingLine[oRL_FREE].SaveToFile("RL_FREE.tk3");
oRacingLine[oRL_FREE].SavePointsToFile(oTrackLoad);
}
@ -1158,13 +1163,13 @@ void TDriver::FindRacinglines()
if (!oRacingLine[oRL_LEFT].LoadSmoothPath // Load a smooth path
(oTrackLoadLeft,
&oTrackDesc, Param, // as avoid to left racingline
TClothoidLane::TOptions(1, FLT_MAX, -oAvoidWidth, true)))
TClothoidLane::TOptions(oBumpMode, FLT_MAX, -oAvoidWidth, true)))
{
GfOut("# ... make avoid path left ...\n");
oRacingLine[oRL_LEFT].MakeSmoothPath // Avoid to left racingline
(&oTrackDesc, Param,
TClothoidLane::TOptions(1, FLT_MAX, -oAvoidWidth, true));
TClothoidLane::TOptions(oBumpMode, FLT_MAX, -oAvoidWidth, true));
//oRacingLine[oRL_LEFT].SaveToFile("RL_LEFT.tk3");
oRacingLine[oRL_LEFT].SavePointsToFile(oTrackLoadLeft);
}
@ -1177,13 +1182,13 @@ void TDriver::FindRacinglines()
if (!oRacingLine[oRL_RIGHT].LoadSmoothPath // Load a smooth path
(oTrackLoadRight,
&oTrackDesc, Param, // as avoid to left racingline
TClothoidLane::TOptions(1, -oAvoidWidth, FLT_MAX, true)))
TClothoidLane::TOptions(oBumpMode, -oAvoidWidth, FLT_MAX, true)))
{
GfOut("# ... make avoid path right ...\n");
oRacingLine[oRL_RIGHT].MakeSmoothPath // Avoid to right racingline
(&oTrackDesc, Param,
TClothoidLane::TOptions(1, -oAvoidWidth, FLT_MAX, true));
TClothoidLane::TOptions(oBumpMode, -oAvoidWidth, FLT_MAX, true));
//oRacingLine[oRL_RIGHT].SaveToFile("RL_RIGHT.tk3");
oRacingLine[oRL_RIGHT].SavePointsToFile(oTrackLoadRight);
}

View file

@ -347,6 +347,7 @@ private:
bool oTreatTeamMateAsLapper;
bool oTeamEnabled;
int oCarsPerPit; // Pit sharing
float oBumpMode; //
static int NBBOTS; // Nbr of cars
static double CurrSimTime; // Current simulation time

View file

@ -375,10 +375,14 @@ enum
#define PRV_PIT_BRAKE_DIST "pit brake dist"
#define PRV_PIT_TEST_STOP "pit test stop"
#define PRV_BUMP_MODE "bump mode" // bump detection model
#define PRV_SCALE__BRAKE "scale_brake" // Scale brake force
#define PRV_SCALE_BRAKE "scale brake" // Scale brake force
#define PRV_SCALE_BUMP "scale bump" // Scale bump detection inside
#define PRV_SCALE_BUMPOUTER "scale bump outer" // Scale bump detection outside
#define PRV_SCALE_MU "scale mu" // Scale friction calculation
#define PRV_SCALE_MU "scale_mu" // Scale friction calculation
#define PRV_SCALE__MU "scale mu" // Scale friction calculation
#define PRV_SCALE_FRICTION "scale friction" // Scale friction calculation
#define PRV_SCALE_BRAKING "scale braking" // Scale brake calculation

View file

@ -10,7 +10,7 @@
//
// File : unittrack.cpp
// Created : 2007.11.17
// Last changed : 2009.01.17
// Last changed : 2009.02.08
// Copyright : © 2007-2009 Wolf-Dieter Beelitz
// eMail : wdb@wdbee.de
// Version : 2.00.000
@ -411,11 +411,11 @@ void TTrackDescription::InitTrack
else // increase counter
N++; // on straights
if (N > 10) // After 10 sections
if (N > 10) // After 10 sections
LastSegType = LastSeg->type; // reset
Seg = oSections[I].Seg; // Get torcs segment
//if (strncmp(Seg->name,"180",3) == 0)
//if (strncmp(Seg->name,"60",2) == 0)
// GfOut("%s\n",Seg->name);
double DistFromStart = // Distance from start
@ -498,10 +498,6 @@ void TTrackDescription::InitTrack
WCurb = MIN(WCurb,1.5); // Keep two wheels on track
Done = true;
}
else
{
W = 0;
}
}
else if (PSide->style == TR_PLAN) // On plan
{