From: Jérémie D. <Ba...@us...> - 2010-02-11 22:01:45
|
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 cf6fd012353bccafa22317d7ee087475af2b1f82 (commit) from f96b27abd1f34c12f5dd40ab2c2c532e812f0936 (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 cf6fd012353bccafa22317d7ee087475af2b1f82 Author: Jérémie Dimino <je...@di...> Date: Thu Feb 11 23:00:52 2010 +0100 [controller] change the default stop mode ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/script.ml b/PC_Mainboard/clients/script.ml index ef69fe9..99810ee 100644 --- a/PC_Mainboard/clients/script.ml +++ b/PC_Mainboard/clients/script.ml @@ -123,7 +123,7 @@ let exec krobot line = | "stop-motors" -> Krobot.stop_motors krobot ~motor:(motor_of_string (arg_string "motor" "both")) - ~mode:(match arg_string "mode" "off" with + ~mode:(match arg_string "mode" "smooth" with | "off" -> `Off | "abrupt" -> `Abrupt | "smooth" -> `Smooth diff --git a/PC_Mainboard/myocamlbuild.ml b/PC_Mainboard/myocamlbuild.ml index d70ead8..b23d4cf 100644 --- a/PC_Mainboard/myocamlbuild.ml +++ b/PC_Mainboard/myocamlbuild.ml @@ -78,6 +78,7 @@ let targets = List.filter_opt (function (true, target) -> Some target | (false, (* Tests *) (have_lwt_unix && have_obus, "tests/double_move.best"); + (have_lwt_unix && have_obus, "tests/stop_and_restart.best"); ] (* +-----------------------------------------------------------------+ diff --git a/PC_Mainboard/tests/stop_and_restart.ml b/PC_Mainboard/tests/stop_and_restart.ml new file mode 100644 index 0000000..8632258 --- /dev/null +++ b/PC_Mainboard/tests/stop_and_restart.ml @@ -0,0 +1,23 @@ +(* + * stop_and_restart.ml + * ------------------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Lwt + +lwt () = + lwt krobot = Krobot.create () in + print_endline "moving forward"; + let t = Krobot.move krobot ~dist:1000 ~speed:100 ~acc:200 in + lwt () = Lwt_unix.sleep 2.0 in + print_endline "stopping motors"; + lwt () = Krobot.stop_motors krobot `Both `Smooth in + print_endline "waiting for trajectory to terminates"; + lwt _ = t in + print_endline "mobing backward"; + lwt _ = Krobot.move krobot ~dist:(-200) ~speed:100 ~acc:200 in + return () hooks/post-receive -- krobot |