TORCS  1.3.9
The Open Racing Car Simulator
robottools.h File Reference

Robots Tools. More...

#include <car.h>
#include <track.h>
Include dependency graph for robottools.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RELAXATION2(target, prev, rate)
 
#define RELAXATION(target, prev, rate)
 

Typedefs

typedef enum rtCarPitSetupType rtCarPitSetupType
 

Enumerations

enum  rtCarPitSetupType {
  PRACTICE = 0, QUALIFYING = 1, RACE = 2, BACKUP1 = 3,
  BACKUP2 = 4, BACKUP3 = 5
}
 

Functions

tdble RtTrackGetWidth (tTrackSeg *seg, tdble toStart)
 Get the track width at the specified point. More...
 
void RtTrackLocal2Global (tTrkLocPos *p, tdble *X, tdble *Y, int flag)
 Calculate global coordinates from a local position relative to the given track segment (segment, toRight, toStart)The toStart position refers to the current segment, the function will not search for next segment if toStart is greater than the segment length. More...
 
void RtTrackGlobal2Local (tTrackSeg *segment, tdble X, tdble Y, tTrkLocPos *p, int type)
 Convert a Global (segment, X, Y) position into a Local one (segment, toRight, toStart)The segment in the Global position is used to start the search of a good segment in term of toStart value. More...
 
tdble RtTrackHeightL (tTrkLocPos *p)
 Returns the absolute height in meters of the road at the Local position p. More...
 
tdble RtTrackHeightG (tTrackSeg *seg, tdble X, tdble Y)
 Returns the absolute height in meters of the road at the Global position (segment, X, Y) More...
 
void RtTrackSideNormalG (tTrackSeg *seg, tdble X, tdble Y, int side, t3Dd *norm)
 Give the normal vector of the border of the track including the sides. More...
 
tdble RtTrackSideTgAngleL (tTrkLocPos *p)
 Used to get the tangent angle for a track position The angle is given in radian. More...
 
void RtTrackSurfaceNormalL (tTrkLocPos *p, t3Dd *norm)
 Used to get the normal vector of the road (pointing upward). More...
 
int RtDistToPit (struct CarElt *car, tTrack *track, tdble *dL, tdble *dW)
 Get the distance to the pit stop. More...
 
tdble RtGetDistFromStart (tCarElt *car)
 Get the distance from the start lane. More...
 
tdble RtGetDistFromStart2 (tTrkLocPos *p)
 Get the distance from the start lane. More...
 
void RtTelemInit (tdble ymin, tdble ymax)
 Initialization of a telemetry session. More...
 
tTrackSegRtTrackGetSeg (tTrkLocPos *p)
 Get the current segment. More...
 
tTrackSegRtTrackGetSideNeighbourSeg (tTrackSeg *main, tTrackSeg *current, int tr_side)
 Get the neighbour segment of the given current segment. More...
 
void RtTelemNewChannel (const char *name, tdble *var, tdble min, tdble max)
 Create a new telemetry channel. More...
 
void RtTelemStartMonitoring (const char *filename)
 Start recording into a file. More...
 
void RtTelemStopMonitoring (void)
 Stop recording and close the file. More...
 
void RtTelemUpdate (double time)
 Record a new set of values. More...
 
void RtTelemShutdown (void)
 Deinstall the telemetry module. More...
 
void RtGetCarPitSetupFilename (rtCarPitSetupType type, int robidx, const char *carname, const char *trackname, char *filename, const int len)
 Compose filename from given strings. 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...
 
void RtSaveCarPitSetupFile (void *hdlecar, tCarPitSetup *s, const char *filepath, const char *carname)
 Save a custom car setup to a given filename. More...
 
void RtInitCarPitSetup (void *carparmhandle, tCarPitSetup *setup, bool minmaxonly)
 Initialize tCarPitSetup from data in parameter set given in handle hdle. 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 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...
 
bool RtLoadCarPitSetupFilename (void *hdlecar, const char *filepath, tCarPitSetup *s, bool minmaxonly)
 Load a custom car setup from a given filename. 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

Robots Tools.

Author
Eric Espie

Definition in file robottools.h.

Macro Definition Documentation

◆ RELAXATION

#define RELAXATION (   target,
  prev,
  rate 
)
Value:
do { \
target = (prev) + (rate) * ((target) - (prev)) * 0.01; \
prev = (target); \
} while (0)

Definition at line 38 of file robottools.h.

◆ RELAXATION2

#define RELAXATION2 (   target,
  prev,
  rate 
)
Value:
do { \
tdble __tmp__; \
__tmp__ = target; \
target = (prev) + (rate) * ((target) - (prev)) * 0.01; \
prev = __tmp__; \
} while (0)

Definition at line 30 of file robottools.h.

Typedef Documentation

◆ rtCarPitSetupType

Enumeration Type Documentation

◆ rtCarPitSetupType

Enumerator
PRACTICE 
QUALIFYING 
RACE 
BACKUP1 
BACKUP2 
BACKUP3 

Definition at line 180 of file robottools.h.

Function Documentation

◆ RtTelemInit()

void RtTelemInit ( tdble  ymin,
tdble  ymax 
)

Initialization of a telemetry session.

Parameters
yminMinimum value for Y.
ymaxMaximum value for Y.
Returns
None

Definition at line 59 of file rttelem.cpp.

Here is the call graph for this function:

◆ RtTelemNewChannel()

void RtTelemNewChannel ( const char *  name,
tdble var,
tdble  min,
tdble  max 
)

Create a new telemetry channel.

Parameters
nameName of the channel.
varAddress of the variable to monitor.
minMinimum value of this variable.
maxMaximum value of this variable.
Returns
None

Definition at line 86 of file rttelem.cpp.

Here is the call graph for this function:

◆ RtTelemShutdown()

void RtTelemShutdown ( void  )

Deinstall the telemetry module.

Returns
none.

Definition at line 132 of file rttelem.cpp.

Here is the call graph for this function:

◆ RtTelemStartMonitoring()

void RtTelemStartMonitoring ( const char *  filename)

Start recording into a file.

Parameters
filenamename of the file to use.
Returns
none.

Definition at line 98 of file rttelem.cpp.

◆ RtTelemStopMonitoring()

void RtTelemStopMonitoring ( void  )

Stop recording and close the file.

Returns
none

Definition at line 109 of file rttelem.cpp.

◆ RtTelemUpdate()

void RtTelemUpdate ( double  time)

Record a new set of values.

Parameters
timecurrent time.
Returns
None.

Definition at line 121 of file rttelem.cpp.