From 9a3210565fedea0fb3c9812d45972d6706841417 Mon Sep 17 00:00:00 2001 From: torcs-ng Date: Thu, 30 Jul 2015 18:42:15 +0000 Subject: [PATCH] - added mpa11 & mpa12 to simplix driver git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6058 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: c04a5ba9434522eb6488de7b25c4d259ef4d973a Former-commit-id: ca7951fed3c62bd7f18eaf7f308ce7d95cff519b --- src/drivers/simplix/CMakeLists.txt | 2 +- src/drivers/simplix/src/unitglobal.h | 2 + src/drivers/simplix/src/unitmain.cpp | 58 +++++++++++++++++++++++++++- 3 files changed, 60 insertions(+), 2 deletions(-) diff --git a/src/drivers/simplix/CMakeLists.txt b/src/drivers/simplix/CMakeLists.txt index 8e6a16229..f930a1680 100644 --- a/src/drivers/simplix/CMakeLists.txt +++ b/src/drivers/simplix/CMakeLists.txt @@ -74,7 +74,7 @@ SET(ROBOT_SOURCES # Official-only simplix instances. SET(ROBOT_CLONES simplix_36GP simplix_sc simplix_srw simplix_trb1 simplix_ls1 simplix_ls2 simplix_mp5 - simplix_mpa1 simplix_lp1 simplix_ref) + simplix_mpa1 simplix_mpa11 simplix_mpa12 simplix_lp1 simplix_ref) # The ubiquitous robot module and its clones. ROBOT_MODULE(NAME ${ROBOT_NAME} VERSION 3.3.0 SOVERSION 1.0.0 diff --git a/src/drivers/simplix/src/unitglobal.h b/src/drivers/simplix/src/unitglobal.h index ddb142587..412af9719 100644 --- a/src/drivers/simplix/src/unitglobal.h +++ b/src/drivers/simplix/src/unitglobal.h @@ -109,6 +109,8 @@ extern GfLogger* PLogSimplix; #define RTYPE_SIMPLIX_LP1 8 // Robot type simplix_lp1 #define RTYPE_SIMPLIX_REF 9 // Robot type simplix_ref #define RTYPE_SIMPLIX_SRW 10 // Robot type simplix_srw +#define RTYPE_SIMPLIX_MPA11 11 // Robot type simplix_mpa11 +#define RTYPE_SIMPLIX_MPA12 12 // Robot type simplix_mpa12 //==========================================================================* //==========================================================================* diff --git a/src/drivers/simplix/src/unitmain.cpp b/src/drivers/simplix/src/unitmain.cpp index 5005728b9..aef7f5be5 100644 --- a/src/drivers/simplix/src/unitmain.cpp +++ b/src/drivers/simplix/src/unitmain.cpp @@ -305,7 +305,7 @@ void SetUpSimplix() void SetUpSimplix_mpa1() { cRobotType = RTYPE_SIMPLIX_MPA1; - SetParameters(NBBOTS, "indycar01"); + SetParameters(NBBOTS, "mpa1-murasama"); TDriver::AdvancedParameters = true; TDriver::UseBrakeLimit = false; TDriver::UseMPA1Skilling = true; @@ -314,6 +314,36 @@ void SetUpSimplix_mpa1() }; //==========================================================================* +//==========================================================================* +// Schismatic entry point for simplix_mpa11 +//--------------------------------------------------------------------------* +void SetUpSimplix_mpa11() +{ + cRobotType = RTYPE_SIMPLIX_MPA11; + SetParameters(NBBOTS, "mpa11-murasama"); + TDriver::AdvancedParameters = true; + TDriver::UseBrakeLimit = false; + TDriver::UseMPA1Skilling = true; + TDriver::SkillingFactor = 0.1f; // Skilling factor for career-mode + TDriver::UseRacinglineParameters = true; +}; +//==========================================================================* + +//==========================================================================* +// Schismatic entry point for simplix_mpa12 +//--------------------------------------------------------------------------* +void SetUpSimplix_mpa12() +{ + cRobotType = RTYPE_SIMPLIX_MPA12; + SetParameters(NBBOTS, "mpa12-murasama"); + TDriver::AdvancedParameters = true; + TDriver::UseBrakeLimit = false; + TDriver::UseMPA1Skilling = true; + TDriver::SkillingFactor = 0.1f; // Skilling factor for career-mode + TDriver::UseRacinglineParameters = true; +}; +//==========================================================================* + //==========================================================================* // Schismatic entry point for simplix_trb1 //--------------------------------------------------------------------------* @@ -549,6 +579,10 @@ int moduleWelcomeV1_00 SetUpSimplix_36GP(); else if (strncmp(RobName,"simplix_mpa1",strlen("simplix_mpa1")) == 0) SetUpSimplix_mpa1(); + else if (strncmp(RobName,"simplix_mpa11",strlen("simplix_mpa11")) == 0) + SetUpSimplix_mpa11(); + else if (strncmp(RobName,"simplix_mpa12",strlen("simplix_mpa12")) == 0) + SetUpSimplix_mpa12(); else if (strncmp(RobName,"simplix_ls1",strlen("simplix_ls1")) == 0) SetUpSimplix_ls1(); else if (strncmp(RobName,"simplix_ls2",strlen("simplix_ls2")) == 0) @@ -837,6 +871,28 @@ static int InitFuncPt(int Index, void *Pt) cInstances[Index-IndexOffset].cRobot->SideBorderOuter(0.00f); cInstances[Index-IndexOffset].cRobot->UseFilterAccel(); } + else if (cRobotType == RTYPE_SIMPLIX_MPA11) + { + LogSimplix.debug("#cRobotType == RTYPE_SIMPLIX_MPA11\n"); + cInstances[Index-IndexOffset].cRobot->CalcSkillingFoo = &TDriver::CalcSkilling_simplix_MPA1; + cInstances[Index-IndexOffset].cRobot->CalcFrictionFoo = &TDriver::CalcFriction_simplix_Identity; + cInstances[Index-IndexOffset].cRobot->CalcCrvFoo = &TDriver::CalcCrv_simplix_Identity; + cInstances[Index-IndexOffset].cRobot->CalcHairpinFoo = &TDriver::CalcHairpin_simplix; + cInstances[Index-IndexOffset].cRobot->ScaleSide(0.95f,0.95f); + cInstances[Index-IndexOffset].cRobot->SideBorderOuter(0.00f); + cInstances[Index-IndexOffset].cRobot->UseFilterAccel(); + } + else if (cRobotType == RTYPE_SIMPLIX_MPA12) + { + LogSimplix.debug("#cRobotType == RTYPE_SIMPLIX_MPA12\n"); + cInstances[Index-IndexOffset].cRobot->CalcSkillingFoo = &TDriver::CalcSkilling_simplix_MPA1; + cInstances[Index-IndexOffset].cRobot->CalcFrictionFoo = &TDriver::CalcFriction_simplix_Identity; + cInstances[Index-IndexOffset].cRobot->CalcCrvFoo = &TDriver::CalcCrv_simplix_Identity; + cInstances[Index-IndexOffset].cRobot->CalcHairpinFoo = &TDriver::CalcHairpin_simplix; + cInstances[Index-IndexOffset].cRobot->ScaleSide(0.95f,0.95f); + cInstances[Index-IndexOffset].cRobot->SideBorderOuter(0.00f); + cInstances[Index-IndexOffset].cRobot->UseFilterAccel(); + } else if (cRobotType == RTYPE_SIMPLIX_LS1) { LogSimplix.debug("#cRobotType == RTYPE_SIMPLIX_LS1\n");