TORCS robot driving

From SpaceElevatorWiki.com
Revision as of 09:09, 5 July 2008 by Wdb (talk | contribs) (New page: == '''How to drive a torcs car with a robot''' == After initializing all data, TORCS calls the drive function of the robot for each driving timestep. To drive a TORCS car, the robot has t...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

How to drive a torcs car with a robot

After initializing all data, TORCS calls the drive function of the robot for each driving timestep. To drive a TORCS car, the robot has to set the following values:

  • Acceleration
  • Brake pressure
  • Clutch
  • Gear
  • Steering angle

These values are part of the race command structure holding the data to be send to TORCS in the Drive-API-Call.

Acceleration, Brake pressure and Clutch are normalized to be values from 0 to 1. The corresponding acceleration is calculated from the engines data, read from a cartype specific setup file. The max brake pressure is initially set in this cartype specific setup file too, but may be redefined in a driver specific setup file merged with the initial settings of the cartype. The steering angle is scaled to be in -1 +1 range. The scaling is done with a cartype specific constant, the steerlock value. The Gear numbers include the reverse gear (0), the neutral gear (1) and than the other gears (2 = first, ...). The total number of gears is also cartype specific.