Skip to content

Commit

Permalink
Merge pull request #10 from vwhitteron/april-2024-vehicle-update
Browse files Browse the repository at this point in the history
April 2024 vehicle update
  • Loading branch information
vwhitteron authored May 1, 2024
2 parents c8d555d + 3f17c9d commit 33df15a
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 13 deletions.
2 changes: 1 addition & 1 deletion internal/telemetrysrc/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

var packetHeader = []byte{0x30, 0x53, 0x37, 0x47}

const packetInterval = (1000 * (1000 / 60)) * time.Microsecond
const packetInterval = (1000 / 60) * time.Millisecond

type FileReader struct {
fileContent *bufio.Scanner
Expand Down
77 changes: 77 additions & 0 deletions internal/vehicles/inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@
"OpenCockpit": false,
"CarType": "street"
},
"30": {
"Model": "Chevelle SS 454 '70",
"Manufacturer": "Chevrolet",
"Category": "",
"Drivetrain": "FR",
"Aspiration": "NA",
"Year": 1970,
"CarID": 30,
"OpenCockpit": false,
"CarType": "street"
},
"31": {
"Model": "Camaro Z28 '69",
"Manufacturer": "Chevrolet",
Expand Down Expand Up @@ -1088,6 +1099,17 @@
"OpenCockpit": false,
"CarType": "street"
},
"1553": {
"Model": "XJ13 '66",
"Manufacturer": "Jaguar",
"Category": "",
"Drivetrain": "MR",
"Aspiration": "NA",
"Year": 1966,
"CarID": 1553,
"OpenCockpit": true,
"CarType": "race"
},
"1562": {
"Model": "LFA '10",
"Manufacturer": "Lexus",
Expand All @@ -1110,6 +1132,17 @@
"OpenCockpit": false,
"CarType": "race"
},
"1565": {
"Model": "Mark IV Race Car '67",
"Manufacturer": "Ford",
"Category": "",
"Drivetrain": "MR",
"Aspiration": "NA",
"Year": 1967,
"CarID": 1565,
"OpenCockpit": false,
"CarType": "race"
},
"1578": {
"Model": "8C Competizione '08",
"Manufacturer": "Alfa Romeo",
Expand Down Expand Up @@ -1979,6 +2012,17 @@
"OpenCockpit": false,
"CarType": "street"
},
"2171": {
"Model": "Huracán LP 610-4 '15",
"Manufacturer": "Lamborghini",
"Category": "",
"Drivetrain": "4WD",
"Aspiration": "NA",
"Year": 2015,
"CarID": 2171,
"OpenCockpit": false,
"CarType": "street"
},
"2172": {
"Model": "DS 3 Racing '11",
"Manufacturer": "DS AUTOMOBILES",
Expand Down Expand Up @@ -3396,6 +3440,17 @@
"Year": 2020,
"CarID": 3414,
"OpenCockpit": false,
"CarType": "race"
},
"3417": {
"Model": "Jaguar VGT SV",
"Manufacturer": "Jaguar",
"Category": "",
"Drivetrain": "4WD",
"Aspiration": "EV",
"Year": 2021,
"CarID": 3417,
"OpenCockpit": false,
"CarType": "street"
},
"3418": {
Expand Down Expand Up @@ -4311,6 +4366,17 @@
"OpenCockpit": false,
"CarType": "street"
},
"3542": {
"Model": "ŠKODA VGT",
"Manufacturer": "Škoda",
"Category": "",
"Drivetrain": "4WD",
"Aspiration": "EV",
"Year": 2024,
"CarID": 3542,
"OpenCockpit": true,
"CarType": "race"
},
"3543": {
"Model": "Genesis X Gran Berlinetta VGT Concept",
"Manufacturer": "Genesis",
Expand All @@ -4333,6 +4399,17 @@
"OpenCockpit": false,
"CarType": "street"
},
"3546": {
"Model": "AFEELA Prototype 2024",
"Manufacturer": "AFEELA",
"Category": "",
"Drivetrain": "4WD",
"Aspiration": "EV",
"Year": 2024,
"CarID": 3546,
"OpenCockpit": false,
"CarType": "street"
},
"3547": {
"Model": "R4 GTL '85",
"Manufacturer": "Renault",
Expand Down
24 changes: 12 additions & 12 deletions transformer.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,30 +358,30 @@ func (t *transformer) TurboBoostBar() float32 {
}

func (t *transformer) TyreDiameterMeters() CornerSet {
diameter := t.RawTelemetry.TyreRadius
if diameter == nil {
radius := t.RawTelemetry.TyreRadius
if radius == nil {
return CornerSet{}
}

return CornerSet{
FrontLeft: diameter.FrontLeft * 2,
FrontRight: diameter.FrontRight * 2,
RearLeft: diameter.RearLeft * 2,
RearRight: diameter.RearRight * 2,
FrontLeft: radius.FrontLeft * 2,
FrontRight: radius.FrontRight * 2,
RearLeft: radius.RearLeft * 2,
RearRight: radius.RearRight * 2,
}
}

func (t *transformer) TyreRadiusMeters() CornerSet {
diameter := t.RawTelemetry.TyreRadius
if diameter == nil {
radius := t.RawTelemetry.TyreRadius
if radius == nil {
return CornerSet{}
}

return CornerSet{
FrontLeft: diameter.FrontLeft,
FrontRight: diameter.FrontRight,
RearLeft: diameter.RearLeft,
RearRight: diameter.RearRight,
FrontLeft: radius.FrontLeft,
FrontRight: radius.FrontRight,
RearLeft: radius.RearLeft,
RearRight: radius.RearRight,
}
}

Expand Down

0 comments on commit 33df15a

Please sign in to comment.