kart7990 / virtualpitwall

https://staging.virtualpitwall.com
Other
15 stars 7 forks source link

Add pitstop settings to API and more car setting details #48

Open elft3r opened 4 months ago

elft3r commented 4 months ago

Hey, I want to add a new feature to the pitwall, with which we can see the config for the next pitstop. We can then display this config in a component and use it as a baseline for calculating where the car will come back on track after pits.

It would be cool to have the following information:

{
  pitsOpen: boolean
  pitStopActive: boolean
  repairLeft: number
  optRepairLeft: number
  fastRepair: boolean
  windshieldTearoff: boolean
  fuelFillFlag: boolean
  fuelAddAmount: number
  fuelAutoFillEnabled: boolean
  fuelAutoFillActive: boolean
  PitSvTireCompound: number
  rfTireChange: boolean
  lfTireChange: boolean
  rrTireChange: boolean
  lrTireChange: boolean
  rfTireColdPressure: number
  lfTireColdPressure: number
  rrTireColdPressure: number
  lrTireColdPressure: number
}

In addition, it will also be nice to have the following information available. To give the driver more information about the current settings.

{
  abs: number
  absToggle: boolean
  tractionControl: number
  tractionControlToggle: boolean
  brakeBias: number
  pitSpeedLimiterToogle: boolean
}

The source for this information can be seen in the screenshots below.

Best, Jochen

WindowsClient-Blackbox-Pitstop WindowsClient-CurrentCar-1

kart7990 commented 4 months ago

Sounds good, how do you think is best to get this data to the client? Do you think it requires real time updates via a web socket? Or could it be requested on demand via http? What do you have in mind?

kart7990 commented 4 months ago

I think these properties make sense to include with the existing telemetry ws connection:

{
  abs: number
  absToggle: boolean
  tractionControl: number
  tractionControlToggle: boolean
  brakeBias: number
  pitSpeedLimiterToogle: boolean
}
elft3r commented 4 months ago

Sounds good, how do you think is best to get this data to the client? Do you think it requires real time updates via a web socket? Or could it be requested on demand via http? What do you have in mind?

It should also be done via a WebSocket, as this data should be pushed to the browser when updated. But this would, from my understanding, be less frequently triggered. I don't know the backend implementation, but we could only send the data to the browser when the information changes.

Alternatively, you could add it to the telemetry endpoint for now as a pitstop attribute or something like that.

elft3r commented 3 months ago

I added the PitSvTireCompound value, as this is now interesting with the rain. Although for some cars it was already interesting before 😅