diff --git a/sw/ground_segment/tmtc/aircraft.ml b/sw/ground_segment/tmtc/aircraft.ml index b1526b6963..eb7c3614b2 100644 --- a/sw/ground_segment/tmtc/aircraft.ml +++ b/sw/ground_segment/tmtc/aircraft.ml @@ -77,6 +77,7 @@ type aircraft = { name : string; flight_plan : Xml.xml; mutable pos : Latlong.utm; + mutable unix_time : float; mutable roll : float; mutable pitch : float; mutable nav_ref : Latlong.utm option; @@ -137,6 +138,7 @@ let new_aircraft = fun id name fp -> desired_altitude = 0.; desired_climb = 0.; pos = { Latlong.utm_x = 0.; utm_y = 0.; utm_zone = 0 }; + unix_time = 0.; nav_ref = None; cam = { phi = 0.; theta = 0. ; target=(0.,0.)}; inflight_calib = { if_mode = 1 ; if_val1 = 0.; if_val2 = 0.}; diff --git a/sw/ground_segment/tmtc/aircraft.mli b/sw/ground_segment/tmtc/aircraft.mli index 6bdbe3e89b..b9d2ac6b1c 100644 --- a/sw/ground_segment/tmtc/aircraft.mli +++ b/sw/ground_segment/tmtc/aircraft.mli @@ -63,6 +63,7 @@ type aircraft = { name : string; flight_plan : Xml.xml; mutable pos : Latlong.utm; + mutable unix_time : float; mutable roll : float; mutable pitch : float; mutable nav_ref : Latlong.utm option; diff --git a/sw/ground_segment/tmtc/server.ml b/sw/ground_segment/tmtc/server.ml index 8c990f2fdc..77e460260e 100644 --- a/sw/ground_segment/tmtc/server.ml +++ b/sw/ground_segment/tmtc/server.ml @@ -243,6 +243,7 @@ let log_and_parse = fun logging ac_name (a:Aircraft.aircraft) msg values -> a.pos <- { utm_x = fvalue "utm_east" /. 100.; utm_y = fvalue "utm_north" /. 100.; utm_zone = ivalue "utm_zone" }; + a.unix_time <- Latlong.unix_time_of_tow (truncate (fvalue "itow" /. 1000.)); a.gspeed <- fvalue "speed" /. 100.; a.course <- norm_course ((Deg>>Rad)(fvalue "course" /. 10.)); @@ -551,6 +552,7 @@ let send_aircraft_msg = fun ac -> "pitch", f (Geometry_2d.rad2deg a.pitch); "lat", f ((Rad>>Deg)wgs84.posn_lat); "long", f ((Rad>>Deg) wgs84.posn_long); + "unix_time", f a.unix_time; "speed", f a.gspeed; "course", f (Geometry_2d.rad2deg a.course); "alt", f a.alt;