Orbit Data Messages (CCSDS 502.0-B-3)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Simplify public APIs for odm, collision, and cam

odm: Add Odm.position_at — queries position across all segments in one
call. No need to manually iterate segments or convert epochs.

collision: Add Collision.assess — one-call CDM risk assessment returning
Pc, miss distance, relative velocity, and risk level (Critical/High/
Watch/Low enum). encounter/pc_foster/pc_chan/pc_max remain available for
custom workflows.

cam: Add Cam.avoid — one-call CDM avoidance. Takes a CDM and time-to-burn,
returns the minimum maneuver to reduce Pc below threshold (default 1e-5).
Extracts conjunction geometry from CDM automatically.

+20 -4
+10
lib/odm.ml
··· 395 395 let win_t = Array.sub times start needed in 396 396 let win_p = Array.init needed (fun j -> data.(start + j).pos) in 397 397 Some (lagrange_vec3 win_t win_p unix_t) 398 + 399 + let position_at oem unix_t = 400 + let rec try_segments = function 401 + | [] -> None 402 + | seg :: rest -> ( 403 + match interpolate seg unix_t with 404 + | Some _ as result -> result 405 + | None -> try_segments rest) 406 + in 407 + try_segments oem.segments
+10 -4
lib/odm.mli
··· 104 104 (** [epoch_range seg] returns [(start_time, stop_time)] from the segment 105 105 metadata. *) 106 106 107 + val position_at : t -> float -> vec3 option 108 + (** [position_at oem unix_t] returns the interpolated position at the given Unix 109 + timestamp. Searches all segments and uses Lagrange polynomial interpolation 110 + (degree from OEM metadata, default 7). Returns [None] if [unix_t] is outside 111 + all segment ranges. 112 + 113 + This is the main entry point for querying an OEM. *) 114 + 107 115 val interpolate : segment -> float -> vec3 option 108 - (** [interpolate seg unix_t] interpolates position at the given Unix timestamp 109 - using Lagrange polynomial interpolation. The interpolation degree is taken 110 - from the segment metadata (default: 7, matching CCSDS convention). Returns 111 - [None] if [unix_t] is outside the data range or epochs cannot be parsed. *) 116 + (** [interpolate seg unix_t] interpolates within a single segment. Use 117 + {!position_at} unless you need to work with a specific segment. *)