Plugin Tire Temp question

JohnW63

I am learning how to edit the plugin file for rFactor, and as a start, I am only outputing the tire temps. That part works, but the data I am getting is not what I expected. The units shown in the comments say that it should be in Celsius, but the numbers are coming out like this:

Wheel=FrontLeft
TireTemp(l/c/r)=362.5/362.5/362.5
Wheel=FrontRight
TireTemp(l/c/r)=362.4/362.4/362.5
Wheel=RearLeft
TireTemp(l/c/r)=362.4/362.4/362.4
Wheel=RearRight
TireTemp(l/c/r)=362.4/362.4/362.4

Now, I may be years out of college, but I'm pretty sure 362 Celsius is NEVER seen on a racing tire. The stock fprintf statement is:

fprintf( fo, " TireTemp(l/c/r)=%.1f/%.1f/%.1f\n", wheel.mTemperature[0], wheel.mTemperature[1], wheel.mTemperature[2] );

So, that is just a floating point number with a single digit passed the decimal.

Point me in the right direction please.
 
That works out better. Thanks.

It does make you wonder why they would use THAT scale, however.


John
 
Can someone please help me how to modify example internals plugin to get inside/center/outside tire temperatures instead of left/center/right?
 
I think you would need to determine which tire is being "scanned" and alter the order in the fprintf statement.

For instance, that for loop that tells about each tire is in a particular order.

info.mWheel[0] is front left, info.mWheel[1] is front left, info.mWheel[2] is rear left, and info.mWheel[3] is rear right.

For the left side tires, left/center/right is outside/center/inside. On a right side tire it would convert to inside/center/outside. So, the only tires you need to alter are the left side tires. You could use some string string manipulation functions to reverse the order of the output for those.
 
Replace

Code:
      fprintf( fo, " TireTemp(l/c/r)=%.1f/%.1f/%.1f\n", wheel.mTemperature[0], wheel.mTemperature[1], wheel.mTemperature[2] );

with

Code:
    if (i == 0 || i == 2) {
      fprintf( fo, " TireTemp(i/c/o)=%.1f/%.1f/%.1f\n", wheel.mTemperature[2], wheel.mTemperature[1], wheel.mTemperature[0] );
    }
    else {
      fprintf( fo, " TireTemp(i/c/o)=%.1f/%.1f/%.1f\n", wheel.mTemperature[0], wheel.mTemperature[1], wheel.mTemperature[2] );
    }

(this is 'the long way' of doing it... you can do it with much more compact code, but this better illustrates the concept...)
 
Thanks for reply. I understand that, but can you tell me what is the difference between left/center/right and inside/center/outside temperatures? I guess temperatures are the same? If i replace your code i get the same values, ofcourse

I thought inside/center/outside temperatures are different kind of tire temperatures from left/center/right

float mTemperature[3]; // Celsius, left/center/right (not to be confused with inside/center/outside!)
 
If you look from above at a car with all 4 wheels attatched, you will have:

- front left and rear left tyre
left = outside
right = inside

- front right and rear right tyre
left = inside
right = outside
 
yes yes i understand that :) i am just confused because i thought l/c/r are completly different kind of temperatures from i/c/o

Now i now they are the same :)
 
Oh, ok :)
No, they are the same and refer to surface temperatures of the tyres.
 
One more question. Is there any chance how to get blue flag from plugin?
 
xpolhecx, the only way I can think of to do a blue flag would be to monitor everyone's lap distance traveled and if one person is about to lap someone then you can assume there is a blue flag. But no there is no way to see if rF is sending a blue from the plugin.
 

Back
Top