From: Jérémie D. <Ba...@us...> - 2011-04-19 18:51:17
|
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 627cc580a2169b0b0cec5cb708e601410077633f (commit) from 8877ca0b604fe3db017076a12c87b2007e140d73 (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 627cc580a2169b0b0cec5cb708e601410077633f Author: Jérémie Dimino <je...@di...> Date: Tue Apr 19 20:50:20 2011 +0200 [krobot_viewer] do not send motor status request anymore ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/src/tools/krobot_simulator.ml b/info/control2011/src/tools/krobot_simulator.ml index fa4f724..ad0bf78 100644 --- a/info/control2011/src/tools/krobot_simulator.ml +++ b/info/control2011/src/tools/krobot_simulator.ml @@ -241,6 +241,17 @@ lwt () = (* Sends the state of the robot. *) lwt () = Krobot_message.send bus (sim.time, Odometry(sim.state.x, sim.state.y, sim.state.theta)) in + (* Sends the state of the motors. *) + lwt () = + match sim.command with + | Turn(a, b) -> + Krobot_message.send bus (Unix.gettimeofday (), Motor_status(false, true, false, false)) + | Move(a, b) -> + Krobot_message.send bus (Unix.gettimeofday (), Motor_status(true, false, false, false)) + | _ -> + Krobot_message.send bus (Unix.gettimeofday (), Motor_status(false, false, false, false)) + in + lwt () = print sim in let (u1, u2) = velocities sim in diff --git a/info/control2011/src/tools/krobot_viewer.ml b/info/control2011/src/tools/krobot_viewer.ml index 3b30372..7e54aa5 100644 --- a/info/control2011/src/tools/krobot_viewer.ml +++ b/info/control2011/src/tools/krobot_viewer.ml @@ -568,11 +568,4 @@ lwt () = ); false)); - pick [ - waiter; - (* Sends motor status request continously. *) - while_lwt true do - lwt () = Krobot_message.send bus (Unix.gettimeofday (), Req_motor_status) in - Lwt_unix.sleep 0.2 - done; - ] + waiter hooks/post-receive -- krobot |