Interface for robot modules, robot modules are discovered and loaded during runtime.
More...
|
| file | robot.h |
| | Robot Module Interface Definition.
|
| |
|
| 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...
|
| |
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.
A detailed robot tutorial is available, visit www.torcs.org for details.
◆ tfRbDrive
Callback function prototype for robot module, driving the car.
- Parameters
-
| [in] | index | Index of the robot instance |
| [in,out] | car | Car, the tCarCtrl is modified to return the driving commands |
| [in] | s | Situation |
Definition at line 81 of file robot.h.
◆ tfRbEndRace
Callback function prototype for robot module, teardown after race, this is currently NOT called by TORCS.
- Parameters
-
| [in] | index | Index of the robot instance |
| [in] | car | Car |
| [in] | s | Situation |
Definition at line 73 of file robot.h.
◆ tfRbNewRace
Callback function prototype for robot module, initialization for new race.
- Parameters
-
| [in] | index | Index of the robot instance |
| [in] | car | Car |
| [in] | s | Situation |
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] | index | Index of the robot instance |
| [in] | track | Track |
| [in] | carhandle | Original car parameter set, intended for read only by the robot |
| [out] | myCarSettings | Robot instance specific parameter set |
| [in] | s | Situation |
Definition at line 57 of file robot.h.
◆ tfRbPitCmd
Callback function prototype for robot module, handing over pit stop commands.
- Parameters
-
| [in] | index | Index of the robot instance |
| [in,out] | car | Car, the tCarPitCmd is modified to return the pitstop commands (refuel, repair, setup changes) |
| [in] | s | Situation |
- 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] | index | Index of the robot instance |
Definition at line 87 of file robot.h.
◆ tRobotItf
Interface Structure for Robots.