telemetry

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

README

The generator is a program in codegen. Running make generate should run this, along with the all of the other generators in this repository.

The core configuration is in schema/telemetry_definitions.yaml. The top level is a sequence of mappings, each with the following fields:

Name Type Required Description Example
teslaField string yes Value of the Tesla Field enum. DriveRail
teslaType string yes Standard protobuf type for value in Datums with the given field as its key. string
teslaUnit string no VSS unit for the Tesla value, which should be numeric mph
vssSignals sequence of strings no Full paths for the target VSS signals. [Vehicle.Powertrain.TractionBattery.Charging.IsCharging]

The code generator tries to be helpful in two ways:

  1. If a unit is specified on both Tesla and VSS sides, then we'll attempt to automatically convert the units. So, for example, if teslaUnit is mi and the VSS unit is km then unit.MilesToKilometers will be applied.
  2. If we know how to parse teslaType from a string, then we'll accept both for the field. For example, if VehicleSpeed has Tesla type double and a value of "2.5" comes in then we'll convert this to the floating point number 2.5.

Each combination of Tesla field and VSS signal gets an entry in inner_convert_funcs_gen.go, and edits to these functions will be preserved across invocations of make generate.

Documentation

Overview

Package telemetry converts batches of Tesla protobuf Payloads into VSS signals.

Code generated by github.com/DIMO-Network/model-garage DO NOT EDIT.

Index

Constants

View Source
const DataVersion = "fleet_telemetry/v1.0.0"

Variables

This section is empty.

Functions

func ConvertACChargingPowerToPowertrainTractionBatteryCurrentPower added in v0.6.2

func ConvertACChargingPowerToPowertrainTractionBatteryCurrentPower(val float64) (float64, error)

ConvertACChargingPowerToPowertrainTractionBatteryCurrentPower converts a telemetry datum with key ACChargingPower to the VSS signal PowertrainTractionBatteryCurrentPower. The input value is expressed in W.

func ConvertChargeAmpsToPowertrainTractionBatteryChargingChargeCurrentAC added in v0.6.2

func ConvertChargeAmpsToPowertrainTractionBatteryChargingChargeCurrentAC(val float64) (float64, error)

ConvertChargeAmpsToPowertrainTractionBatteryChargingChargeCurrentAC converts a telemetry datum with key ChargeAmps to the VSS signal PowertrainTractionBatteryChargingChargeCurrentAC. The input value is expressed in A.

func ConvertChargeLimitSocToPowertrainTractionBatteryChargingChargeLimit added in v0.6.2

func ConvertChargeLimitSocToPowertrainTractionBatteryChargingChargeLimit(val int32) (float64, error)

ConvertChargeLimitSocToPowertrainTractionBatteryChargingChargeLimit converts a telemetry datum with key ChargeLimitSoc to the VSS signal PowertrainTractionBatteryChargingChargeLimit. The input value is expressed in percent.

func ConvertChargerVoltageToPowertrainTractionBatteryChargingChargeVoltageUnknownType added in v0.6.2

func ConvertChargerVoltageToPowertrainTractionBatteryChargingChargeVoltageUnknownType(val float64) (float64, error)

ConvertChargerVoltageToPowertrainTractionBatteryChargingChargeVoltageUnknownType converts a telemetry datum with key ChargerVoltage to the VSS signal PowertrainTractionBatteryChargingChargeVoltageUnknownType. The input value is expressed in V.

func ConvertDCChargingEnergyInToPowertrainTractionBatteryChargingAddedEnergy added in v0.6.2

func ConvertDCChargingEnergyInToPowertrainTractionBatteryChargingAddedEnergy(val float64) (float64, error)

ConvertDCChargingEnergyInToPowertrainTractionBatteryChargingAddedEnergy converts a telemetry datum with key DCChargingEnergyIn to the VSS signal PowertrainTractionBatteryChargingAddedEnergy. The input value is expressed in kWh.

func ConvertDCChargingPowerToPowertrainTractionBatteryCurrentPower added in v0.6.2

func ConvertDCChargingPowerToPowertrainTractionBatteryCurrentPower(val float64) (float64, error)

ConvertDCChargingPowerToPowertrainTractionBatteryCurrentPower converts a telemetry datum with key DCChargingPower to the VSS signal PowertrainTractionBatteryCurrentPower. The input value is expressed in W.

func ConvertDetailedChargeStateToPowertrainTractionBatteryChargingIsCharging added in v0.6.2

func ConvertDetailedChargeStateToPowertrainTractionBatteryChargingIsCharging(val protos.DetailedChargeStateValue) (float64, error)

ConvertDetailedChargeStateToPowertrainTractionBatteryChargingIsCharging converts a telemetry datum with key DetailedChargeState to the VSS signal PowertrainTractionBatteryChargingIsCharging.

func ConvertDoorStateToCabinDoorRow1DriverSideIsOpen added in v0.6.2

func ConvertDoorStateToCabinDoorRow1DriverSideIsOpen(val *protos.Doors) (float64, error)

ConvertDoorStateToCabinDoorRow1DriverSideIsOpen converts a telemetry datum with key DoorState to the VSS signal CabinDoorRow1DriverSideIsOpen.

func ConvertDoorStateToCabinDoorRow1PassengerSideIsOpen added in v0.6.2

func ConvertDoorStateToCabinDoorRow1PassengerSideIsOpen(val *protos.Doors) (float64, error)

ConvertDoorStateToCabinDoorRow1PassengerSideIsOpen converts a telemetry datum with key DoorState to the VSS signal CabinDoorRow1PassengerSideIsOpen.

func ConvertDoorStateToCabinDoorRow2DriverSideIsOpen added in v0.6.2

func ConvertDoorStateToCabinDoorRow2DriverSideIsOpen(val *protos.Doors) (float64, error)

ConvertDoorStateToCabinDoorRow2DriverSideIsOpen converts a telemetry datum with key DoorState to the VSS signal CabinDoorRow2DriverSideIsOpen.

func ConvertDoorStateToCabinDoorRow2PassengerSideIsOpen added in v0.6.2

func ConvertDoorStateToCabinDoorRow2PassengerSideIsOpen(val *protos.Doors) (float64, error)

ConvertDoorStateToCabinDoorRow2PassengerSideIsOpen converts a telemetry datum with key DoorState to the VSS signal CabinDoorRow2PassengerSideIsOpen.

func ConvertEnergyRemainingToPowertrainTractionBatteryStateOfChargeCurrentEnergy added in v0.6.2

func ConvertEnergyRemainingToPowertrainTractionBatteryStateOfChargeCurrentEnergy(val float64) (float64, error)

ConvertEnergyRemainingToPowertrainTractionBatteryStateOfChargeCurrentEnergy converts a telemetry datum with key EnergyRemaining to the VSS signal PowertrainTractionBatteryStateOfChargeCurrentEnergy. The input value is expressed in kWh.

func ConvertEstBatteryRangeToPowertrainRange added in v0.6.2

func ConvertEstBatteryRangeToPowertrainRange(val float64) (float64, error)

ConvertEstBatteryRangeToPowertrainRange converts a telemetry datum with key EstBatteryRange to the VSS signal PowertrainRange. The input value is expressed in km.

func ConvertFdWindowToCabinDoorRow1DriverSideWindowIsOpen added in v0.6.2

func ConvertFdWindowToCabinDoorRow1DriverSideWindowIsOpen(val protos.WindowState) (float64, error)

ConvertFdWindowToCabinDoorRow1DriverSideWindowIsOpen converts a telemetry datum with key FdWindow to the VSS signal CabinDoorRow1DriverSideWindowIsOpen.

func ConvertFpWindowToCabinDoorRow1PassengerSideWindowIsOpen added in v0.6.2

func ConvertFpWindowToCabinDoorRow1PassengerSideWindowIsOpen(val protos.WindowState) (float64, error)

ConvertFpWindowToCabinDoorRow1PassengerSideWindowIsOpen converts a telemetry datum with key FpWindow to the VSS signal CabinDoorRow1PassengerSideWindowIsOpen.

func ConvertLocationToCurrentLocationLatitude added in v0.6.2

func ConvertLocationToCurrentLocationLatitude(val *protos.LocationValue) (float64, error)

ConvertLocationToCurrentLocationLatitude converts a telemetry datum with key Location to the VSS signal CurrentLocationLatitude.

func ConvertLocationToCurrentLocationLongitude added in v0.6.2

func ConvertLocationToCurrentLocationLongitude(val *protos.LocationValue) (float64, error)

ConvertLocationToCurrentLocationLongitude converts a telemetry datum with key Location to the VSS signal CurrentLocationLongitude.

func ConvertOdometerToPowertrainTransmissionTravelledDistance added in v0.6.2

func ConvertOdometerToPowertrainTransmissionTravelledDistance(val float64) (float64, error)

ConvertOdometerToPowertrainTransmissionTravelledDistance converts a telemetry datum with key Odometer to the VSS signal PowertrainTransmissionTravelledDistance. The input value is expressed in km.

func ConvertOutsideTempToExteriorAirTemperature added in v0.6.2

func ConvertOutsideTempToExteriorAirTemperature(val float64) (float64, error)

ConvertOutsideTempToExteriorAirTemperature converts a telemetry datum with key OutsideTemp to the VSS signal ExteriorAirTemperature. The input value is expressed in celsius.

func ConvertRdWindowToCabinDoorRow2DriverSideWindowIsOpen added in v0.6.2

func ConvertRdWindowToCabinDoorRow2DriverSideWindowIsOpen(val protos.WindowState) (float64, error)

ConvertRdWindowToCabinDoorRow2DriverSideWindowIsOpen converts a telemetry datum with key RdWindow to the VSS signal CabinDoorRow2DriverSideWindowIsOpen.

func ConvertRpWindowToCabinDoorRow2PassengerSideWindowIsOpen added in v0.6.2

func ConvertRpWindowToCabinDoorRow2PassengerSideWindowIsOpen(val protos.WindowState) (float64, error)

ConvertRpWindowToCabinDoorRow2PassengerSideWindowIsOpen converts a telemetry datum with key RpWindow to the VSS signal CabinDoorRow2PassengerSideWindowIsOpen.

func ConvertSocToPowertrainTractionBatteryStateOfChargeCurrent added in v0.6.2

func ConvertSocToPowertrainTractionBatteryStateOfChargeCurrent(val float64) (float64, error)

ConvertSocToPowertrainTractionBatteryStateOfChargeCurrent converts a telemetry datum with key Soc to the VSS signal PowertrainTractionBatteryStateOfChargeCurrent. The input value is expressed in percent.

func ConvertTpmsPressureFlToChassisAxleRow1WheelLeftTirePressure added in v0.6.2

func ConvertTpmsPressureFlToChassisAxleRow1WheelLeftTirePressure(val float64) (float64, error)

ConvertTpmsPressureFlToChassisAxleRow1WheelLeftTirePressure converts a telemetry datum with key TpmsPressureFl to the VSS signal ChassisAxleRow1WheelLeftTirePressure. The input value is expressed in kPa.

func ConvertTpmsPressureFrToChassisAxleRow1WheelRightTirePressure added in v0.6.2

func ConvertTpmsPressureFrToChassisAxleRow1WheelRightTirePressure(val float64) (float64, error)

ConvertTpmsPressureFrToChassisAxleRow1WheelRightTirePressure converts a telemetry datum with key TpmsPressureFr to the VSS signal ChassisAxleRow1WheelRightTirePressure. The input value is expressed in kPa.

func ConvertTpmsPressureRlToChassisAxleRow2WheelLeftTirePressure added in v0.6.2

func ConvertTpmsPressureRlToChassisAxleRow2WheelLeftTirePressure(val float64) (float64, error)

ConvertTpmsPressureRlToChassisAxleRow2WheelLeftTirePressure converts a telemetry datum with key TpmsPressureRl to the VSS signal ChassisAxleRow2WheelLeftTirePressure. The input value is expressed in kPa.

func ConvertTpmsPressureRrToChassisAxleRow2WheelRightTirePressure added in v0.6.2

func ConvertTpmsPressureRrToChassisAxleRow2WheelRightTirePressure(val float64) (float64, error)

ConvertTpmsPressureRrToChassisAxleRow2WheelRightTirePressure converts a telemetry datum with key TpmsPressureRr to the VSS signal ChassisAxleRow2WheelRightTirePressure. The input value is expressed in kPa.

func ConvertVehicleSpeedToSpeed added in v0.6.2

func ConvertVehicleSpeedToSpeed(val float64) (float64, error)

ConvertVehicleSpeedToSpeed converts a telemetry datum with key VehicleSpeed to the VSS signal Speed. The input value is expressed in km/h.

func FingerprintConvert

func FingerprintConvert(event cloudevent.RawEvent) (cloudevent.Fingerprint, error)

FingerprintConvert extracts a fingerprint from the first Fleet Telemetry protobuf Payload. We expect this to always succeed.

func IsFingerprint

func IsFingerprint(event cloudevent.RawEvent) bool

IsFingerprint returns whether the Fleet Telemetry batch contains an extractable VIN. This should always return true.

func ProcessPayload added in v0.5.4

func ProcessPayload(payload *protos.Payload, tokenID uint32, source string) ([]vss.Signal, []error)

func SignalConvert

func SignalConvert(event cloudevent.RawEvent) ([]vss.Signal, error)

SignalConvert converts a CloudEvent containing a batch of Fleet Telemetry protobuf Payloads into DIMO's VSS rows.

Types

type TelemetryData

type TelemetryData struct {
	Payloads [][]byte `json:"payloads"`
}

Directories

Path Synopsis
Package main contains the code generation command for transforming a definitions file into code that executes a conversion from Tesla Fleet Telemetry protobufs into VSS signals.
Package main contains the code generation command for transforming a definitions file into code that executes a conversion from Tesla Fleet Telemetry protobufs into VSS signals.
Package parse contains functions for parsing typed Tesla values out of strings.
Package parse contains functions for parsing typed Tesla values out of strings.
Package schema merely embeds the definitions file for conversions from Tesla Fleet Telemetry to VSS signals.
Package schema merely embeds the definitions file for conversions from Tesla Fleet Telemetry to VSS signals.
Package unit converts between commonly used units of measure for vehicle signals.
Package unit converts between commonly used units of measure for vehicle signals.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL