Author Topic: Proxy plugin  (Read 9380 times)

HornetMaX

  • Hero Member
  • *****
  • Posts: 5925
    • View Profile
Re: Proxy plugin
« Reply #15 on: March 13, 2016, 08:59:59 AM »
Quick question: at which frequency is the default proxy plugin data updated ?
Custom plugins can specify that at 10/20/50/100 Hz, but what about the default proxy.dlo ?

The sample code you provide (http://www.gp-bikes.com/downloads/gpb_proxy.c) seems to read from a proxy.ini file: is that the case for the default proxy.dlo ?

The default is 10hz.

OK. Can it be changed with a proxy.ini ?

PiBoSo

  • Administrator
  • Hero Member
  • *****
  • Posts: 2801
    • View Profile
Re: Proxy plugin
« Reply #16 on: March 13, 2016, 11:12:27 AM »

As the source code shows:
1) create a file named proxy.ini in the "plugins" folder
2) add the following lines:
Code: [Select]
[params]
sample_rate = 50

You can check in the source code that the supported values are 10, 20, 50 and 100.
"Obviously your ambition outweighs your talent".

HornetMaX

  • Hero Member
  • *****
  • Posts: 5925
    • View Profile
Re: Proxy plugin
« Reply #17 on: March 13, 2016, 03:43:16 PM »
Thx ! Wasn't sure of the example code was the one in use in proxy.dlo.

PiBoSo

  • Administrator
  • Hero Member
  • *****
  • Posts: 2801
    • View Profile
Re: Proxy plugin
« Reply #18 on: September 30, 2016, 07:58:43 PM »

Source code updated to the latest interface.
"Obviously your ambition outweighs your talent".

PiBoSo

  • Administrator
  • Hero Member
  • *****
  • Posts: 2801
    • View Profile
Re: Proxy plugin
« Reply #19 on: February 16, 2017, 10:50:50 PM »

Source code updated to the latest interface.
"Obviously your ambition outweighs your talent".

PiBoSo

  • Administrator
  • Hero Member
  • *****
  • Posts: 2801
    • View Profile
Re: Proxy plugin
« Reply #20 on: January 20, 2018, 01:26:09 PM »

Source code updated to the latest interface.
"Obviously your ambition outweighs your talent".

PiBoSo

  • Administrator
  • Hero Member
  • *****
  • Posts: 2801
    • View Profile
Re: Proxy plugin
« Reply #21 on: July 13, 2018, 03:30:23 PM »

Source code updated to the latest interface.
"Obviously your ambition outweighs your talent".

Fightone

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Proxy plugin
« Reply #22 on: December 11, 2018, 03:03:07 AM »
Hey guys, can you please help me out?
Sorry for possibly a noob question but I'm tad confused. I'm using Max's test code from the first page and getting the data, but it's in some strange format like this when starting the bike:

''Speed940.48Kmh
Revs1117953633Rpm
State: 2
Speed938.721Kmh
Revs1117925790Rpm
State: 2
Speed936.422Kmh
Revs1117905668Rpm
State: 1""

So data isn't too realistic.

So what am I doing wrong here, is the data in some specific format?

« Last Edit: December 12, 2018, 06:12:37 PM by Fightone »

HornetMaX

  • Hero Member
  • *****
  • Posts: 5925
    • View Profile
Re: Proxy plugin
« Reply #23 on: December 21, 2018, 10:44:45 AM »
Hi,

I don't have the time to look into this, hence just speculating: looks like garbage, so potentially data structure misalignment.
Have you compiled your app as x64 ?

Fightone

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Proxy plugin
« Reply #24 on: December 26, 2018, 02:05:21 AM »
Hi,

I don't have the time to look into this, hence just speculating: looks like garbage, so potentially data structure misalignment.
Have you compiled your app as x64 ?
Just tried x64, no change.
Ye, apparently something with data structure but I've just copy pasted structure code posted by Piboso so no idea really where mistake can be.

HornetMaX

  • Hero Member
  • *****
  • Posts: 5925
    • View Profile
Re: Proxy plugin
« Reply #25 on: December 26, 2018, 10:31:02 AM »
Will have to have a look. Won't happen before a week or two.

Fightone

  • Newbie
  • *
  • Posts: 28
    • View Profile
Re: Proxy plugin
« Reply #26 on: December 26, 2018, 07:32:09 PM »
Thanks Max, I appreciate it!
I just have a feeling something obvious is missed so maybe second look can help. Insterestingly though, state parameter of the structure is read well, problem is just with telemetry data.
I can post a code but there's just copy paste from Piboso's and your code from the first page.
« Last Edit: December 26, 2018, 07:35:50 PM by Fightone »

HornetMaX

  • Hero Member
  • *****
  • Posts: 5925
    • View Profile
Re: Proxy plugin
« Reply #27 on: January 12, 2019, 04:27:13 PM »
Thanks Max, I appreciate it!
I just have a feeling something obvious is missed so maybe second look can help. Insterestingly though, state parameter of the structure is read well, problem is just with telemetry data.
I can post a code but there's just copy paste from Piboso's and your code from the first page.
Just tested it, works fine for me.

Be sure to:
  • Compile as x64.
  • Use latest definitiopns for data structures (the ones I currently use are below).

Code: [Select]
typedef struct
{
char m_szRiderName[100];
char m_szBikeID[100];
char m_szBikeName[100];
int m_iNumberOfGears;
int m_iMaxRPM;
int m_iLimiter;
int m_iShiftRPM;
float m_fEngineOptTemperature; /* degrees Celsius */
float m_afEngineTemperatureAlarm[2]; /* degrees Celsius. Lower and upper limits */
float m_fMaxFuel; /* fuel tank capacity. liters */
float m_afSuspMaxTravel[2]; /* maximum travel of the shocks. meters. 0 = front; 1 = rear. */
float m_fSteerLock; /* degrees */
char m_szCategory[100];
char m_szTrackID[100];
char m_szTrackName[100];
float m_fTrackLength; /* centerline length. meters */
int m_iType; /* 1 = testing; 2 = race */
} SPluginsBikeEvent_t;

typedef struct
{
int m_iSession; /* testing: always 0. Race: 0 = waiting; 1 = practice; 2 = qualify; 3 = warmup; 4 = race */
int m_iConditions; /* 0 = sunny; 1 = cloudy; 2 = rainy */
float m_fAirTemperature; /* degrees Celsius */
float m_fTrackTemperature; /* degrees Celsius */
char m_szSetupFileName[100];
} SPluginsBikeSession_t;

typedef struct
{
int m_iRPM; /* engine rpm */
float m_fEngineTemperature; /* degrees Celsius */
float m_fWaterTemperature; /* degrees Celsius */
int m_iGear; /* 0 = Neutral */
float m_fFuel; /* liters */
float m_fSpeedometer; /* meters/second */
float m_fPosX,m_fPosY,m_fPosZ; /* world position of a reference point attached to chassis ( not CG ) */
float m_fVelocityX,m_fVelocityY,m_fVelocityZ; /* velocity of CG in world coordinates. meters/second */
float m_fAccelerationX,m_fAccelerationY,m_fAccelerationZ; /* acceleration of CG local to chassis rotation, expressed in G ( 9.81 m/s2 ) and averaged over the latest 10ms */
float m_aafRot[3][3]; /* rotation matrix of the chassis. It incorporates lean and wheeling */
float m_fYaw,m_fPitch,m_fRoll; /* degrees, -180 to 180 */
float m_fYawVelocity,m_fPitchVelocity,m_fRollVelocity; /* degress / second */
float m_afSuspLength[2]; /* shocks length. meters. 0 = front; 1 = rear. */
float m_afSuspVelocity[2]; /* shocks velocity. meters/second. 0 = front; 1 = rear */
int m_iCrashed; /* 1 = rider is detached from bike */
float m_fSteer; /* degrees. Negative = right  */
float m_fThrottle; /* 0 to 1 */
float m_fFrontBrake; /* 0 to 1 */
float m_fRearBrake; /* 0 to 1 */
float m_fClutch; /* 0 to 1. 0 = Fully engaged */
float m_afWheelSpeed[2]; /* meters/second. 0 = front; 1 = rear */
int m_aiWheelMaterial[2]; /* material index. 0 = not in contact */
float m_fSteerTorque; /* Nm */
int m_iPitLimiter; /* 1 = pit limiter is activated */
int m_iECUMode; /* 0 = engine mapping; 1 = traction control; 2 = engine braking */
char m_szEngineMapping[3];
int m_iTractionControl;
int m_iEngineBraking;
int m_iAntiWheeling;
int m_iECUState; /* bit field. Bit 1 = TC active; bit 2 = engine braking active; bit 3 = antiwheeling active */
} SPluginsBikeData_t;

typedef struct
{
int m_iLapNum; /* lap index */
int m_iInvalid;
int m_iLapTime; /* milliseconds */
int m_iBest; /* 1 = best lap */
} SPluginsBikeLap_t;

typedef struct
{
int m_iSplit; /* split index */
int m_iSplitTime; /* milliseconds */
int m_iBestDiff; /* milliseconds. Difference with best lap */
} SPluginsBikeSplit_t;

typedef struct
{
int m_iVersion;
int m_iState; /* -1: software not running; 0: software running; 1: on-track, simulation paused; 2: on-track, simulation running */
SPluginsBikeEvent_t m_sEvent;
SPluginsBikeSession_t m_sSession;
SPluginsBikeLap_t m_sLap;
int m_iSplit;
SPluginsBikeSplit_t m_sSplit;
SPluginsBikeData_t m_sData;
float m_fTime;
float m_fPos;
} SProxyData_t;