Skip to main content

Module ldm_constants

Module ldm_constants 

Source
Expand description

LDM constants — ITS-AID values, epoch offset and spatial helpers.

Mirrors the constant definitions spread across flexstack/facilities/local_dynamic_map/ in the Python reference.

§Haversine fix

The Python reference implementation computed spatial distances using raw ETSI integer values (tenths-of-microdegrees) without unit conversion, producing meaningless metre-scale thresholds that were actually in the ~1e7 range. The haversine_m function here converts both coordinates to degrees first, then applies the standard Haversine formula over the WGS-84 sphere, giving correct distances in metres.

Constants§

EARTH_RADIUS_M
Earth mean radius in metres (WGS-84 approximation used for Haversine).
ITS_AID_CAM
ITS_AID_CRL
ITS_AID_CRT
ITS_AID_DENM
ITS-S application identifiers (ETSI TS 102 965).
ITS_AID_EEBL
ITS_AID_GNSS
ITS_AID_GPC
ITS_AID_IMZM
ITS_AID_IVI
ITS_AID_PAM
ITS_AID_POI
ITS_AID_SAEM
ITS_AID_SRM
ITS_AID_SSM
ITS_AID_TLC
ITS_AID_TPG
ITS_AID_VAM
ITS_EPOCH_MS
Milliseconds between UNIX epoch (1970-01-01) and the ITS epoch (2004-01-01). Used to convert std::time::SystemTime to ITS milliseconds.
MAINTENANCE_MAX_ALT_DIFF_CM
Maximum altitude difference (in cm) between an LDM record and the local station before the record is considered out-of-area for GC purposes. (Python reference had 15, which was in incorrect units.)

Functions§

haversine_m
Compute the great-circle distance in metres between two positions given as ETSI integer coordinates (tenths of microdegrees, i.e. × 10⁻⁷ degrees).
its_ms_to_unix_ms
Convert an ETSI timestamp (milliseconds since ITS epoch) to milliseconds since UNIX epoch.
now_its_ms
Return the current time as milliseconds since the ITS epoch (2004-01-01). Panics on platforms where SystemTime::now() is before the UNIX epoch (should never happen in practice).