From: Jérémie D. <Ba...@us...> - 2011-03-19 22:00:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "krobot". The branch, master has been updated via 83c186985a65096c7239b31b96be7dc1d5bef443 (commit) from 95ab414ec8f22c7cf492ed89c459b8a79c1904fd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 83c186985a65096c7239b31b96be7dc1d5bef443 Author: Jérémie Dimino <je...@di...> Date: Sat Mar 19 22:59:29 2011 +0100 [info] fix krobot-replay ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/src/tools/krobot_replay.ml b/info/control2011/src/tools/krobot_replay.ml index ffabded..a299169 100644 --- a/info/control2011/src/tools/krobot_replay.ml +++ b/info/control2011/src/tools/krobot_replay.ml @@ -12,6 +12,12 @@ open Lwt open Lwt_react +let rec loop bus ic delta prev_timestamp = + lwt timestamp, frame = Lwt_io.read_value ic in + lwt () = Lwt_unix.sleep (timestamp -. prev_timestamp) in + lwt () = Krobot_can.send bus (timestamp +. delta, frame) in + loop bus ic delta timestamp + lwt () = let file = ref "krobot.record" in Krobot_init.arg "-input" (Arg.Set_string file) "<file> input file"; @@ -25,9 +31,6 @@ lwt () = (* Compute the difference of time to add to each timestamp. *) let delta = Unix.gettimeofday () -. timestamp in lwt () = Krobot_can.send bus (timestamp +. delta, frame) in - while_lwt true do - lwt timestamp, frame = Lwt_io.read_value ic in - Krobot_can.send bus (timestamp +. delta, frame) - done + loop bus ic delta timestamp with End_of_file -> Lwt_io.close ic hooks/post-receive -- krobot |