TORCS  1.3.9
The Open Racing Car Simulator
wheel.h
Go to the documentation of this file.
1 /***************************************************************************
2 
3  file : wheel.h
4  created : Sun Mar 19 00:09:18 CET 2000
5  copyright : (C) 2000-2017 by Eric Espie, Bernhard Wymann
6  email : torcs@free.fr
7  version : $Id$
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 #ifndef _WHEEL_H__
21 #define _WHEEL_H__
22 
23 #include "differential.h"
24 
25 typedef struct
26 {
27 
28  /* internal data */
29  tSuspension susp; /* associated suspension */
30  tBrake brake; /* associated brake disk */
31 
32  /* dynamic */
33  t3Dd forces; /* forces acting on car */
34  tdble rollRes; /* Rolling Resistance (summed over the car) */
35  tdble rideHeight; /* height of the bottom of the car */
36  tdble zRoad; /* z of the road */
37  t3Dd pos; /* world related */
38  t3Dd bodyVel; /* world related */
39  tdble driveTq; /* engine torque */
41 
42  tdble spinTq; /* spin torque feedback */
43  tdble spinVel; /* spin velocity */
44  tdble prespinVel; /* spin velocity */
45  int state; /* wheel state */
46  /* 1 and 2 are for suspension state */
47 #define SIM_WH_ONAIR 4 /* the wheel has no contact to the ground although the suspension is not fully extended */
48  tdble axleFz; /* force from axle (anti-roll bar) */
49  tTrkLocPos trkPos; /* current track position */
50  t3Dd surfaceNormal; // Normal of the surface under this wheel
51  tPosd relPos; /* relative pos / GC */
52  tdble sa; /* slip angle */
53  tdble sx; /* longitudinal slip value */
55 
56  /* static */
57  tPosd staticPos; /* pos relative to the GC (z is suspension travel at rest) */
58  /* and angles are camber (ax), caster (ay) and toe (az) */
60 
61  tdble weight0; /* initial weight on this wheel */
65  tdble I; /* I = inertial moment of the wheel */
66  tdble curI; /* Current inertia for the wheel (including transmission) */
67  tdble mfC; /* Magic Formula C coeff */
68  tdble mfB; /* Magic Formula B coeff */
69  tdble mfE; /* Magic Formula E coeff */
70  tdble lfMax; /* Load factor */
71  tdble lfMin; /* Load factor */
72  tdble lfK; /* Load factor */
73  tdble opLoad; /* Operating load */
74  tdble mass; /* total wheel mass (incl. brake) (unsprung mass) */
75  tdble camber; /* camber, negative toward exterior on both sides */
76  tdble pressure; /* initial tire pressure, environment temperature */
77  tdble rel_vel; /* relative velocity - used for realstic suspension movement*/
78  tdble tirewidth; /* width of tire, used for surface property blending */
79 
82 
83  tdble preFn, preFt;
84 
85  // Additional parameters for the tire wear model
86  tdble treadMass; // Initial mass of the tread
87  tdble baseMass; // Mass of the tire minus the tread
88  tdble treadThinkness; // Thinkness of the initial tread (brand new tire)
89  tdble tireGasMass; // Mass of the gas in the tire (constant)
90  tdble tireConvectionSurface; // Surface area regarding the convection model
91  tdble initialTemperature; // Initial temperature of the tire (initial pressure, p0/T0=constant)
92  tdble hysteresisFactor; // Factor to adjust the hysteresis (model fitting), usually close to 1.0.
93  tdble wearFactor; // Factor to adjust the wear (model fitting), usually close to 1.0.
94  tdble idealTemperature; // Ideal tire temperature for best grip.
95 
96  // Dynamic Tire properties (temp, wear, etc.)
97  tdble currentPressure; // current tire pressure considering temperature
98  tdble currentTemperature; // current temperature
99  double currentWear; // [0..1], 1 means totally worn (tread thickness 0)
100  tdble currentGraining; // [0..1], 1 means totally grained
101  tdble currentGripFactor; // [0..1], 1 means best grip
102 
103  tdble tireSlip; // Slip of the tire from tire model calculation
104  tdble tireZForce; // Force on tire
105 
106 } tWheel;
107 
108 
109 
110 #endif /* _WHEEL_H__ */
111 
112 
113 
tdble opLoad
Definition: wheel.h:73
tdble initialTemperature
Definition: wheel.h:91
tdble sx
Definition: wheel.h:53
tdble currentTemperature
Definition: wheel.h:98
tdble tireZForce
Definition: wheel.h:104
tdble wearFactor
Definition: wheel.h:93
tDynAxis in
Definition: wheel.h:80
tdble prespinVel
Definition: wheel.h:44
tdble steer
Definition: wheel.h:54
tdble mfB
Definition: wheel.h:68
tdble hysteresisFactor
Definition: wheel.h:92
Location on the track in local coordinates.
Definition: track.h:418
tdble treadMass
Definition: wheel.h:86
tdble mfC
Definition: wheel.h:67
tdble rollRes
Definition: wheel.h:34
tdble lfMax
Definition: wheel.h:70
tdble lfK
Definition: wheel.h:72
tdble mu
Definition: wheel.h:64
tdble tireSlip
Definition: wheel.h:103
tdble tireConvectionSurface
Definition: wheel.h:90
tdble curI
Definition: wheel.h:66
tdble spinTq
Definition: wheel.h:42
tdble rollCenter
Definition: wheel.h:59
tPosd relPos
Definition: wheel.h:51
tBrake brake
Definition: wheel.h:30
tSuspension susp
Definition: wheel.h:29
Definition: brake.h:22
tdble currentGripFactor
Definition: wheel.h:101
tdble mfE
Definition: wheel.h:69
tdble idealTemperature
Definition: wheel.h:94
tdble radius
Definition: wheel.h:63
tdble vt
Definition: wheel.h:40
tdble lfMin
Definition: wheel.h:71
tTrkLocPos trkPos
Definition: wheel.h:49
Definition: wheel.h:25
tdble zRoad
Definition: wheel.h:36
tdble pressure
Definition: wheel.h:76
double currentWear
Definition: wheel.h:99
tdble tireSpringRate
Definition: wheel.h:62
float tdble
Floating point type used in TORCS.
Definition: tgf.h:48
tPosd staticPos
Definition: wheel.h:57
t3Dd pos
Definition: wheel.h:37
tdble axleFz
Definition: wheel.h:48
tdble I
Definition: wheel.h:65
tdble currentGraining
Definition: wheel.h:100
tdble driveTq
Definition: wheel.h:39
tdble baseMass
Definition: wheel.h:87
tdble mass
Definition: wheel.h:74
t3Dd surfaceNormal
Definition: wheel.h:50
6 DOF position.
Definition: tgf.h:130
tdble rel_vel
Definition: wheel.h:77
tdble spinVel
Definition: wheel.h:43
tdble weight0
Definition: wheel.h:61
tdble treadThinkness
Definition: wheel.h:88
tdble rideHeight
Definition: wheel.h:35
tdble preFt
Definition: wheel.h:83
3D point.
Definition: tgf.h:115
tdble camber
Definition: wheel.h:75
tDynAxis feedBack
Definition: wheel.h:81
tdble tirewidth
Definition: wheel.h:78
tdble sa
Definition: wheel.h:52
t3Dd forces
Definition: wheel.h:33
t3Dd bodyVel
Definition: wheel.h:38
int state
Definition: wheel.h:45
tdble currentPressure
Definition: wheel.h:97
tdble tireGasMass
Definition: wheel.h:89