From: Jérémie D. <Ba...@us...> - 2011-03-30 21:28:39
|
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 2e1b70ec4a201c20fe5cb1ee3aa0274c90f880be (commit) from 32438eb8c7678e35dfb26bde88d77c0a73c63596 (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 2e1b70ec4a201c20fe5cb1ee3aa0274c90f880be Author: Jérémie Dimino <je...@di...> Date: Wed Mar 30 23:28:10 2011 +0200 [krobot_viewer] more logs ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/src/tools/krobot_viewer.ml b/info/control2011/src/tools/krobot_viewer.ml index a3d7a79..30dcaf2 100644 --- a/info/control2011/src/tools/krobot_viewer.ml +++ b/info/control2011/src/tools/krobot_viewer.ml @@ -451,12 +451,14 @@ module Board = struct board.points <- List.map (fun i -> points.(i)) result; queue_draw board - let rec wait_done board = - lwt () = Lwt_unix.sleep 0.2 in - if board.moving then - wait_done board - else - return () + let wait_done board = + lwt () = Lwt_log.info "waiting for the robot to stop moving" in + lwt () = + while_lwt board.moving do + Lwt_unix.sleep 0.2 + done + in + Lwt_log.info "trajectory done" let go board = let rec loop () = @@ -464,6 +466,7 @@ module Board = struct | (x, y) :: rest -> (* Turn the robot. *) let alpha = math_mod_float (atan2 (y -. board.state.y) (x -. board.state.x) -. board.state.theta) (2. *. pi) in + lwt () = Lwt_log.info_f "turning by %f radiants" alpha in lwt () = Krobot_message.send board.bus (Unix.gettimeofday (), Motor_turn(alpha, board.ui#rotation_speed#adjustment#value, @@ -473,6 +476,7 @@ module Board = struct (* Move the robot. *) let sqr x = x *. x in let dist = sqrt (sqr (x -. board.state.x) +. sqr (y -. board.state.y)) in + lwt () = Lwt_log.info_f "moving by %f meters" dist in lwt () = Krobot_message.send board.bus (Unix.gettimeofday (), Motor_move(dist, board.ui#moving_speed#adjustment#value, hooks/post-receive -- krobot |