- added usr for mpa11 et mpa12

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

Former-commit-id: d0a4ef3656e8b4c90b54b11b6984189bd51aea3f
Former-commit-id: 8d45856e8005f6dde614aaeb499cf267f4a004a7
This commit is contained in:
torcs-ng 2015-07-27 21:02:37 +00:00
parent 1e31db3d2a
commit 3e28141da7
6 changed files with 2886 additions and 2830 deletions

View file

@ -36,7 +36,7 @@ SET(ROBOT_SOURCES
)
# Official-only dandroid instances.
SET(ROBOT_CLONES dandroid_36GP)
SET(ROBOT_CLONES dandroid_36GP dandroid_mpa12)
# The ubiquitous robot module and its clones.
ROBOT_MODULE(NAME ${ROBOT_NAME} VERSION 2.0.0 SOVERSION 1.0.0
@ -45,4 +45,4 @@ ROBOT_MODULE(NAME ${ROBOT_NAME} VERSION 2.0.0 SOVERSION 1.0.0
CLONENAMES ${ROBOT_CLONES})
# For data associated to the ubiquitous robot module and its clones,
# see data/drivers/dandroid*/CMakeLists.txt
# see data/drivers/dandroid*/CMakeLists.txt

View file

@ -78,7 +78,8 @@ const char *sUndefined = "undefined";
#ifdef TARGET_SPEEDDREAMS
// Set robots's name and xml file pathname
static void setRobotName(const string name) {
static void setRobotName(const string name)
{
char buffer[BUFSIZE];
snprintf(buffer, BUFSIZE, "drivers/%s/%s.xml", name.c_str(), name.c_str());
nameBuffer = name;

View file

@ -11,6 +11,8 @@ SET(ROBOT_INTERFACE LEGACY WELCOME
usr_ls1
usr_ls2
usr_mpa1
usr_mpa11
usr_mpa12
usr_36GP
usr_rs
usr_lp1
@ -38,7 +40,7 @@ SET(ROBOT_SOURCES
src/xmldefs.h)
# Official-only USR instances.
SET(ROBOT_CLONES usr_trb1 usr_sc usr_ls1 usr_ls2 usr_mpa1 usr_36GP usr_rs usr_lp1)
SET(ROBOT_CLONES usr_trb1 usr_sc usr_ls1 usr_ls2 usr_mpa1 usr_mpa11 usr_mpa12 usr_36GP usr_rs usr_lp1)
ROBOT_MODULE(NAME ${ROBOT_NAME} VERSION 3.0.0 SOVERSION 1.0.0
INTERFACE ${ROBOT_INTERFACE}

File diff suppressed because it is too large Load diff

View file

@ -53,7 +53,7 @@ class SimpleStrategy;
enum { TEAM_FRIEND=1, TEAM_FOE };
enum { avoidleft=1, avoidright=2, avoidside=4, avoidsideclosing=8, avoidback=16 };
enum { debug_steer=1, debug_overtake=2, debug_brake=4 };
enum { USR_TRB1=1, USR_SC, USR_LS1, USR_LS2, USR_36GP, USR_RS, USR_LP1, USR_MPA1 };
enum { USR_TRB1=1, USR_SC, USR_LS1, USR_LS2, USR_36GP, USR_RS, USR_LP1, USR_MPA1, USR_MPA11, USR_MPA12 };
class Driver {
public:

View file

@ -139,37 +139,6 @@ void* getFileHandle()
// Carset specific init functions
////////////////////////////////////////////////////////////
// Schismatic init for usr_trb1
void SetupUSR_trb1()
{
// Add usr_trb1 specific initialization here
robot_type = USR_TRB1;
};
// Schismatic init for usr_ls2
void SetupUSR_ls2()
{
// Add usr_ls2 specific initialization here
robot_type = USR_LS2;
};
// Schismatic init for usr_sc
void SetupUSR_sc()
{
// Add usr_sc specific initialization here
robot_type = USR_SC;
};
// Schismatic init for usr_ls1
void SetupUSR_ls1()
{
// Add usr_ls1 specific initialization here
robot_type = USR_LS1;
};
// Schismatic init for usr_36GP
void SetupUSR_36GP()
{
@ -177,13 +146,6 @@ void SetupUSR_36GP()
robot_type = USR_36GP;
};
// Schismatic init for usr_rs
void SetupUSR_rs()
{
// Add usr_RS specific initialization here
robot_type = USR_RS;
};
// Schismatic init for usr_lp1
void SetupUSR_lp1()
{
@ -191,6 +153,20 @@ void SetupUSR_lp1()
robot_type = USR_LP1;
};
// Schismatic init for usr_ls1
void SetupUSR_ls1()
{
// Add usr_ls1 specific initialization here
robot_type = USR_LS1;
};
// Schismatic init for usr_ls2
void SetupUSR_ls2()
{
// Add usr_ls2 specific initialization here
robot_type = USR_LS2;
};
// Schismatic init for usr_mpa1
void SetupUSR_mpa1()
{
@ -198,6 +174,41 @@ void SetupUSR_mpa1()
robot_type = USR_MPA1;
};
// Schismatic init for usr_mpa11
void SetupUSR_mpa11()
{
// Add usr_mpa1 specific initialization here
robot_type = USR_MPA11;
};
// Schismatic init for usr_mpa12
void SetupUSR_mpa12()
{
// Add usr_mpa1 specific initialization here
robot_type = USR_MPA12;
};
// Schismatic init for usr_rs
void SetupUSR_rs()
{
// Add usr_RS specific initialization here
robot_type = USR_RS;
};
// Schismatic init for usr_sc
void SetupUSR_sc()
{
// Add usr_sc specific initialization here
robot_type = USR_SC;
};
// Schismatic init for usr_trb1
void SetupUSR_trb1()
{
// Add usr_trb1 specific initialization here
robot_type = USR_TRB1;
};
////////////////////////////////////////////////////////////
// Carset specific entry points (functions)
@ -276,6 +287,36 @@ extern "C" int usr_mpa1(tModInfo *ModInfo)
return ret;
}
// Schismatic entry point for usr_mpa1
extern "C" int usr_mpa11(tModInfo *ModInfo)
{
int ret = -1;
setRobotName("usr_mpa11");
robot_type = USR_MPA11;
void *robot_settings = getFileHandle();
if (robot_settings)
{
ret = usr(ModInfo);
}
return ret;
}
// Schismatic entry point for usr_mpa1
extern "C" int usr_mpa12(tModInfo *ModInfo)
{
int ret = -1;
setRobotName("usr_mpa12");
robot_type = USR_MPA12;
void *robot_settings = getFileHandle();
if (robot_settings)
{
ret = usr(ModInfo);
}
return ret;
}
// Schismatic entry point for usr_36GP
extern "C" int usr_36GP(tModInfo *ModInfo)
{
@ -418,6 +459,10 @@ extern "C" int moduleWelcome(const tModWelcomeIn* welcomeIn,
SetupUSR_lp1();
else if (strncmp(robot_name,"usr_mpa1", strlen("usr_mpa1")) == 0)
SetupUSR_mpa1();
else if (strncmp(robot_name,"usr_mpa11", strlen("usr_mpa11")) == 0)
SetupUSR_mpa11();
else if (strncmp(robot_name,"usr_mpa12", strlen("usr_mpa12")) == 0)
SetupUSR_mpa12();
// Set max nb of interfaces to return.