API reference
OpenCRG.CRGData — Type
CRGDataAll data parsed from an OpenCRG file by read_crg. Fields:
comment:$CTcomment lines, joined with newlinesrefline: reference-line and long-section parameters from$ROAD_CRGformat_code: payload format, one of:LRFI,:LDFI,:KRBI,:KDBIopts: numeric$ROAD_CRG_OPTSentries, keyed by upper-cased namemods:$ROAD_CRG_MODSmodifiers (applied byroad_surface_grid, not here)mpro:$ROAD_CRG_MPROprojection entries as strings (parsed, never applied)phi: reference-line heading at eachurow (rad);phi[1]is the start headingbanking: cross slope at eachurow (m/m), ornothingif absentslope: longitudinal slope at eachurow (m/m), ornothingif absentv: lateral positions of the long sections, ascending (m, positive left)z: raw(nu, nv)elevation grid relative to the reference line (m); columns matchv
OpenCRG.read_crg — Method
read_crg(path) -> CRGDataParse the OpenCRG .crg file at path. The row count comes from the payload size. Throws an error if the file declares no channels or no long sections, or if the payload is truncated or has an unknown format.
OpenCRG.road_surface_grid — Method
road_surface_grid(data::CRGData) -> (u, v, X, Y, Z)Apply data's $ROAD_CRG_MODS and compute world-frame grids of the road surface. u (along the reference line) and v (positive left) are axis vectors in m; X, Y, Z are (length(u), length(v)) matrices.
Throws an error for unsupported modifiers (REFPOINT_U*/REFPOINT_V*, or REFPOINT_* without an exact v = 0 column) or if only one of REFERENCE_LINE_END_X/_END_Y is set.
u, v, X, Y, Z = road_surface_grid(read_crg("road.crg"))