TORCS  1.3.9
The Open Racing Car Simulator
Robot Setup Tools API

API to load and store car setups in a unified way, and to support setup changes during pit stops. More...

Collaboration diagram for Robot Setup Tools API:

Functions

void RtInitCarPitSetup (void *hdle, tCarPitSetup *s, bool minmaxonly)
 Initialize tCarPitSetup from data in parameter set given in handle hdle. More...
 
void RtGetCarPitSetupFilename (rtCarPitSetupType type, int robidx, const char *carname, const char *trackname, char *filename, const int len)
 Compose filename from given strings. More...
 
static void RtParmSetNum (void *hdlesetup, const char *path, const char *key, const char *unit, tCarPitSetupValue *v)
 Robottool internal: Set parameter if min != max, save as well min and max values
More...
 
void RtSaveCarPitSetupFile (void *hdlecar, tCarPitSetup *s, const char *filepath, const char *carname)
 Save a custom car setup to a given filename. More...
 
void RtSaveCarPitSetup (void *hdlecar, tCarPitSetup *s, rtCarPitSetupType type, const char *modulename, int robidx, const char *trackname, const char *carname)
 Save a custom car setup for a given robot, car, track and session (race, practice, qualifying, ...) type. More...
 
bool RtCarPitSetupExists (rtCarPitSetupType type, const char *modulename, int robidx, const char *trackname, const char *carname)
 Checks if a specific car setup is available. More...
 
bool RtLoadCarPitSetupFilename (void *hdlecar, const char *filepath, tCarPitSetup *s, bool minmaxonly)
 Load a custom car setup from a given filename. More...
 
bool RtLoadCarPitSetup (void *hdlecar, tCarPitSetup *s, rtCarPitSetupType type, const char *modulename, int robidx, const char *trackname, const char *carname, bool minmaxonly)
 Load a custom car setup for a given robot, car, track and session (race, practice, qualifying, ...) type. More...
 
void * RtLoadOriginalCarSettings (const char *carname)
 Gets a handle to a parameter file containing the original TORCS car setup, that means the car setup merged with the cars category setup. More...
 
bool RtInitCarPitSetupFromDefault (tCarPitSetup *s, const char *carname)
 Initialize the given tCarPitSetup with the original TORCS setup, that means the car setup merged with the cars category setup. More...
 
void * RtParmReadSetup (rtCarPitSetupType type, const char *modulename, int robidx, const char *trackname, const char *carname)
 Load a custom car setup file for a given robot, car, track and session (race, practice, qualifying, ...) type. More...
 

Detailed Description

API to load and store car setups in a unified way, and to support setup changes during pit stops.

Function Documentation

◆ RtCarPitSetupExists()

bool RtCarPitSetupExists ( rtCarPitSetupType  type,
const char *  modulename,
int  robidx,
const char *  trackname,
const char *  carname 
)

Checks if a specific car setup is available.

Parameters
[in]typeSetup type
[in]modulenameName of robot module without extension
[in]robidxIndex of robot
[in]tracknameTORCS internal name name of track
[in]carnameTORCS internal name car name
Returns
True on success, false on failure

Definition at line 988 of file rttrack.cpp.

Here is the call graph for this function:

◆ RtGetCarPitSetupFilename()

void RtGetCarPitSetupFilename ( rtCarPitSetupType  type,
int  robidx,
const char *  carname,
const char *  trackname,
char *  filename,
const int  len 
)

Compose filename from given strings.

Parameters
[in]typeSetup type
[in]robidxIndex of robot
[in]carnameTORCS internal name car name
[in]tracknameTORCS internal name name of track
[in,out]filenameBuffer for result
[in]lenBuffer size

Definition at line 813 of file rttrack.cpp.

◆ RtInitCarPitSetup()

void RtInitCarPitSetup ( void *  hdle,
tCarPitSetup s,
bool  minmaxonly 
)

Initialize tCarPitSetup from data in parameter set given in handle hdle.

Parameters
[in]hdleHandle to setup parameter set
[in,out]sPointer to tCarPitSetup struct to initialize
[in]minmaxonlyIf true, just the min/max values of s are modified

Definition at line 714 of file rttrack.cpp.

Here is the call graph for this function:

◆ RtInitCarPitSetupFromDefault()

bool RtInitCarPitSetupFromDefault ( tCarPitSetup s,
const char *  carname 
)

Initialize the given tCarPitSetup with the original TORCS setup, that means the car setup merged with the cars category setup.

Parameters
[in,out]sPointer to tCarPitSetup struct to fill/initialize
[in]carnameTORCS internal name of the car (directory/filename)
Returns
True on success, false on failure

Definition at line 1125 of file rttrack.cpp.

Here is the call graph for this function:

◆ RtLoadCarPitSetup()

bool RtLoadCarPitSetup ( void *  hdlecar,
tCarPitSetup s,
rtCarPitSetupType  type,
const char *  modulename,
int  robidx,
const char *  trackname,
const char *  carname,
bool  minmaxonly 
)

Load a custom car setup for a given robot, car, track and session (race, practice, qualifying, ...) type.

The setup is validated against the setup given in hdlecar.

Parameters
[in]hdlecarHandle to "master setup" (parameter set) to validate against (min/max and other checks)
[in,out]sPointer to tCarPitSetup struct to fill/initialize
[in]typeSetup type
[in]modulenameName of robot module without extension
[in]robidxIndex of robot
[in]tracknameTORCS internal name name of track
[in]carnameTORCS internal name car name
[in]minmaxonlyIf true, just the min/max values of s are modified
Returns
true on success, false on failure
Note
Robot, car, track and session information are used to compose a standard setup filename
See also
RtLoadCarPitSetupFilename

Definition at line 1051 of file rttrack.cpp.

Here is the call graph for this function:

◆ RtLoadCarPitSetupFilename()

bool RtLoadCarPitSetupFilename ( void *  hdlecar,
const char *  filepath,
tCarPitSetup s,
bool  minmaxonly 
)

Load a custom car setup from a given filename.

The setup is validated against the setup given in hdlecar.

Parameters
[in]hdlecarHandle to "master setup" (parameter set) to validate against (min/max and other checks)
[in]filepathFull path to setup file
[in,out]sPointer to tCarPitSetup struct to fill/initialize
[in]minmaxonlyIf true, just the min/max values of s are modified
Returns
True on success, false on failure

Definition at line 1022 of file rttrack.cpp.

Here is the call graph for this function:

◆ RtLoadOriginalCarSettings()

void* RtLoadOriginalCarSettings ( const char *  carname)

Gets a handle to a parameter file containing the original TORCS car setup, that means the car setup merged with the cars category setup.

Parameters
[in]carnameTORCS internal name of the car (directory/filename)
Returns
NULL on failure, a valid handle otherwise

Definition at line 1080 of file rttrack.cpp.

Here is the call graph for this function:

◆ RtParmReadSetup()

void* RtParmReadSetup ( rtCarPitSetupType  type,
const char *  modulename,
int  robidx,
const char *  trackname,
const char *  carname 
)

Load a custom car setup file for a given robot, car, track and session (race, practice, qualifying, ...) type.

Parameters
[in]typeSetup type
[in]modulenameName of robot module without extension
[in]robidxIndex of robot
[in]tracknameTORCS internal name name of track
[in]carnameTORCS internal name car name
Returns
Handle to data, or NULL on failure (e.g. if file is not available)
Note
Robot, car, track and session information are used to compose a standard setup filename

Definition at line 1149 of file rttrack.cpp.

Here is the call graph for this function:

◆ RtParmSetNum()

static void RtParmSetNum ( void *  hdlesetup,
const char *  path,
const char *  key,
const char *  unit,
tCarPitSetupValue v 
)
static

Robottool internal: Set parameter if min != max, save as well min and max values

Parameters
[in,out]hdlesetupHandle to parameter set to write into
[in]pathpath of parameter
[in]keykey name
[in]unitunit to convert the result to (NULL if SI wanted)
[in]vtCarPitSetupValue to set

Definition at line 834 of file rttrack.cpp.

Here is the call graph for this function:

◆ RtSaveCarPitSetup()

void RtSaveCarPitSetup ( void *  hdlecar,
tCarPitSetup s,
rtCarPitSetupType  type,
const char *  modulename,
int  robidx,
const char *  trackname,
const char *  carname 
)

Save a custom car setup for a given robot, car, track and session (race, practice, qualifying, ...) type.

The setup is validated against the setup given in hdlecar.

Parameters
[in]hdlecarHandle to "master setup" (parameter set) to validate against (min/max and other checks)
[in]sPointer to tCarPitSetup struct to save
[in]typeSetup type
[in]modulenameName of robot module without extension
[in]robidxIndex of robot
[in]tracknameTORCS internal name name of track
[in]carnameTORCS internal name car name
Note
Robot, car, track and session information are used to compose a standard setup filename
See also
RtSaveCarPitSetupFile

Definition at line 952 of file rttrack.cpp.

Here is the call graph for this function:

◆ RtSaveCarPitSetupFile()

void RtSaveCarPitSetupFile ( void *  hdlecar,
tCarPitSetup s,
const char *  filepath,
const char *  carname 
)

Save a custom car setup to a given filename.

The setup is validated against the setup given in hdlecar.

Parameters
[in]hdlecarHandle to "master setup" (parameter set) to validate against (min/max and other checks)
[in]sPointer to tCarPitSetup struct to save
[in]filepathFull path to setup file
[in]carnameTORCS internal name car name

Definition at line 850 of file rttrack.cpp.

Here is the call graph for this function: