Skip to content

Channels and units ​

racingmagick resolves raw logger channels into canonical channel names and normalized engineering units.

Resolution pipeline ​

For each raw channel:

  1. normalize the raw name: lowercase, strip punctuation, handle spaces/underscores
  2. match against ordered alias lists
  3. pick the highest-priority alias for each canonical channel
  4. apply the channel's unit transform
  5. store the result in the ChannelMatrix

Example:

ts
resolveChannelName('Brake_Pressure_Front') // 'brakePressure'
resolveChannelName('Corr Speed')           // 'speed'
resolveChannelName('FBWDriverTPS')         // 'throttle'

Public channel catalog API ​

ts
import {
  canonicalChannelNames,
  getCanonicalUnit,
  getChannelDefinition,
  resolveChannelName,
} from 'racingmagick';

console.log(canonicalChannelNames());
console.log(getCanonicalUnit('speed'));              // km/h
console.log(getChannelDefinition('speed')?.aliases); // alias priority list
console.log(resolveChannelName('Vehicle_Speed'));    // speed

Core channels ​

CanonicalUnitRequiredNotes
timesyesgenerated if missing
distancemyesintegrated from speed if missing
trackPositionratioyes0..1, GPS or distance derived
speedkm/hyesvehicle/reference speed
throttleratioyesdriver demand, fallback from actual throttle if needed

Common optional channels ​

CanonicalUnitMeaning
rpmrpmengine speed
geargearselected gear
throttleActualratiopost-TC/actual throttle
brakePedalratiobrake pedal position
brakePressurebarfront brake pressure
brakePressureRearbarrear brake pressure
clutchPedalratioclutch pedal
steeringdegsteering angle
gLongglongitudinal acceleration
gLatglateral acceleration
headingdegGPS/vehicle heading
yawRatedeg/syaw rate

GPS channels ​

CanonicalUnit
gpsLatdeg
gpsLondeg
gpsAltm
gpsSpeedkm/h
gpsSatellitescount
gpsFixfix

Coordinates are converted to decimal degrees when the parser detects a supported non-decimal coordinate system.

Wheel, damper, and tire channels ​

Canonical groupUnit
wheelSpeedFL/FR/RL/RRkm/h
damperFL/FR/RL/RRmm
tirePressureFL/FR/RL/RRbar
tireTempFL/FR/RL/RR°C
tireSlipAngleFL/FR/RL/RRdeg
tireSlipRatioFL/FR/RL/RRratio
tireWearFL/FR/RL/RRratio
tireLoadFL/FR/RL/RRN

Unit normalization examples ​

QuantityAccepted source unitsNormalized unit
speedkm/h, m/s, mph, knotskm/h
ratio%, percent, ratio, empty percentage-like valuesratio
pressurebar, psi, kPa, MPa, mbar, Pabar
accelerationg, m/s2, m/s²g
angledeg, raddeg
yaw ratedeg/s, rad/sdeg/s
distancem, km, mi, ftm
temperatureC, F, K°C
damper travelmm, cm, m, inmm
loadN, kN, lbf, kgfN

Throttle semantics ​

Different systems record different throttle meanings:

  • driver pedal demand
  • throttle plate position
  • post-traction-control actual throttle

The canonical policy is:

  1. if a driver throttle channel exists, it becomes throttle
  2. if actual/post-TC throttle also exists, it becomes throttleActual
  3. if only actual/post-TC throttle exists, it is used as throttle and a throttle-fallback warning is emitted

This keeps the required API usable while preserving information when both signals exist.

Custom channels ​

Unrecognized channels are preserved with sanitized names:

ts
const custom = session.channel('custom_sensor_42');

If a custom raw name collides with a canonical channel, it is prefixed internally to avoid ambiguous access.