From 32fc3ff0c982cae5d3c8444c17035888951b5889 Mon Sep 17 00:00:00 2001 From: wdbee Date: Wed, 23 Dec 2009 22:12:39 +0000 Subject: [PATCH] Update simplix Grand-Prix tracks git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@2058 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 2d848b7de3bacf99b28bcbbe0236212cb18a77e7 Former-commit-id: 6425fd0b7dc967420905c5838bdffe2dd6438c61 --- .../simplix/src/car1-trb1/Corkscrew.xml | 89 +++++++++++++++++++ src/drivers/simplix/src/car1-trb1/aalborg.xml | 65 ++++++++++++++ .../simplix/src/car1-trb1/g-track-2.xml | 28 ++++++ .../simplix/src/car1-trb1/migrants.xml | 29 ++++++ .../simplix/src/car1-trb1/ruudskogen.xml | 37 ++++++++ src/drivers/simplix/src/car1-trb1/wheel-2.xml | 59 ++++++++++++ src/drivers/simplix/src/unitdriver.cpp | 17 +++- src/drivers/simplix/src/unitdriver.h | 4 +- src/drivers/simplix/src/unitmain.cpp | 15 +++- 9 files changed, 336 insertions(+), 7 deletions(-) create mode 100644 src/drivers/simplix/src/car1-trb1/Corkscrew.xml create mode 100644 src/drivers/simplix/src/car1-trb1/aalborg.xml create mode 100644 src/drivers/simplix/src/car1-trb1/g-track-2.xml create mode 100644 src/drivers/simplix/src/car1-trb1/migrants.xml create mode 100644 src/drivers/simplix/src/car1-trb1/ruudskogen.xml create mode 100644 src/drivers/simplix/src/car1-trb1/wheel-2.xml diff --git a/src/drivers/simplix/src/car1-trb1/Corkscrew.xml b/src/drivers/simplix/src/car1-trb1/Corkscrew.xml new file mode 100644 index 000000000..94393f8af --- /dev/null +++ b/src/drivers/simplix/src/car1-trb1/Corkscrew.xml @@ -0,0 +1,89 @@ + + + + + + + + +
+ +
+
+ +
+
+ + +
+
+ + +
+
+ + + +
+
+ + + +
+
+ + + + + + + + +
+
+ + + + + + + + +
+
+ + + + + + + + +
+
+ + + + + + + + +
+
+ + + + + + + +
+
diff --git a/src/drivers/simplix/src/car1-trb1/aalborg.xml b/src/drivers/simplix/src/car1-trb1/aalborg.xml new file mode 100644 index 000000000..3a1741ca9 --- /dev/null +++ b/src/drivers/simplix/src/car1-trb1/aalborg.xml @@ -0,0 +1,65 @@ + + + + + + + + +
+ +
+
+ +
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + + + + + + + + +
+
diff --git a/src/drivers/simplix/src/car1-trb1/g-track-2.xml b/src/drivers/simplix/src/car1-trb1/g-track-2.xml new file mode 100644 index 000000000..102329624 --- /dev/null +++ b/src/drivers/simplix/src/car1-trb1/g-track-2.xml @@ -0,0 +1,28 @@ + + + + + + + + +
+ +
+
+ +
+
+ + + + +
+
diff --git a/src/drivers/simplix/src/car1-trb1/migrants.xml b/src/drivers/simplix/src/car1-trb1/migrants.xml new file mode 100644 index 000000000..1a0938d68 --- /dev/null +++ b/src/drivers/simplix/src/car1-trb1/migrants.xml @@ -0,0 +1,29 @@ + + + + + + + + +
+ +
+
+ +
+
+ + + + + +
+
diff --git a/src/drivers/simplix/src/car1-trb1/ruudskogen.xml b/src/drivers/simplix/src/car1-trb1/ruudskogen.xml new file mode 100644 index 000000000..033db22b9 --- /dev/null +++ b/src/drivers/simplix/src/car1-trb1/ruudskogen.xml @@ -0,0 +1,37 @@ + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + + + +
+
diff --git a/src/drivers/simplix/src/car1-trb1/wheel-2.xml b/src/drivers/simplix/src/car1-trb1/wheel-2.xml new file mode 100644 index 000000000..26148f4af --- /dev/null +++ b/src/drivers/simplix/src/car1-trb1/wheel-2.xml @@ -0,0 +1,59 @@ + + + + + + + + +
+ +
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + + + + + +
+
diff --git a/src/drivers/simplix/src/unitdriver.cpp b/src/drivers/simplix/src/unitdriver.cpp index 0e3723b90..54dd1b7d5 100644 --- a/src/drivers/simplix/src/unitdriver.cpp +++ b/src/drivers/simplix/src/unitdriver.cpp @@ -80,7 +80,7 @@ // Statics //--------------------------------------------------------------------------* int TDriver::NBBOTS = MAX_NBBOTS; // Nbr of drivers/robots -double TDriver::CurrSimTime = 0; // Current simulation time +//double TDriver::CurrSimTime = 0; // Current simulation time char const* TDriver::MyBotName = "simplix"; // Name of this bot char const* TDriver::ROBOT_DIR = "drivers/simplix"; // Sub path to dll char const* TDriver::SECT_PRIV = "simplix private"; // Private section @@ -748,7 +748,7 @@ void TDriver::InitTrack oSideScaleBrake = GfParmGetNum(Handle,TDriver::SECT_PRIV,PRV_SIDE_BRAKE,NULL,oSideScaleBrake); - GfOut("#Side Scale Brake%g\n",oSideScaleMu); + GfOut("#Side Scale Brake%g\n",oSideScaleBrake); oAvoidScale = GfParmGetNum(Handle,TDriver::SECT_PRIV,PRV_AVOID_SCALE,0,oAvoidScale); @@ -1052,6 +1052,19 @@ void TDriver::NewRace(PtCarElt Car, PSituation Situation) } //==========================================================================* +//==========================================================================* +// Drive +//--------------------------------------------------------------------------* +void TDriver::DriveLast() +{ + oCar->ctrl.accelCmd = (float) oAccel; + oCar->ctrl.brakeCmd = (float) oBrake; + oCar->ctrl.clutchCmd = (float) oClutch; + oCar->ctrl.gear = oGear; + oCar->ctrl.steer = (float) oSteer; +} +//==========================================================================* + //==========================================================================* // Drive //--------------------------------------------------------------------------* diff --git a/src/drivers/simplix/src/unitdriver.h b/src/drivers/simplix/src/unitdriver.h index 977b43143..7d7aa1c5e 100644 --- a/src/drivers/simplix/src/unitdriver.h +++ b/src/drivers/simplix/src/unitdriver.h @@ -100,6 +100,7 @@ class TDriver void NewRace // Start new Race (PtCarElt Car, PSituation Situation); void Drive(); // Drive while racing + void DriveLast(); // Reuse drive commands int PitCmd(); // Handle pitstop void EndRace(); // Stop race void Shutdown(); // Cleanup @@ -387,7 +388,8 @@ private: float oSideBorderOuter; static int NBBOTS; // Nbr of cars - static double CurrSimTime; // Current simulation time +// static double CurrSimTime; // Current simulation time + double CurrSimTime; // Current simulation time static char const* MyBotName; // Name of this bot static char const* ROBOT_DIR; // Sub path to dll static char const* SECT_PRIV; // Private section diff --git a/src/drivers/simplix/src/unitmain.cpp b/src/drivers/simplix/src/unitmain.cpp index 813745e7f..82c43791a 100644 --- a/src/drivers/simplix/src/unitmain.cpp +++ b/src/drivers/simplix/src/unitmain.cpp @@ -8,7 +8,7 @@ // // File : unitmain.cpp // Created : 2008.01.27 -// Last changed : 2009.02.26 +// Last changed : 2009.12.22 // Copyright : © 2007-2009 Wolf-Dieter Beelitz // eMail : wdb@wdbee.de // Version : 2.00.000 @@ -569,6 +569,7 @@ static void NewRace(int Index, tCarElt* Car, tSituation *S) cUnusedCount[Index-IndexOffset] = 0; cRobot[Index-IndexOffset]->NewRace(Car, S); + cRobot[Index-IndexOffset]->CurrSimTime = -10.0; } //==========================================================================* @@ -587,8 +588,10 @@ static void NewRace(int Index, tCarElt* Car, tSituation *S) static void Drive(int Index, tCarElt* Car, tSituation *S) { //GfOut("#>>> TDriver::Drive\n"); - //if (cRobot[Index-IndexOffset]->CurrSimTime != S->currentTime) + if (cRobot[Index-IndexOffset]->CurrSimTime < S->currentTime) +// if (cRobot[Index-IndexOffset]->CurrSimTime + 0.03 < S->currentTime) { + //GfOut("#Drive\n"); double StartTimeStamp = RtTimeStamp(); cRobot[Index-IndexOffset]->CurrSimTime = // Update current time @@ -615,8 +618,12 @@ static void Drive(int Index, tCarElt* Car, tSituation *S) cTickCount[Index-IndexOffset]++; cTicks[Index-IndexOffset] += Duration; } -// else -// cUnusedCount++; + else + { + //GfOut("#DriveLast\n"); + cUnusedCount[Index-IndexOffset]++; + cRobot[Index-IndexOffset]->DriveLast(); // Use last drive commands + } //GfOut("#<<< TDriver::Drive\n"); } //==========================================================================*