TORCS  1.3.9
The Open Racing Car Simulator
Robot Module Interface

Interface for robot modules, robot modules are discovered and loaded during runtime. More...

Collaboration diagram for Robot Module Interface:

Files

file  robot.h
 Robot Module Interface Definition.
 

Classes

struct  RobotItf
 Interface Structure for Robots. More...
 

Typedefs

typedef void(* tfRbNewTrack) (int index, tTrack *track, void *carHandle, void **myCarSettings, tSituation *s)
 Callback function prototype for robot module, give the robot the track view, called for every track change or new race. More...
 
typedef void(* tfRbNewRace) (int index, tCarElt *car, tSituation *s)
 Callback function prototype for robot module, initialization for new race. More...
 
typedef void(* tfRbEndRace) (int index, tCarElt *car, tSituation *s)
 Callback function prototype for robot module, teardown after race, this is currently NOT called by TORCS. More...
 
typedef void(* tfRbDrive) (int index, tCarElt *car, tSituation *s)
 Callback function prototype for robot module, driving the car. More...
 
typedef void(* tfRbShutdown) (int index)
 Callback function prototype for robot module, shutdown robot instance for given index. More...
 
typedef int(* tfRbPitCmd) (int index, tCarElt *car, tSituation *s)
 Callback function prototype for robot module, handing over pit stop commands. More...
 
typedef struct RobotItf tRobotItf
 Interface Structure for Robots. More...
 

Detailed Description

Interface for robot modules, robot modules are discovered and loaded during runtime.

Multiple robot modules can be loaded at the same time, one robot module can host up to 10 instances of a robot. This is the call flow of the robots callbacks during a race event.
The square boxes are for the race manager and the ellipses are for the robot.

robot_call.gif

A detailed robot tutorial is available, visit www.torcs.org for details.

Typedef Documentation

◆ tfRbDrive

typedef void(* tfRbDrive) (int index, tCarElt *car, tSituation *s)

Callback function prototype for robot module, driving the car.

Parameters
[in]indexIndex of the robot instance
[in,out]carCar, the tCarCtrl is modified to return the driving commands
[in]sSituation

Definition at line 81 of file robot.h.

◆ tfRbEndRace

typedef void(* tfRbEndRace) (int index, tCarElt *car, tSituation *s)

Callback function prototype for robot module, teardown after race, this is currently NOT called by TORCS.

Parameters
[in]indexIndex of the robot instance
[in]carCar
[in]sSituation

Definition at line 73 of file robot.h.

◆ tfRbNewRace

typedef void(* tfRbNewRace) (int index, tCarElt *car, tSituation *s)

Callback function prototype for robot module, initialization for new race.

Parameters
[in]indexIndex of the robot instance
[in]carCar
[in]sSituation

Definition at line 65 of file robot.h.

◆ tfRbNewTrack

typedef void(* tfRbNewTrack) (int index, tTrack *track, void *carHandle, void **myCarSettings, tSituation *s)

Callback function prototype for robot module, give the robot the track view, called for every track change or new race.

Parameters
[in]indexIndex of the robot instance
[in]trackTrack
[in]carhandleOriginal car parameter set, intended for read only by the robot
[out]myCarSettingsRobot instance specific parameter set
[in]sSituation

Definition at line 57 of file robot.h.

◆ tfRbPitCmd

typedef int(* tfRbPitCmd) (int index, tCarElt *car, tSituation *s)

Callback function prototype for robot module, handing over pit stop commands.

Parameters
[in]indexIndex of the robot instance
[in,out]carCar, the tCarPitCmd is modified to return the pitstop commands (refuel, repair, setup changes)
[in]sSituation
Returns

Definition at line 98 of file robot.h.

◆ tfRbShutdown

typedef void(* tfRbShutdown) (int index)

Callback function prototype for robot module, shutdown robot instance for given index.

Parameters
[in]indexIndex of the robot instance

Definition at line 87 of file robot.h.

◆ tRobotItf

typedef struct RobotItf tRobotItf

Interface Structure for Robots.