You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(13) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(50) |
Feb
(137) |
Mar
(84) |
Apr
(36) |
May
(100) |
Jun
(5) |
Jul
|
Aug
(4) |
Sep
(13) |
Oct
(1) |
Nov
(4) |
Dec
(22) |
| 2011 |
Jan
(4) |
Feb
(9) |
Mar
(113) |
Apr
(76) |
May
(31) |
Jun
(19) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
(4) |
Feb
|
Mar
(2) |
Apr
(6) |
May
(19) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
(2) |
Apr
(22) |
May
(6) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-10 21:31:46
|
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 d36204afda2e453843002b5941b805ad5d71ec49 (commit)
from 2cb0b2a1da174f7a32acebc769607b05a1cd4938 (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 d36204afda2e453843002b5941b805ad5d71ec49
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 22:31:15 2010 +0100
Stop motors in smooth mode
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/security/hard_stop.ml b/PC_Mainboard/clients/security/hard_stop.ml
index 124230c..a5559cc 100644
--- a/PC_Mainboard/clients/security/hard_stop.ml
+++ b/PC_Mainboard/clients/security/hard_stop.ml
@@ -31,7 +31,7 @@ let handle_colide krobot sensors =
lwt () = Krobot.inhibit_forward krobot duration in
if !state_forward = OK then begin
state_forward := Stopped;
- Krobot.stop_motors krobot ~motor:`Both ~mode:`Off;
+ Krobot.stop_motors krobot ~motor:`Both ~mode:`Smooth;
end else
return ()
end else begin
@@ -42,7 +42,7 @@ let handle_colide krobot sensors =
lwt () = Krobot.inhibit_backward krobot duration in
if !state_backward = OK then begin
state_backward := Stopped;
- Krobot.stop_motors krobot ~motor:`Both ~mode:`Off;
+ Krobot.stop_motors krobot ~motor:`Both ~mode:`Smooth;
end else
return ()
end else begin
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-10 21:28:14
|
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 2cb0b2a1da174f7a32acebc769607b05a1cd4938 (commit)
from 51ecd70a79d4b6d4cfffc41676e4c9dc21a3fba3 (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 2cb0b2a1da174f7a32acebc769607b05a1cd4938
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 22:27:21 2010 +0100
[client-tools] added init_position.ml
Program which put the robot into the initial position.
enter the commit message for your changes. Lines starting
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/common/config.ml b/PC_Mainboard/clients/common/config.ml
index ac92ae7..67926dd 100644
--- a/PC_Mainboard/clients/common/config.ml
+++ b/PC_Mainboard/clients/common/config.ml
@@ -9,3 +9,4 @@
let back_sensors = [3; 6; 7; 10]
let front_sensors = [0; 1; 2; 4; 5; 8; 9; 11; 12; 13; 14; 15]
+let initial_position = 200
diff --git a/PC_Mainboard/clients/common/config.mli b/PC_Mainboard/clients/common/config.mli
index ee9d807..47c3f27 100644
--- a/PC_Mainboard/clients/common/config.mli
+++ b/PC_Mainboard/clients/common/config.mli
@@ -14,3 +14,6 @@ val front_sensors : int list
val back_sensors : int list
(** List of back sensors *)
+
+val initial_position : int
+ (** Position to borders at the beginning of the match *)
diff --git a/PC_Mainboard/clients/common/util.ml b/PC_Mainboard/clients/common/util.ml
index 3edd854..b369bdc 100644
--- a/PC_Mainboard/clients/common/util.ml
+++ b/PC_Mainboard/clients/common/util.ml
@@ -11,7 +11,7 @@ let front_colide sensors =
if Array.length sensors <> 16 then invalid_arg "Until.front_colide";
let rec loop = function
| 16 -> false
- | n -> (sensors.(n) && List.mem n Config.front_sensors) || loop (n - 1)
+ | n -> (sensors.(n) && List.mem n Config.front_sensors) || loop (n + 1)
in
loop 0
@@ -19,6 +19,6 @@ let back_colide sensors =
if Array.length sensors <> 16 then invalid_arg "Until.back_colide";
let rec loop = function
| 16 -> false
- | n -> (sensors.(n) && List.mem n Config.back_sensors) || loop (n - 1)
+ | n -> (sensors.(n) && List.mem n Config.back_sensors) || loop (n + 1)
in
loop 0
diff --git a/PC_Mainboard/clients/myocamlbuild.ml b/PC_Mainboard/clients/myocamlbuild.ml
index 54d6a50..5da00b7 100644
--- a/PC_Mainboard/clients/myocamlbuild.ml
+++ b/PC_Mainboard/clients/myocamlbuild.ml
@@ -101,6 +101,7 @@ let _ =
"remote/forward_dbus.native";
"tools/joy_control.native";
"security/hard_stop.native";
+ "tools/init_position.native";
];
(* +---------------------------------------------------------+
diff --git a/PC_Mainboard/clients/tools/init_position.ml b/PC_Mainboard/clients/tools/init_position.ml
new file mode 100644
index 0000000..5ce1172
--- /dev/null
+++ b/PC_Mainboard/clients/tools/init_position.ml
@@ -0,0 +1,36 @@
+(*
+ * init_position.ml
+ * ----------------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+(* Put the robot into its initial state *)
+
+open Lwt
+
+lwt () =
+ lwt krobot = Krobot.create () in
+ let colide = React.S.changes (React.S.map Util.back_colide (Krobot.logic_sensors krobot)) in
+
+ Log#notice "moving backward";
+ lwt () = Krobot.move krobot ~dist:(-1000) ~speed:100 ~acc:100 in
+ Log#notice "waiting for colision";
+ lwt _ = Lwt_event.next colide in
+ Log#notice "backward colisiton dectected";
+
+ Log#notice "going to initial position on first axis";
+ lwt () = Krobot.move krobot ~dist:Config.initial_position ~speed:400 ~acc:800 in
+
+ Log#notice "turning";
+ lwt () = Krobot.turn krobot ~angle:90 ~speed:400 ~acc:800 in
+ Log#notice "moving backward";
+ lwt () = Krobot.move krobot ~dist:(-1000) ~speed:100 ~acc:50 in
+ Log#notice "waiting for colision";
+ lwt _ = Lwt_event.next colide in
+ Log#notice "backward colisiton dectected";
+
+ Log#notice "going to initial position on second axis";
+ Krobot.move krobot ~dist:Config.initial_position ~speed:400 ~acc:800
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-10 20:47:40
|
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 51ecd70a79d4b6d4cfffc41676e4c9dc21a3fba3 (commit)
via 0381389a694f94d2a3ef498cc56f8f6c6a1c8bd5 (commit)
from 6c3fce1be59b3862417f78688e4bf3368f15b9ad (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 51ecd70a79d4b6d4cfffc41676e4c9dc21a3fba3
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 21:47:03 2010 +0100
add modules common/Config and common/Util
commit 0381389a694f94d2a3ef498cc56f8f6c6a1c8bd5
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 21:34:32 2010 +0100
[controller] save/restore terminal state
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/_tags b/PC_Mainboard/clients/_tags
index 8582d38..c23ac4f 100644
--- a/PC_Mainboard/clients/_tags
+++ b/PC_Mainboard/clients/_tags
@@ -6,6 +6,7 @@
# Needed by the rest of the source
"lib-krobot": include
+"common": include
# lib-krobot uses obus
<**/*>: pkg_obus
diff --git a/PC_Mainboard/clients/common/config.ml b/PC_Mainboard/clients/common/config.ml
new file mode 100644
index 0000000..ac92ae7
--- /dev/null
+++ b/PC_Mainboard/clients/common/config.ml
@@ -0,0 +1,11 @@
+(*
+ * config.ml
+ * ---------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+let back_sensors = [3; 6; 7; 10]
+let front_sensors = [0; 1; 2; 4; 5; 8; 9; 11; 12; 13; 14; 15]
diff --git a/PC_Mainboard/clients/common/config.mli b/PC_Mainboard/clients/common/config.mli
new file mode 100644
index 0000000..ee9d807
--- /dev/null
+++ b/PC_Mainboard/clients/common/config.mli
@@ -0,0 +1,16 @@
+(*
+ * config.mli
+ * ----------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+(** Krobot parameters *)
+
+val front_sensors : int list
+ (** List of front sensors *)
+
+val back_sensors : int list
+ (** List of back sensors *)
diff --git a/PC_Mainboard/clients/common/util.ml b/PC_Mainboard/clients/common/util.ml
new file mode 100644
index 0000000..3edd854
--- /dev/null
+++ b/PC_Mainboard/clients/common/util.ml
@@ -0,0 +1,24 @@
+(*
+ * util.ml
+ * -------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+let front_colide sensors =
+ if Array.length sensors <> 16 then invalid_arg "Until.front_colide";
+ let rec loop = function
+ | 16 -> false
+ | n -> (sensors.(n) && List.mem n Config.front_sensors) || loop (n - 1)
+ in
+ loop 0
+
+let back_colide sensors =
+ if Array.length sensors <> 16 then invalid_arg "Until.back_colide";
+ let rec loop = function
+ | 16 -> false
+ | n -> (sensors.(n) && List.mem n Config.back_sensors) || loop (n - 1)
+ in
+ loop 0
diff --git a/PC_Mainboard/clients/common/util.mli b/PC_Mainboard/clients/common/util.mli
new file mode 100644
index 0000000..c34b8dc
--- /dev/null
+++ b/PC_Mainboard/clients/common/util.mli
@@ -0,0 +1,18 @@
+(*
+ * util.mli
+ * --------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+(** Utilities *)
+
+val front_colide : bool array -> bool
+ (** [front_colide sensors] returns whether on of the front sensors
+ is activated *)
+
+val back_colide : bool array -> bool
+ (** [front_colide sensors] returns whether on of the back sensors is
+ activated *)
diff --git a/PC_Mainboard/clients/security/hard_stop.ml b/PC_Mainboard/clients/security/hard_stop.ml
index d03c1f5..124230c 100644
--- a/PC_Mainboard/clients/security/hard_stop.ml
+++ b/PC_Mainboard/clients/security/hard_stop.ml
@@ -11,8 +11,6 @@
open Lwt
-let back_sensors = [3; 6; 7; 10]
-
(* Duration of an inhibition: *)
let duration = 1.0
@@ -28,17 +26,8 @@ let state_forward = ref OK
let state_backward = ref OK
let handle_colide krobot sensors =
- let colide_front = ref false and colide_back = ref false in
- for i = 0 to 15 do
- if sensors.(i) then begin
- if List.mem i back_sensors then
- colide_back := true
- else
- colide_front := true
- end
- done;
join [
- (if !colide_front then begin
+ (if Util.front_colide sensors then begin
lwt () = Krobot.inhibit_forward krobot duration in
if !state_forward = OK then begin
state_forward := Stopped;
@@ -49,7 +38,7 @@ let handle_colide krobot sensors =
state_forward := OK;
return ()
end);
- (if !colide_back then begin
+ (if Util.back_colide sensors then begin
lwt () = Krobot.inhibit_backward krobot duration in
if !state_backward = OK then begin
state_backward := Stopped;
diff --git a/PC_Mainboard/clients/tools/controller.ml b/PC_Mainboard/clients/tools/controller.ml
index d10ff37..3e36d5d 100644
--- a/PC_Mainboard/clients/tools/controller.ml
+++ b/PC_Mainboard/clients/tools/controller.ml
@@ -290,6 +290,7 @@ let rec copy_logs ic =
copy_logs ic
lwt () =
+ lwt () = save_state () in
lwt () = hide_cursor () in
try_lwt
let fdr, fdw = Unix.pipe () in
@@ -322,4 +323,4 @@ lwt () =
ignore signal;
Lwt_term.with_raw_mode (fun () -> loop krobot [])
finally
- show_cursor ()
+ restore_state ()
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-10 20:30:29
|
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 6c3fce1be59b3862417f78688e4bf3368f15b9ad (commit)
via 120f4fe59bb7f4cb35cf13b2cc4e6fe7d38e2918 (commit)
via 185013267259fd0be1b691db23634b47d0a376f7 (commit)
via 57074afff06e02fccd0489375e4ebc0a30c7edd2 (commit)
via 1d47f0a6aaf997b20870ff615e4686ec76e92858 (commit)
from 08af0919e78e3e6c1687744414c3202dff61ed51 (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 6c3fce1be59b3862417f78688e4bf3368f15b9ad
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 21:27:33 2010 +0100
typo
commit 120f4fe59bb7f4cb35cf13b2cc4e6fe7d38e2918
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 21:22:46 2010 +0100
typo
commit 185013267259fd0be1b691db23634b47d0a376f7
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 21:21:20 2010 +0100
typo
commit 57074afff06e02fccd0489375e4ebc0a30c7edd2
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 21:18:32 2010 +0100
Add signals for motors state
commit 1d47f0a6aaf997b20870ff615e4686ec76e92858
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 20:58:34 2010 +0100
[controller] write logs in the main window
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.ml b/PC_Mainboard/clients/lib-krobot/krobot.ml
index cb9490a..eacc4da 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.ml
+++ b/PC_Mainboard/clients/lib-krobot/krobot.ml
@@ -31,6 +31,10 @@ type t = {
sensor : card;
motor : card;
+ (* Motors state *)
+ inhibited_forward_until : float React.signal;
+ inhibited_backward_until : float React.signal;
+
peer : OBus_peer.t;
(* The driver peer *)
}
@@ -118,12 +122,16 @@ let create ?peer () =
and interface_state = make_card_signal peer "Interface" "GetState" "StateChanged" <:obus_type< state >>
and sensor_state = make_card_signal peer "Sensor" "GetState" "StateChanged" <:obus_type< state >>
and motor_state = make_card_signal peer "Motor" "GetState" "StateChanged" <:obus_type< state >>
+ and inhibited_forward_until = make_dev_signal peer "Motors" "InhibitedForward" "InhibitedForwardChanged" <:obus_type< float >>
+ and inhibited_backward_until = make_dev_signal peer "Motors" "InhibitedBackward" "InhibitedBackwardChanged" <:obus_type< float >>
in
return {
peer = peer;
compass = compass;
logic_sensors = logic_sensors;
range_finders = range_finders;
+ inhibited_forward_until = inhibited_forward_until;
+ inhibited_backward_until = inhibited_backward_until;
interface = { card_state = interface_state };
sensor = { card_state = sensor_state };
motor = { card_state = motor_state };
@@ -136,6 +144,8 @@ let create ?peer () =
let compass krobot = krobot.compass
let logic_sensors krobot = krobot.logic_sensors
let range_finders krobot = krobot.range_finders
+let inhibited_forward_until krobot = krobot.inhibited_forward_until
+let inhibited_backward_until krobot = krobot.inhibited_backward_until
let team krobot =
React.S.map (fun ls -> if ls.(14) then Team_red else Team_green) krobot.logic_sensors
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.mli b/PC_Mainboard/clients/lib-krobot/krobot.mli
index 178779a..f5c8a53 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.mli
+++ b/PC_Mainboard/clients/lib-krobot/krobot.mli
@@ -74,6 +74,14 @@ val inhibit_backward : t -> float -> unit Lwt.t
(** [inhibit_backward krobot delay] forbid backward moves during
[delay] seconds *)
+val inhibited_forward_until : t -> float React.signal
+ (** Signal holding the date until which the robot is reallowed to
+ move forward *)
+
+val inhibited_backward_until : t -> float React.signal
+ (** Signal holding the date until which the robot is reallowed to
+ move backward *)
+
(** {6 Cards} *)
module Card : sig
diff --git a/PC_Mainboard/clients/tools/controller.ml b/PC_Mainboard/clients/tools/controller.ml
index 0eed0f3..d10ff37 100644
--- a/PC_Mainboard/clients/tools/controller.ml
+++ b/PC_Mainboard/clients/tools/controller.ml
@@ -58,7 +58,11 @@ let draw_text clip ?style x y txt =
let drawer_mutex = Lwt_mutex.create ()
(* Draw the whole screen *)
-let rec draw size (compass, logic_sensors, range_finders, team, jack) (engine_state, box, logs) (state_interface, state_sensor, state_motor) =
+let rec draw size
+ (compass, logic_sensors, range_finders, team, jack)
+ (inhibited_forward_until, inhibited_backward_until)
+ (engine_state, box, logs)
+ (state_interface, state_sensor, state_motor) =
Lwt_mutex.with_lock drawer_mutex begin fun () ->
if Lwt_mutex.is_empty drawer_mutex then begin
(* Redraw the screen only if there is no other thread waiting to
@@ -118,6 +122,15 @@ let rec draw size (compass, logic_sensors, range_finders, team, jack) (engine_st
Draw.textf zone x 3 "interface card is %s" (string_of_state state_interface);
Draw.textf zone x 4 "sensor card is %s" (string_of_state state_sensor);
Draw.textf zone x 5 "motor card is %s" (string_of_state state_motor);
+ let date = Unix.gettimeofday () in
+ let string_of_motor_state until =
+ if date < until then
+ "inhibited"
+ else
+ "OK"
+ in
+ Draw.textf zone x 6 "move forward: %s" (string_of_motor_state inhibited_forward_until);
+ Draw.textf zone x 7 "move backward: %s" (string_of_motor_state inhibited_backward_until);
(* ===== History ===== *)
@@ -271,12 +284,21 @@ let rec loop krobot history =
| Entry point |
+-----------------------------------------------------------------+ *)
+let rec copy_logs ic =
+ lwt line = Lwt_io.read_line ic in
+ set_logs (line :: React.S.value logs);
+ copy_logs ic
+
lwt () =
lwt () = hide_cursor () in
try_lwt
+ let fdr, fdw = Unix.pipe () in
+ Unix.dup2 fdw Unix.stderr;
+ Unix.close fdw;
+ ignore (copy_logs (Lwt_io.of_unix_fd ~mode:Lwt_io.input fdr));
lwt krobot = Krobot.create () in
let signal =
- React.S.l4 draw
+ React.S.l5 draw
Lwt_term.size
(React.S.l5 (fun a b c d e -> (a, b, c, d, e))
(Krobot.compass krobot)
@@ -284,6 +306,9 @@ lwt () =
(Krobot.range_finders krobot)
(Krobot.team krobot)
(Krobot.jack krobot))
+ (React.S.l2 (fun a b -> (a, b))
+ (Krobot.inhibited_forward_until krobot)
+ (Krobot.inhibited_backward_until krobot))
(React.S.l3 (fun a b c -> (a, b, c))
engine_state
box
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index b0ede4f..82af766 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -330,15 +330,26 @@ struct
| Motors inhbition |
+---------------------------------------------------------------+ *)
+ OL_method InhibitedForward : float = fun dev ->
+ return dev.inhibit_forward_until
+
+ OL_method InhibitedBackward : float = fun dev ->
+ return dev.inhibit_backward_until
+
+ OL_signal InhibitedForwardChanged : float
+ OL_signal InhibitedBackwardChanged : float
+
OL_method InhibitForward : float -> unit =
fun dev delay ->
- dev.inhibit_forward_until <- Unix.gettimeofday () +. delay;
- return ()
+ let until = Unix.gettimeofday () +. delay in
+ dev.inhibit_forward_until <- until;
+ inhibited_forward_changed dev until
OL_method InhibitBackward : float -> unit =
fun dev delay ->
- dev.inhibit_backward_until <- Unix.gettimeofday () +. delay;
- return ()
+ let until = Unix.gettimeofday () +. delay in
+ dev.inhibit_backward_until <- until;
+ inhibited_backward_changed dev until
let make card path =
let dev = {
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-10 19:54:08
|
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 08af0919e78e3e6c1687744414c3202dff61ed51 (commit)
from b5ce55bb70de5c5fc92a73abf38ee051d8d56029 (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 08af0919e78e3e6c1687744414c3202dff61ed51
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 20:53:22 2010 +0100
typo in InhibitBackward
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index 18d7203..b0ede4f 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -337,7 +337,7 @@ struct
OL_method InhibitBackward : float -> unit =
fun dev delay ->
- dev.inhibit_forward_until <- Unix.gettimeofday () +. delay;
+ dev.inhibit_backward_until <- Unix.gettimeofday () +. delay;
return ()
let make card path =
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-10 19:49:46
|
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 b5ce55bb70de5c5fc92a73abf38ee051d8d56029 (commit)
from 7de615d13e5add106bc84cfb21118aa100d745f6 (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 b5ce55bb70de5c5fc92a73abf38ee051d8d56029
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 20:49:12 2010 +0100
set back sensor ids
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/security/hard_stop.ml b/PC_Mainboard/clients/security/hard_stop.ml
index 4506154..d03c1f5 100644
--- a/PC_Mainboard/clients/security/hard_stop.ml
+++ b/PC_Mainboard/clients/security/hard_stop.ml
@@ -11,8 +11,7 @@
open Lwt
-let front_sensors = [0; 2; 3; 4; 5; 6; 7]
-let back_sensors = [8; 9; 10; 11; 12; 13; 14; 15]
+let back_sensors = [3; 6; 7; 10]
(* Duration of an inhibition: *)
let duration = 1.0
@@ -32,10 +31,10 @@ let handle_colide krobot sensors =
let colide_front = ref false and colide_back = ref false in
for i = 0 to 15 do
if sensors.(i) then begin
- if List.mem i front_sensors then
- colide_front := true
- else if List.mem i back_sensors then
+ if List.mem i back_sensors then
colide_back := true
+ else
+ colide_front := true
end
done;
join [
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-10 14:19:02
|
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 7de615d13e5add106bc84cfb21118aa100d745f6 (commit)
via 2f104a859ee145da7d7bd2112875201bb46e123c (commit)
from d3193fa311b9c329e7b009ac3eadf26602f3628f (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 7de615d13e5add106bc84cfb21118aa100d745f6
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 15:18:22 2010 +0100
Add security (stop robot on colision)
commit 2f104a859ee145da7d7bd2112875201bb46e123c
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 10 14:37:01 2010 +0100
Remove USB calls from "Driver" and put them into "Commands"
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.ml b/PC_Mainboard/clients/lib-krobot/krobot.ml
index 25d225c..cb9490a 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.ml
+++ b/PC_Mainboard/clients/lib-krobot/krobot.ml
@@ -169,15 +169,12 @@ let obus_stop_mode = OBus_type.mapping obus_int
(`Abrupt, 1);
(`Smooth, 2)]
-OP_method Turn : int -> int -> int -> unit
-OP_method Move : int -> int -> int -> unit
-OP_method StopMotors : motor -> stop_mode -> unit
-OP_method SetSpeed : motor -> int -> int -> unit
-
-let turn krobot ~angle ~speed ~acc = turn krobot angle speed acc
-let move krobot ~dist ~speed ~acc = move krobot dist speed acc
-let stop_motors krobot ~motor ~mode = stop_motors krobot motor mode
-let set_speed krobot ~motor ~speed ~acc = set_speed krobot motor speed acc
+OP_method Turn : angle : int -> speed : int -> acc : int -> unit
+OP_method Move : dist : int -> speed : int -> acc : int -> unit
+OP_method StopMotors : motor : motor -> mode : stop_mode -> unit
+OP_method SetSpeed : motor : motor -> speed : int -> acc : int -> unit
+OP_method InhibitForward : float -> unit
+OP_method InhibitBackward : float -> unit
(* +-----------------------------------------------------------------+
| Cards |
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.mli b/PC_Mainboard/clients/lib-krobot/krobot.mli
index 9d0134e..178779a 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.mli
+++ b/PC_Mainboard/clients/lib-krobot/krobot.mli
@@ -66,6 +66,14 @@ val set_speed : t -> motor : motor -> speed : int -> acc : int -> unit Lwt.t
(** [set_speed krobot ~motor ~speed ~acc] set the speed and
acceleration for the specified motors. *)
+val inhibit_forward : t -> float -> unit Lwt.t
+ (** [inhibit_forward krobot delay] forbid forward moves during
+ [delay] seconds *)
+
+val inhibit_backward : t -> float -> unit Lwt.t
+ (** [inhibit_backward krobot delay] forbid backward moves during
+ [delay] seconds *)
+
(** {6 Cards} *)
module Card : sig
diff --git a/PC_Mainboard/clients/myocamlbuild.ml b/PC_Mainboard/clients/myocamlbuild.ml
index 593f6b9..54d6a50 100644
--- a/PC_Mainboard/clients/myocamlbuild.ml
+++ b/PC_Mainboard/clients/myocamlbuild.ml
@@ -100,6 +100,7 @@ let _ =
"tools/controller.native";
"remote/forward_dbus.native";
"tools/joy_control.native";
+ "security/hard_stop.native";
];
(* +---------------------------------------------------------+
diff --git a/PC_Mainboard/clients/security/hard_stop.ml b/PC_Mainboard/clients/security/hard_stop.ml
new file mode 100644
index 0000000..4506154
--- /dev/null
+++ b/PC_Mainboard/clients/security/hard_stop.ml
@@ -0,0 +1,91 @@
+(*
+ * hard_stop.ml
+ * ------------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+(* Stop the robot on collisions *)
+
+open Lwt
+
+let front_sensors = [0; 2; 3; 4; 5; 6; 7]
+let back_sensors = [8; 9; 10; 11; 12; 13; 14; 15]
+
+(* Duration of an inhibition: *)
+let duration = 1.0
+
+let foreground = ref false
+let args = [
+ "-n", Arg.Set foreground, "do not daemonize";
+]
+let usage = Printf.sprintf "Usage: %s [-n]\n\noptions are:" (Filename.basename (Sys.argv.(0)))
+
+type state = OK | Stopped
+
+let state_forward = ref OK
+let state_backward = ref OK
+
+let handle_colide krobot sensors =
+ let colide_front = ref false and colide_back = ref false in
+ for i = 0 to 15 do
+ if sensors.(i) then begin
+ if List.mem i front_sensors then
+ colide_front := true
+ else if List.mem i back_sensors then
+ colide_back := true
+ end
+ done;
+ join [
+ (if !colide_front then begin
+ lwt () = Krobot.inhibit_forward krobot duration in
+ if !state_forward = OK then begin
+ state_forward := Stopped;
+ Krobot.stop_motors krobot ~motor:`Both ~mode:`Off;
+ end else
+ return ()
+ end else begin
+ state_forward := OK;
+ return ()
+ end);
+ (if !colide_back then begin
+ lwt () = Krobot.inhibit_backward krobot duration in
+ if !state_backward = OK then begin
+ state_backward := Stopped;
+ Krobot.stop_motors krobot ~motor:`Both ~mode:`Off;
+ end else
+ return ()
+ end else begin
+ state_backward := OK;
+ return ()
+ end);
+ ]
+
+lwt () =
+ Arg.parse args ignore usage;
+
+ if !foreground then
+ Log#info "starting hard_stop in foreground mode"
+ else begin
+ Log#info "starting hard_stop in daemon mode";
+ Lwt_log.default := Lwt_log.syslog
+ ~level:(min Lwt_log.Info Lwt_log.default_level)
+ ~facility:`Daemon
+ ();
+ Lwt_unix.daemonize ~keep_stderr:true ()
+ end;
+
+ lwt krobot = Krobot.create () in
+
+ (* Stop motors as soon as possible: *)
+ Lwt_signal.always_notify_p (handle_colide krobot) (Krobot.logic_sensors krobot);
+
+ (* Continue the inhibition: *)
+ let rec loop () =
+ lwt () = handle_colide krobot (React.S.value (Krobot.logic_sensors krobot)) in
+ lwt () = Lwt_unix.sleep (duration /. 2.) in
+ loop ()
+ in
+ loop ()
diff --git a/PC_Mainboard/driver/src/commands.ml b/PC_Mainboard/driver/src/commands.ml
new file mode 100644
index 0000000..5404b77
--- /dev/null
+++ b/PC_Mainboard/driver/src/commands.ml
@@ -0,0 +1,150 @@
+(*
+ * commands.ml
+ * -----------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+open Lwt
+
+let string_of_azt data =
+ try
+ String.sub data 0 (String.index data '\000')
+ with Not_found ->
+ data
+
+let get_firmware_build card =
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.get_firmware_build;
+ Card.send_request card Protocol.cmd_get data >|= string_of_azt
+
+let get_board_info card =
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.get_board_info;
+ Card.send_request card Protocol.cmd_get data >|= string_of_azt
+
+let bootloader card =
+ Card.send_command card Protocol.cmd_bootloader ""
+
+module Compass =
+struct
+ let get card =
+ lwt data = Card.send_request card Protocol.get_cmp03_data "" in
+ return (RW.get_int16 data 2)
+end
+
+module AX12 =
+struct
+ let goto card ~id ~pos ~speed =
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.ax12_goto;
+ RW.set_uint8 data 1 id;
+ RW.set_uint16 data 2 pos;
+ RW.set_uint16 data 4 speed;
+ lwt _ = Card.send_request card Protocol.cmd_ax12 data in
+ return ()
+end
+
+module Logic_sensors =
+struct
+ let get card =
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.get_tor_state;
+ lwt data = Card.send_request card Protocol.cmd_get data in
+ let x = RW.get_uint16 data 0 in
+ return (Array.init 16 (fun i -> x land (1 lsl i) <> 0))
+end
+
+module Range_finders =
+struct
+ let get card =
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.get_rangefinder_state;
+ lwt data = Card.send_request card Protocol.cmd_get data in
+ return (Array.init 8 (fun i -> RW.get_int32 data (i * 4)))
+end
+
+module Motor =
+struct
+ type t = [ `Left | `Right | `Both ]
+ type stop_mode = [ `Off | `Abrupt | `Smooth ]
+ type direction = [ `Forward | `Backward ]
+
+ let backend cmd card arg1 arg2 arg3 =
+ let data = String.create 7 in
+ RW.set_uint8 data 0 cmd;
+ RW.set_int16 data 1 arg1;
+ RW.set_int16 data 3 arg2;
+ RW.set_int16 data 5 arg3;
+ Card.send_command card Protocol.cmd_traj data
+
+ let move card ~dist ~speed ~acc =
+ if dist < 0 then
+ backend Protocol.traj_forward card (-dist) speed acc
+ else
+ backend Protocol.traj_backward card dist speed acc
+
+ let turn card ~angle ~speed ~acc =
+ if angle < 0 then
+ backend Protocol.traj_tl card (-angle) speed acc
+ else
+ backend Protocol.traj_tr card angle speed acc
+
+ (* Values comming from lm629.h *)
+ let int_of_direction = function
+ | `Forward -> 1
+ | `Backward -> -1
+
+ let int_of_motor = function
+ | `Left -> Protocol.motor_left
+ | `Both -> Protocol.motor_both
+ | `Right -> Protocol.motor_right
+
+ let int_of_stop_mode = function
+ | `Off -> Protocol.traj_stop_motor_off
+ | `Abrupt -> Protocol.traj_stop_abrupt
+ | `Smooth -> Protocol.traj_stop_smooth
+
+ let traj_new_velocity card ~motor ~speed ~acc ~dir =
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.traj_new_velocity;
+ RW.set_uint8 data 1 (int_of_motor motor);
+ RW.set_int16 data 2 speed;
+ RW.set_int16 data 4 acc;
+ RW.set_uint8 data 6 (int_of_direction dir);
+ Card.send_command card Protocol.cmd_traj data
+
+ let traj_change_velocity card ~motor ~speed ~dir =
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.traj_change_velocity;
+ RW.set_uint8 data 1 (int_of_motor motor);
+ RW.set_int16 data 2 speed;
+ RW.set_uint8 data 4 (int_of_direction dir);
+ Card.send_command card Protocol.cmd_traj data
+
+ let traj_start card ~motor =
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.traj_start;
+ RW.set_uint8 data 1 (int_of_motor motor);
+ Card.send_command card Protocol.cmd_traj data
+
+ let init_lm629 card =
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.traj_init;
+ Card.send_command card Protocol.cmd_traj data
+
+ let enable card =
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.motor_enable;
+ RW.set_uint8 data 1 Protocol.motor_both;
+ Card.send_command card Protocol.cmd_motor data
+
+ let stop card ~motor ~mode =
+ let data = String.create 4 in
+ RW.set_uint8 data 0 Protocol.traj_stop;
+ RW.set_uint8 data 1 (int_of_motor motor);
+ RW.set_uint16 data 2 (int_of_stop_mode mode);
+ Card.send_command card Protocol.cmd_traj data
+end
diff --git a/PC_Mainboard/driver/src/commands.mli b/PC_Mainboard/driver/src/commands.mli
new file mode 100644
index 0000000..7c0862c
--- /dev/null
+++ b/PC_Mainboard/driver/src/commands.mli
@@ -0,0 +1,52 @@
+(*
+ * commands.mli
+ * ------------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+(** All commands, by card *)
+
+(** {6 Common commands} *)
+
+val get_firmware_build : Card.t -> string Lwt.t
+val get_board_info : Card.t -> string Lwt.t
+val bootloader : Card.t -> unit Lwt.t
+
+module Compass : sig
+ val get : Card.t -> int Lwt.t
+end
+
+module AX12 : sig
+ val goto : Card.t -> id : int -> pos : int -> speed : int -> unit Lwt.t
+end
+
+module Logic_sensors : sig
+ val get : Card.t -> bool array Lwt.t
+end
+
+module Range_finders : sig
+ val get : Card.t -> int array Lwt.t
+end
+
+module Motor : sig
+ type t = [ `Left | `Right | `Both ]
+
+ val move : Card.t -> dist : int -> speed : int -> acc : int -> unit Lwt.t
+ val turn : Card.t -> angle : int -> speed : int -> acc : int -> unit Lwt.t
+
+ type stop_mode = [ `Off | `Abrupt | `Smooth ]
+
+ val stop : Card.t -> motor : t -> mode : stop_mode -> unit Lwt.t
+
+ type direction = [ `Forward | `Backward ]
+
+ val traj_new_velocity : Card.t -> motor : t -> speed : int -> acc : int -> dir : direction -> unit Lwt.t
+ val traj_change_velocity : Card.t -> motor : t -> speed : int -> dir : direction -> unit Lwt.t
+ val traj_start : Card.t -> motor : t -> unit Lwt.t
+
+ val enable : Card.t -> unit Lwt.t
+ val init_lm629 : Card.t -> unit Lwt.t
+end
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index 5d8b294..18d7203 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -51,20 +51,6 @@ let card_interface = Card.open_card ~name:"interface" ~vendor_id:Protocol.usb_vi
let card_sensor = Card.open_card ~name:"sensor" ~vendor_id:Protocol.usb_vid ~product_id:Protocol.usb_pid_proximity_sensor
let card_motor = Card.open_card ~name:"motor" ~vendor_id:Protocol.usb_vid ~product_id:Protocol.usb_pid_motor_controller
-(* Enable a motor *)
-let motor_enable card =
- Log#info "enabling motors on %s card" (Card.name card);
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.motor_enable;
- RW.set_uint8 data 1 Protocol.motor_both;
- Card.send_command card Protocol.cmd_motor data
-
-let init_lm629 card =
- Log#info "enabling lm629 on %s card" (Card.name card);
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.traj_init;
- Card.send_command card Protocol.cmd_traj data
-
(* Enable motors when a card comes up *)
let on_running card f =
let stop = ref ignore in
@@ -83,9 +69,8 @@ let on_running card f =
stop := (fun () -> Lwt_signal.disable notifier)
let () =
- on_running card_interface motor_enable;
- on_running card_motor
- (fun card -> motor_enable card <&> init_lm629 card)
+ on_running card_interface Commands.Motor.enable;
+ on_running card_motor (fun card -> Commands.Motor.enable card <&> Commands.Motor.init_lm629 card)
(* +-----------------------------------------------------------------+
| Compass |
@@ -109,12 +94,8 @@ struct
OL_signal Value : int
OL_method Get : int = fun dev -> return dev.data
- let get card =
- lwt data = Card.send_request card Protocol.get_cmp03_data "" in
- return (RW.get_int16 data 2)
-
let rec loop dev =
- lwt data = get dev.card in
+ lwt data = Commands.Compass.get dev.card in
if data <> dev.data then begin
dev.data <- data;
lwt () = value dev data in
@@ -152,16 +133,9 @@ struct
include OBus.MakeInterface(struct let name = "fr.krobot.Device.AX12" end)
- let ax12_goto dev id pos speed =
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.ax12_goto;
- RW.set_uint8 data 1 id;
- RW.set_uint16 data 2 pos;
- RW.set_uint16 data 4 speed;
- lwt _ = Card.send_request dev.card Protocol.cmd_ax12 data in
- return ()
-
- OL_method AX12Goto : int -> int -> int -> unit
+ OL_method AX12Goto : int -> int -> int -> unit =
+ fun dev id pos speed ->
+ Commands.AX12.goto dev.card id pos speed
let make card path = {
obus = OBus_object.make path;
@@ -173,7 +147,7 @@ end
| Logic sensors |
+-----------------------------------------------------------------+ *)
-module LogicSensors =
+module Logic_sensors =
struct
type t = {
obus : OBus_object.t;
@@ -191,15 +165,8 @@ struct
OL_signal Value : bool array
OL_method Get : bool array = fun dev -> return dev.data
- let get card =
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.get_tor_state;
- lwt data = Card.send_request card Protocol.cmd_get data in
- let x = RW.get_uint16 data 0 in
- return (Array.init 16 (fun i -> x land (1 lsl i) <> 0))
-
let rec loop dev =
- lwt data = get dev.card in
+ lwt data = Commands.Logic_sensors.get dev.card in
if data <> dev.data then begin
dev.data <- data;
lwt () = value dev data in
@@ -223,7 +190,7 @@ end
| Range finders |
+-----------------------------------------------------------------+ *)
-module RangeFinders =
+module Range_finders =
struct
type t = {
obus : OBus_object.t;
@@ -241,14 +208,8 @@ struct
OL_signal Value : int array
OL_method Get : int array = fun dev -> return dev.data
- let get card =
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.get_rangefinder_state;
- lwt data = Card.send_request card Protocol.cmd_get data in
- return (Array.init 8 (fun i -> RW.get_int32 data (i * 4)))
-
let rec loop dev =
- lwt data = get dev.card in
+ lwt data = Commands.Range_finders.get dev.card in
if data <> dev.data then begin
dev.data <- data;
lwt () = value dev data in
@@ -281,11 +242,15 @@ struct
obus : OBus_object.t;
card : Card.t;
- mutable acceleration : int option;
+ mutable acceleration : int;
(* The current acceleration *)
mutable state : unit React.signal;
(* Reinit [acceleraation] to None when the card state changes *)
+
+ mutable inhibit_forward_until : float;
+ mutable inhibit_backward_until : float;
+ (* Date after which motor's inhition should be stopped *)
}
module OBus = OBus_object.Make(struct
@@ -295,27 +260,28 @@ struct
include OBus.MakeInterface(struct let name = "fr.krobot.Device.Motors" end)
- let move cmd card arg1 arg2 arg3 =
- let data = String.create 7 in
- RW.set_uint8 data 0 cmd;
- RW.set_int16 data 1 arg1;
- RW.set_int16 data 3 arg2;
- RW.set_int16 data 5 arg3;
- Card.send_command card Protocol.cmd_traj data
-
- let turn dev angle speed acc =
- Log#info "motor: turn(angle=%d, speed=%d, acc=%d)" angle speed acc;
- if angle < 0 then
- move Protocol.traj_tl dev.card (-angle) speed acc
- else
- move Protocol.traj_tr dev.card angle speed acc
+ (* +---------------------------------------------------------------+
+ | High-level movement |
+ +---------------------------------------------------------------+ *)
let move dev dist speed acc =
Log#info "motor: move(dist=%d, speed=%d, acc=%d)" dist speed acc;
- if dist < 0 then
- move Protocol.traj_forward dev.card (-dist) speed acc
+ let date = Unix.gettimeofday () in
+ if (dist > 0 && date < dev.inhibit_forward_until) || (dist < 0 && date < dev.inhibit_backward_until) then
+ return ()
else
- move Protocol.traj_backward dev.card dist speed acc
+ Commands.Motor.move dev.card dist speed acc
+
+ let turn dev angle speed acc =
+ Log#info "motor: turn(angle=%d, speed=%d, acc=%d)" angle speed acc;
+ Commands.Motor.turn dev.card angle speed acc
+
+ OL_method Turn : int -> int -> int -> unit
+ OL_method Move : int -> int -> int -> unit
+
+ (* +---------------------------------------------------------------+
+ | Low-level control of speed and acceleration of each motor |
+ +---------------------------------------------------------------+ *)
let obus_motor = OBus_type.mapping obus_int
[(`Left, -1);
@@ -327,21 +293,11 @@ struct
(`Abrupt, 1);
(`Smooth, 2)]
- let int_of_motor = function
- | `Left -> Protocol.motor_left
- | `Both -> Protocol.motor_both
- | `Right -> Protocol.motor_right
-
let string_of_motor = function
| `Left -> "left"
| `Both -> "both"
| `Right -> "right"
- let int_of_stop_mode = function
- | `Off -> Protocol.traj_stop_motor_off
- | `Abrupt -> Protocol.traj_stop_abrupt
- | `Smooth -> Protocol.traj_stop_smooth
-
let string_of_stop_mode = function
| `Off -> "off"
| `Abrupt -> "abrupt"
@@ -349,65 +305,52 @@ struct
let stop_motors dev motor mode =
Log#info "motor: stopping(motor=%s, mode=%s)" (string_of_motor motor) (string_of_stop_mode mode);
- let data = String.create 4 in
- RW.set_uint8 data 0 Protocol.traj_stop;
- RW.set_uint8 data 1 (int_of_motor motor);
- RW.set_uint16 data 2 (int_of_stop_mode mode);
- Card.send_command dev.card Protocol.cmd_traj data
-
- (* Values comming from lm629.h *)
- let forward = 1
- let backward = -1
-
- let traj_new_velocity card motor vel acc dir =
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.traj_new_velocity;
- RW.set_uint8 data 1 (int_of_motor motor);
- RW.set_int16 data 2 vel;
- RW.set_int16 data 4 acc;
- RW.set_uint8 data 6 dir;
- Card.send_command card Protocol.cmd_traj data
-
- let traj_change_velocity card motor vel dir =
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.traj_change_velocity;
- RW.set_uint8 data 1 (int_of_motor motor);
- RW.set_int16 data 2 vel;
- RW.set_uint8 data 4 dir;
- Card.send_command card Protocol.cmd_traj data
-
- let traj_start card motor =
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.traj_start;
- RW.set_uint8 data 1 (int_of_motor motor);
- Card.send_command card Protocol.cmd_traj data
+ Commands.Motor.stop dev.card motor mode
let set_speed dev motor speed acc =
Log#info "motor: set_speed(motor=%s, speed=%d, acc=%d)" (string_of_motor motor) speed acc;
- let dir, speed = if speed < 0 then (backward, -speed) else (forward, speed) in
- lwt () =
- if Some acc <> dev.acceleration then begin
- dev.acceleration <- Some acc;
- traj_new_velocity dev.card motor speed acc dir
- end else
- traj_change_velocity dev.card motor speed dir
- in
- traj_start dev.card motor
+ let dir, speed = if speed < 0 then (`Backward, -speed) else (`Forward, speed) in
+ let date = Unix.gettimeofday () in
+ if (dir = `Forward && date < dev.inhibit_forward_until) || (dir = `Backward && date < dev.inhibit_backward_until) then
+ return ()
+ else
+ lwt () =
+ if acc <> dev.acceleration then begin
+ dev.acceleration <- acc;
+ Commands.Motor.traj_new_velocity dev.card motor speed acc dir
+ end else
+ Commands.Motor.traj_change_velocity dev.card motor speed dir
+ in
+ Commands.Motor.traj_start dev.card motor
- OL_method Turn : int -> int -> int -> unit
- OL_method Move : int -> int -> int -> unit
OL_method StopMotors : motor -> stop_mode -> unit
OL_method SetSpeed : motor -> int -> int -> unit
+ (* +---------------------------------------------------------------+
+ | Motors inhbition |
+ +---------------------------------------------------------------+ *)
+
+ OL_method InhibitForward : float -> unit =
+ fun dev delay ->
+ dev.inhibit_forward_until <- Unix.gettimeofday () +. delay;
+ return ()
+
+ OL_method InhibitBackward : float -> unit =
+ fun dev delay ->
+ dev.inhibit_forward_until <- Unix.gettimeofday () +. delay;
+ return ()
+
let make card path =
let dev = {
obus = OBus_object.make path;
card = card;
- acceleration = None;
+ acceleration = 0;
state = React.S.const ();
+ inhibit_forward_until = 0.0;
+ inhibit_backward_until = 0.0;
}
in
- dev.state <- React.S.map (fun state -> dev.acceleration <- None) (Card.state card);
+ dev.state <- React.S.map (fun state -> dev.acceleration <- 0) (Card.state card);
dev
end
@@ -448,6 +391,7 @@ struct
type t = {
card : Card.t;
obus : OBus_object.t;
+ mutable state : unit Lwt.t React.signal;
}
module OBus = OBus_object.Make(struct
@@ -466,31 +410,28 @@ struct
with Not_found ->
data
- OL_method GetFirmwareBuild : string = fun card ->
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.get_firmware_build;
- Card.send_request card.card Protocol.cmd_get data >|= string_of_azt
+ OL_method GetFirmwareBuild : string = fun dev ->
+ Commands.get_firmware_build dev.card
- OL_method GetBoardInfo : string = fun card ->
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.get_board_info;
- Card.send_request card.card Protocol.cmd_get data >|= string_of_azt
+ OL_method GetBoardInfo : string = fun dev ->
+ Commands.get_board_info dev.card
- OL_method GetState : Card.state = fun card ->
- return (React.S.value (Card.state card.card))
+ OL_method GetState : Card.state = fun dev ->
+ return (React.S.value (Card.state dev.card))
- OL_method Bootloader : unit = fun card ->
- Card.send_command card.card Protocol.cmd_bootloader ""
+ OL_method Bootloader : unit = fun dev ->
+ Commands.bootloader dev.card
OL_signal StateChanged : Card.state
let make card path =
- let card = {
+ let dev = {
card = card;
obus = OBus_object.make path;
+ state = React.S.const (return ());
} in
- Lwt_signal.always_notify_s (state_changed card) (Card.state card.card);
- card
+ dev.state <- React.S.map (state_changed dev) (Card.state dev.card);
+ dev
end
(* +-----------------------------------------------------------------+
@@ -542,8 +483,8 @@ lwt () =
AX12.OBus.export bus (AX12.make card_interface ["fr"; "krobot"; "Devices"; "AX12"]);
(* Sensor card *)
- LogicSensors.OBus.export bus (LogicSensors.make card_sensor ["fr"; "krobot"; "Devices"; "LogicSensors"]);
- RangeFinders.OBus.export bus (RangeFinders.make card_sensor ["fr"; "krobot"; "Devices"; "RangeFinders"]);
+ Logic_sensors.OBus.export bus (Logic_sensors.make card_sensor ["fr"; "krobot"; "Devices"; "LogicSensors"]);
+ Range_finders.OBus.export bus (Range_finders.make card_sensor ["fr"; "krobot"; "Devices"; "RangeFinders"]);
(* Motor card *)
Motors.OBus.export bus (Motors.make card_motor ["fr"; "krobot"; "Devices"; "Motors"]);
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-09 21:29:07
|
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 d3193fa311b9c329e7b009ac3eadf26602f3628f (commit)
from 47ce2657ec649f47a042dd2bb2dc6d18cdb14d56 (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 d3193fa311b9c329e7b009ac3eadf26602f3628f
Author: Jérémie Dimino <je...@di...>
Date: Tue Feb 9 22:27:12 2010 +0100
remove old stuff
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.ml b/PC_Mainboard/clients/lib-krobot/krobot.ml
index 02352ac..25d225c 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.ml
+++ b/PC_Mainboard/clients/lib-krobot/krobot.ml
@@ -149,38 +149,7 @@ let jack krobot =
include MakeDevice(struct let name = "AX12" end)
-OP_method OpenClaw : unit
-OP_method CloseClaw : unit
-OP_method OpenCylinder : unit
-OP_method CloseCylinder : unit
-
-(* +-----------------------------------------------------------------+
- | Elevator |
- +-----------------------------------------------------------------+ *)
-
-include MakeDevice(struct let name = "Elevator" end)
-
-OP_method ElevatorUp : int -> int -> unit
-OP_method ElevatorDown : int -> int -> unit
-
-let opt = function
- | Some d -> d
- | None -> -1
-
-let elevator_up krobot ?speed ?delay () =
- elevator_up krobot (opt speed) (opt delay)
-
-let elevator_down krobot ?speed ?delay () =
- elevator_down krobot (opt speed) (opt delay)
-
-(* +-----------------------------------------------------------------+
- | Grip |
- +-----------------------------------------------------------------+ *)
-
-include MakeDevice(struct let name = "Grip" end)
-
-OP_method OpenGrip : unit
-OP_method CloseGrip : unit
+OP_method AX12Goto : id : int -> pos : int -> speed : int -> unit
(* +-----------------------------------------------------------------+
| Motors |
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.mli b/PC_Mainboard/clients/lib-krobot/krobot.mli
index 065439c..9d0134e 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.mli
+++ b/PC_Mainboard/clients/lib-krobot/krobot.mli
@@ -50,21 +50,7 @@ val range_finders : t -> int array React.signal
(** {6 Manipulation of AX12s} *)
-val open_claw : t -> unit Lwt.t
-val close_claw : t -> unit Lwt.t
-
-val open_cylinder : t -> unit Lwt.t
-val close_cylinder : t -> unit Lwt.t
-
-(** {6 Manipulation of the elevator} *)
-
-val elevator_up : t -> ?speed : int -> ?delay : int -> unit -> unit Lwt.t
-val elevator_down : t -> ?speed : int -> ?delay : int -> unit -> unit Lwt.t
-
-(** {6 Manipulation of the grip} *)
-
-val open_grip : t -> unit Lwt.t
-val close_grip : t -> unit Lwt.t
+val ax12_goto : t -> id : int -> pos : int -> speed : int -> unit Lwt.t
(** {6 Motors} *)
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index 46d8587..5d8b294 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -152,110 +152,16 @@ struct
include OBus.MakeInterface(struct let name = "fr.krobot.Device.AX12" end)
- let ax12_goto card id pos speed =
+ let ax12_goto dev id pos speed =
let data = Card.make_buffer () in
RW.set_uint8 data 0 Protocol.ax12_goto;
RW.set_uint8 data 1 id;
RW.set_uint16 data 2 pos;
RW.set_uint16 data 4 speed;
- lwt _ = Card.send_request card Protocol.cmd_ax12 data in
+ lwt _ = Card.send_request dev.card Protocol.cmd_ax12 data in
return ()
- OL_method OpenClaw : unit = fun dev ->
- ax12_goto dev.card 1 1023 0
-
- OL_method CloseClaw : unit = fun dev ->
- ax12_goto dev.card 1 770 0
-
- OL_method OpenCylinder : unit = fun dev ->
- ax12_goto dev.card 2 154 0
-
- OL_method CloseCylinder : unit = fun dev ->
- ax12_goto dev.card 2 579 0
-
- let make card path = {
- obus = OBus_object.make path;
- card = card;
- }
-end
-
-(* +-----------------------------------------------------------------+
- | Elevator |
- +-----------------------------------------------------------------+ *)
-
-module Elevator =
-struct
- type t = {
- obus : OBus_object.t;
- card : Card.t;
- }
-
- module OBus = OBus_object.Make(struct
- type obj = t
- let get obj = obj.obus
- end)
-
- include OBus.MakeInterface(struct let name = "fr.krobot.Device.Elevator" end)
-
- let motor_move card sens speed duration =
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.motor_move;
- RW.set_uint8 data 1 Protocol.motor_right;
- RW.set_uint8 data 2 (if sens < 0 then 200 else sens);
- RW.set_uint8 data 3 (if speed < 0 then 2000 else speed);
- RW.set_uint32 data 4 duration;
- Card.send_command card Protocol.cmd_motor data
-
- OL_method ElevatorUp : int -> int -> unit = fun dev speed delay ->
- motor_move dev.card 0 speed delay
-
- OL_method ElevatorDown : int -> int -> unit = fun dev speed delay ->
- motor_move dev.card 1 speed delay
-
- let make card path = {
- obus = OBus_object.make path;
- card = card;
- }
-end
-
-(* +-----------------------------------------------------------------+
- | Grip |
- +-----------------------------------------------------------------+ *)
-
-module Grip =
-struct
- type t = {
- obus : OBus_object.t;
- card : Card.t;
- }
-
- module OBus = OBus_object.Make(struct
- type obj = t
- let get obj = obj.obus
- end)
-
-
- include OBus.MakeInterface(struct let name = "fr.krobot.Device.Grip" end)
-
- let set_servo_state card angles =
- let data = Card.make_buffer () in
- RW.set_uint8 data 0 Protocol.set_servo_state;
- RW.set_uint8 data 1 (List.fold_left (fun acc (s, _) -> acc lor (1 lsl s)) 0 angles);
- List.iter (fun (s, a) -> RW.set_uint8 data (2 + s) a) angles;
- Card.send_command card Protocol.cmd_set data
-
- let left = 1
- let right = 2
-
- OL_method OpenGrip : unit = fun dev ->
- lwt () = set_servo_state dev.card [(left, 45); (right, -5)] in
- lwt () = Lwt_unix.sleep 0.5 in
- set_servo_state dev.card [(left, 10); (right, 45)]
-
- OL_method CloseGrip : unit = fun dev ->
- lwt () = set_servo_state dev.card [(right, -10)] in
- lwt () = Lwt_unix.sleep 0.2 in
- set_servo_state dev.card [(left, 50)]
+ OL_method AX12Goto : int -> int -> int -> unit
let make card path = {
obus = OBus_object.make path;
@@ -634,8 +540,6 @@ lwt () =
(* Interface card *)
Compass.OBus.export bus (Compass.make card_interface ["fr"; "krobot"; "Devices"; "Compass"]);
AX12.OBus.export bus (AX12.make card_interface ["fr"; "krobot"; "Devices"; "AX12"]);
- Elevator.OBus.export bus (Elevator.make card_interface ["fr"; "krobot"; "Devices"; "Elevator"]);
- Grip.OBus.export bus (Grip.make card_interface ["fr"; "krobot"; "Devices"; "Grip"]);
(* Sensor card *)
LogicSensors.OBus.export bus (LogicSensors.make card_sensor ["fr"; "krobot"; "Devices"; "LogicSensors"]);
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-08 16:08:23
|
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 47ce2657ec649f47a042dd2bb2dc6d18cdb14d56 (commit)
from dfcfe7e5c9efe6b7648973249ff9b311f74eb3f4 (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 47ce2657ec649f47a042dd2bb2dc6d18cdb14d56
Author: Jérémie Dimino <je...@di...>
Date: Mon Feb 8 17:07:29 2010 +0100
Add a command to put a card into bootloader mode
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.ml b/PC_Mainboard/clients/lib-krobot/krobot.ml
index 155affe..02352ac 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.ml
+++ b/PC_Mainboard/clients/lib-krobot/krobot.ml
@@ -233,6 +233,7 @@ struct
OP_method GetFirmwareBuild : string
OP_method GetBoardInfo : string
+ OP_method Bootloader : unit
let proxy krobot card =
OBus_proxy.make krobot.peer
@@ -243,4 +244,5 @@ struct
let get_firmware_build krobot card = get_firmware_build (proxy krobot card)
let get_board_info krobot card = get_board_info (proxy krobot card)
+ let bootloader krobot card = bootloader (proxy krobot card)
end
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.mli b/PC_Mainboard/clients/lib-krobot/krobot.mli
index 4c7046b..065439c 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.mli
+++ b/PC_Mainboard/clients/lib-krobot/krobot.mli
@@ -93,6 +93,9 @@ module Card : sig
val state : t -> card -> state React.signal
(** Returns the status of one of the card of the krobot *)
+ val bootloader : t -> card -> unit Lwt.t
+ (** Put the card into bootloader mode *)
+
val get_firmware_build : t -> card -> string Lwt.t
val get_board_info : t -> card -> string Lwt.t
end
diff --git a/PC_Mainboard/clients/tools/script.ml b/PC_Mainboard/clients/tools/script.ml
index 3fc468c..69bb06b 100644
--- a/PC_Mainboard/clients/tools/script.ml
+++ b/PC_Mainboard/clients/tools/script.ml
@@ -39,6 +39,8 @@ let commands = [
args = [("motor", Arg_keyword ["left"; "right"; "both"]);
("speed", Arg_int);
("acc", Arg_int)] };
+ { name = "bootloader";
+ args = [("card", Arg_keyword ["interface"; "sensor"; "motor"])] };
]
let set_of_list l = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty l
@@ -121,6 +123,13 @@ let exec krobot line =
~motor:(motor_of_string (arg_string "motor" "both"))
~speed:(arg_int "speed" 100)
~acc:(arg_int "acc" 800)
+ | "bootloader" ->
+ Krobot.Card.bootloader krobot
+ (match arg_string "card" "" with
+ | "interface" -> `Interface
+ | "motor" -> `Motor
+ | "sensor" -> `Sensor
+ | _ -> failwith "Script.exec: invalid card")
| _ ->
return ()
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index 12b2eea..46d8587 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -573,6 +573,9 @@ struct
OL_method GetState : Card.state = fun card ->
return (React.S.value (Card.state card.card))
+ OL_method Bootloader : unit = fun card ->
+ Card.send_command card.card Protocol.cmd_bootloader ""
+
OL_signal StateChanged : Card.state
let make card path =
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-08 14:42:12
|
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 dfcfe7e5c9efe6b7648973249ff9b311f74eb3f4 (commit)
from ace431c50b3e2e6e627a6536612a0ec59f52415b (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 dfcfe7e5c9efe6b7648973249ff9b311f74eb3f4
Author: Jérémie Dimino <je...@di...>
Date: Mon Feb 8 15:39:20 2010 +0100
modification of forward/backward
forward: 0 --> 1
backward: 4096 --> -1
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index 2defde7..12b2eea 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -450,28 +450,28 @@ struct
Card.send_command dev.card Protocol.cmd_traj data
(* Values comming from lm629.h *)
- let forward = 0
- let backward = 4096
+ let forward = 1
+ let backward = -1
let traj_new_velocity card motor vel acc dir =
- let data = String.create 8 in
+ let data = Card.make_buffer () in
RW.set_uint8 data 0 Protocol.traj_new_velocity;
RW.set_uint8 data 1 (int_of_motor motor);
RW.set_int16 data 2 vel;
RW.set_int16 data 4 acc;
- RW.set_int16 data 6 dir;
+ RW.set_uint8 data 6 dir;
Card.send_command card Protocol.cmd_traj data
let traj_change_velocity card motor vel dir =
- let data = String.create 6 in
+ let data = Card.make_buffer () in
RW.set_uint8 data 0 Protocol.traj_change_velocity;
RW.set_uint8 data 1 (int_of_motor motor);
RW.set_int16 data 2 vel;
- RW.set_int16 data 4 dir;
+ RW.set_uint8 data 4 dir;
Card.send_command card Protocol.cmd_traj data
let traj_start card motor =
- let data = String.create 2 in
+ let data = Card.make_buffer () in
RW.set_uint8 data 0 Protocol.traj_start;
RW.set_uint8 data 1 (int_of_motor motor);
Card.send_command card Protocol.cmd_traj data
hooks/post-receive
--
krobot
|
|
From: Olivier B. <Ba...@us...> - 2010-02-06 23:25:33
|
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 ace431c50b3e2e6e627a6536612a0ec59f52415b (commit)
from d20d36411564c18754df8e21bb83a382fb05b81c (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 ace431c50b3e2e6e627a6536612a0ec59f52415b
Author: Olivier BICHLER <oli...@gm...>
Date: Sun Feb 7 00:23:44 2010 +0100
Ajout roulements à billes pour guidage robot
-----------------------------------------------------------------------
Changes:
diff --git a/meca/Base assemblee.CATProduct b/meca/Base assemblee.CATProduct
index 0d66338..4a8926d 100644
Binary files a/meca/Base assemblee.CATProduct and b/meca/Base assemblee.CATProduct differ
diff --git a/meca/Base.CATPart b/meca/Base.CATPart
index eed1389..70ba0fb 100644
Binary files a/meca/Base.CATPart and b/meca/Base.CATPart differ
diff --git a/meca/Bras tige 1.CATPart b/meca/Bras tige 1.CATPart
index 568a397..96a2425 100644
Binary files a/meca/Bras tige 1.CATPart and b/meca/Bras tige 1.CATPart differ
diff --git a/meca/Bras.CATProduct b/meca/Bras.CATProduct
index acf2a94..1ee480b 100644
Binary files a/meca/Bras.CATProduct and b/meca/Bras.CATProduct differ
diff --git a/meca/Niveau 1.CATPart b/meca/Niveau 1.CATPart
index 86b428a..78bcd26 100644
Binary files a/meca/Niveau 1.CATPart and b/meca/Niveau 1.CATPart differ
diff --git a/meca/Niveau 2.CATPart b/meca/Niveau 2.CATPart
index a415a45..81fc0a8 100644
Binary files a/meca/Niveau 2.CATPart and b/meca/Niveau 2.CATPart differ
diff --git a/meca/Roulement a billes 4 mm.CATPart b/meca/Roulement a billes 4 mm.CATPart
new file mode 100644
index 0000000..6fca730
Binary files /dev/null and b/meca/Roulement a billes 4 mm.CATPart differ
hooks/post-receive
--
krobot
|
|
From: Olivier B. <Ba...@us...> - 2010-02-06 21:55:33
|
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 d20d36411564c18754df8e21bb83a382fb05b81c (commit)
from 17d7a6d6d371fa80d0abc17b4e3d0b03c58c49b6 (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 d20d36411564c18754df8e21bb83a382fb05b81c
Author: Olivier BICHLER <oli...@gm...>
Date: Sat Feb 6 22:54:43 2010 +0100
Ajout de trous de fixation pour des capteurs éventuels
-----------------------------------------------------------------------
Changes:
diff --git a/meca/Base assemblee.CATProduct b/meca/Base assemblee.CATProduct
index 4bc8e52..0d66338 100644
Binary files a/meca/Base assemblee.CATProduct and b/meca/Base assemblee.CATProduct differ
diff --git a/meca/Base.CATPart b/meca/Base.CATPart
index ddf677e..eed1389 100644
Binary files a/meca/Base.CATPart and b/meca/Base.CATPart differ
diff --git a/meca/Bras tige 1.CATPart b/meca/Bras tige 1.CATPart
index 7b8476d..568a397 100644
Binary files a/meca/Bras tige 1.CATPart and b/meca/Bras tige 1.CATPart differ
diff --git a/meca/Bras.CATProduct b/meca/Bras.CATProduct
index 7959cf0..acf2a94 100644
Binary files a/meca/Bras.CATProduct and b/meca/Bras.CATProduct differ
diff --git a/meca/Niveau 1.CATPart b/meca/Niveau 1.CATPart
index 95c2a2b..86b428a 100644
Binary files a/meca/Niveau 1.CATPart and b/meca/Niveau 1.CATPart differ
diff --git a/meca/Niveau 2 bac.CATPart b/meca/Niveau 2 bac.CATPart
index 4f850b4..fd39492 100644
Binary files a/meca/Niveau 2 bac.CATPart and b/meca/Niveau 2 bac.CATPart differ
diff --git a/meca/Niveau 2.CATPart b/meca/Niveau 2.CATPart
index 4ce505a..a415a45 100644
Binary files a/meca/Niveau 2.CATPart and b/meca/Niveau 2.CATPart differ
hooks/post-receive
--
krobot
|
|
From: Olivier B. <Ba...@us...> - 2010-02-06 18:00:35
|
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 17d7a6d6d371fa80d0abc17b4e3d0b03c58c49b6 (commit)
from ed43d4c1bc88439af91de49e40066f14379f1654 (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 17d7a6d6d371fa80d0abc17b4e3d0b03c58c49b6
Author: Olivier BICHLER <oli...@gm...>
Date: Sat Feb 6 18:59:23 2010 +0100
Ajout fixation cartes + diverses optimisations
-----------------------------------------------------------------------
Changes:
diff --git a/meca/Base assemblee.CATProduct b/meca/Base assemblee.CATProduct
index c0046b7..4bc8e52 100644
Binary files a/meca/Base assemblee.CATProduct and b/meca/Base assemblee.CATProduct differ
diff --git a/meca/Base bac.CATPart b/meca/Base bac.CATPart
index 5726740..3469928 100644
Binary files a/meca/Base bac.CATPart and b/meca/Base bac.CATPart differ
diff --git a/meca/Base.CATPart b/meca/Base.CATPart
index 278f566..ddf677e 100644
Binary files a/meca/Base.CATPart and b/meca/Base.CATPart differ
diff --git a/meca/Bras tige 1.CATPart b/meca/Bras tige 1.CATPart
index 586b2a0..7b8476d 100644
Binary files a/meca/Bras tige 1.CATPart and b/meca/Bras tige 1.CATPart differ
diff --git a/meca/Bras.CATProduct b/meca/Bras.CATProduct
index fee3600..7959cf0 100644
Binary files a/meca/Bras.CATProduct and b/meca/Bras.CATProduct differ
diff --git a/meca/Courroie.CATPart b/meca/Courroie.CATPart
index 77d81e3..d5ddf2f 100644
Binary files a/meca/Courroie.CATPart and b/meca/Courroie.CATPart differ
diff --git a/meca/Ecrou/Ecrou M3 autoblocant.CATPart b/meca/Ecrou/Ecrou M3 autoblocant.CATPart
new file mode 100644
index 0000000..348cce3
Binary files /dev/null and b/meca/Ecrou/Ecrou M3 autoblocant.CATPart differ
diff --git a/meca/Entretoise/Entretoise M3 F-F 10mm.CATPart b/meca/Entretoise/Entretoise M3 F-F 10mm.CATPart
new file mode 100644
index 0000000..54b98ec
Binary files /dev/null and b/meca/Entretoise/Entretoise M3 F-F 10mm.CATPart differ
diff --git a/meca/Entretoise/Entretoise M3 M-F 10mm.CATPart b/meca/Entretoise/Entretoise M3 M-F 10mm.CATPart
index bcfac18..4dcbb52 100644
Binary files a/meca/Entretoise/Entretoise M3 M-F 10mm.CATPart and b/meca/Entretoise/Entretoise M3 M-F 10mm.CATPart differ
diff --git a/meca/Entretoise/Entretoise M3 M-F 30mm.CATPart b/meca/Entretoise/Entretoise M3 M-F 30mm.CATPart
index 0bb2c92..1d8b4ec 100644
Binary files a/meca/Entretoise/Entretoise M3 M-F 30mm.CATPart and b/meca/Entretoise/Entretoise M3 M-F 30mm.CATPart differ
diff --git a/meca/Entretoise/Entretoise M3 M-F 40mm.CATPart b/meca/Entretoise/Entretoise M3 M-F 40mm.CATPart
new file mode 100644
index 0000000..f6db1e5
Binary files /dev/null and b/meca/Entretoise/Entretoise M3 M-F 40mm.CATPart differ
diff --git a/meca/Niveau 1.CATPart b/meca/Niveau 1.CATPart
index b58e120..95c2a2b 100644
Binary files a/meca/Niveau 1.CATPart and b/meca/Niveau 1.CATPart differ
diff --git a/meca/Niveau 2.CATPart b/meca/Niveau 2.CATPart
index 5136df6..4ce505a 100644
Binary files a/meca/Niveau 2.CATPart and b/meca/Niveau 2.CATPart differ
diff --git a/meca/Pince guidage.CATPart b/meca/Pince guidage.CATPart
index fbca056..aba5224 100644
Binary files a/meca/Pince guidage.CATPart and b/meca/Pince guidage.CATPart differ
diff --git a/meca/Support BH0102-40-606.CATPart b/meca/Support BH0102-40-606.CATPart
index 91bae83..950355e 100644
Binary files a/meca/Support BH0102-40-606.CATPart and b/meca/Support BH0102-40-606.CATPart differ
diff --git a/meca/Vis/Vis tete bombee hexa M3x12.CATPart b/meca/Vis/Vis tete bombee hexa M3x12.CATPart
new file mode 100644
index 0000000..97ece80
Binary files /dev/null and b/meca/Vis/Vis tete bombee hexa M3x12.CATPart differ
diff --git a/meca/Vis/Vis tete bombee hexa M4x10.CATPart b/meca/Vis/Vis tete bombee hexa M4x10.CATPart
new file mode 100644
index 0000000..b5f08c3
Binary files /dev/null and b/meca/Vis/Vis tete bombee hexa M4x10.CATPart differ
hooks/post-receive
--
krobot
|
|
From: Olivier B. <Ba...@us...> - 2010-02-05 18:24:07
|
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 ed43d4c1bc88439af91de49e40066f14379f1654 (commit)
from 68d618fe759888d1531780cc195c6f35fc75bbff (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 ed43d4c1bc88439af91de49e40066f14379f1654
Author: Olivier BICHLER <oli...@gm...>
Date: Fri Feb 5 19:23:10 2010 +0100
Correction du firmware de la carte Motor_Controller pour que le sens de rotation des moteurs soit cohérent (à tester)
-----------------------------------------------------------------------
Changes:
diff --git a/USB_Module/Motor_Controller/Firmware/Motor_Controller.mcw b/USB_Module/Motor_Controller/Firmware/Motor_Controller.mcw
index 8677ac5..e9cc119 100644
Binary files a/USB_Module/Motor_Controller/Firmware/Motor_Controller.mcw and b/USB_Module/Motor_Controller/Firmware/Motor_Controller.mcw differ
diff --git a/USB_Module/Motor_Controller/Firmware/lm629.c b/USB_Module/Motor_Controller/Firmware/lm629.c
index bcf050b..77d23a7 100644
--- a/USB_Module/Motor_Controller/Firmware/lm629.c
+++ b/USB_Module/Motor_Controller/Firmware/lm629.c
@@ -481,22 +481,26 @@ void newPosition(char axis, DWORD pos, DWORD vel, DWORD acc) {
* l'accration ne peut pas e changen court de trajectoire
*
* @param dir sens de rotation, peut valoir : @n
- * #LM_LTRJ_FORWARD_DIR avance @n
- * #LM_LTRJ_BACKWARD_DIR recule
+ * >= 0 avance @n
+ * < 0 recule
*/
-void newVelocity(char axis, DWORD vel, DWORD acc, WORD dir) {
+void newVelocity(char axis, DWORD vel, DWORD acc, char dir) {
DWORD_VAL velData = {vel};
DWORD_VAL accData = {acc};
+ WORD dirArg = 0;
writeCommand(axis, LM_CMD_LTRJ);
+ if (dir >= 0)
+ dirArg = LM_LTRJ_FORWARD_DIR;
+
if (accData.Val != NULL) {
- writeDataWord(axis, LM_LTRJ_LOAD_VEL | LM_LTRJ_LOAD_ACC | LM_LTRJ_VEL_MODE | dir);
+ writeDataWord(axis, LM_LTRJ_LOAD_VEL | LM_LTRJ_LOAD_ACC | LM_LTRJ_VEL_MODE | dirArg);
writeDataWord(axis, accData.word.HW);
writeDataWord(axis, accData.word.LW);
}
else
- writeDataWord(axis, LM_LTRJ_LOAD_VEL | LM_LTRJ_VEL_MODE | dir);
+ writeDataWord(axis, LM_LTRJ_LOAD_VEL | LM_LTRJ_VEL_MODE | dirArg);
writeDataWord(axis, velData.word.HW);
writeDataWord(axis, velData.word.LW);
@@ -512,10 +516,10 @@ void newVelocity(char axis, DWORD vel, DWORD acc, WORD dir) {
*
* @param vel vitesse, sur 16 bits
* @param dir sens de rotation, peut valoir : @n
- * #LM_LTRJ_FORWARD_DIR avance @n
- * #LM_LTRJ_BACKWARD_DIR recule
+ * >= 0 avance @n
+ * < 0 recule
*/
-void changeVelocity(char axis, DWORD vel, WORD dir) {
+void changeVelocity(char axis, DWORD vel, char dir) {
newVelocity(axis, vel, NULL, dir);
}
@@ -573,11 +577,11 @@ void moveForward(short pos, short vel, short acc) {
resetInterrupt(MOTOR_BOTH);
newPosition(MOTOR_RIGHT,
- - (long) ((float) pos * COEF_RIGHT_WHEEL),
+ CON_MOTOR_RIGHT * (long) ((float) pos * COEF_RIGHT_WHEEL),
(long) ((float) vel * COEF_RIGHT_WHEEL * CONST_VEL),
(long) ((float) acc * COEF_RIGHT_WHEEL * CONST_ACC));
newPosition(MOTOR_LEFT,
- (long) ((float) pos * COEF_LEFT_WHEEL),
+ CON_MOTOR_LEFT * (long) ((float) pos * COEF_LEFT_WHEEL),
(long) ((float) vel * COEF_LEFT_WHEEL * CONST_VEL),
(long) ((float) acc * COEF_LEFT_WHEEL * CONST_ACC));
@@ -595,11 +599,11 @@ void moveBackward(short pos, short vel, short acc) {
resetInterrupt(MOTOR_BOTH);
newPosition(MOTOR_RIGHT,
- (long) ((float) pos * COEF_RIGHT_WHEEL),
+ - CON_MOTOR_RIGHT * (long) ((float) pos * COEF_RIGHT_WHEEL),
(long) ((float) vel * COEF_RIGHT_WHEEL * CONST_VEL),
(long) ((float) acc * COEF_RIGHT_WHEEL * CONST_ACC));
newPosition(MOTOR_LEFT,
- - (long) ((float) pos * COEF_LEFT_WHEEL),
+ - CON_MOTOR_LEFT * (long) ((float) pos * COEF_LEFT_WHEEL),
(long) ((float) vel * COEF_LEFT_WHEEL * CONST_VEL),
(long) ((float) acc * COEF_LEFT_WHEEL * CONST_ACC));
@@ -617,11 +621,11 @@ void turnRight(short angle, short vel, short acc) {
resetInterrupt(MOTOR_BOTH);
newPosition(MOTOR_RIGHT,
- (long) ((float) angle * CONST_POS * WHEELS_DIST * COEF_RIGHT_WHEEL),
+ - CON_MOTOR_RIGHT * (long) ((float) angle * CONST_POS * WHEELS_DIST * COEF_RIGHT_WHEEL),
(long) ((float) vel * COEF_RIGHT_WHEEL * CONST_VEL),
(long) ((float) acc * COEF_RIGHT_WHEEL * CONST_ACC));
newPosition(MOTOR_LEFT,
- (long) ((float) angle * CONST_POS * WHEELS_DIST * COEF_LEFT_WHEEL),
+ CON_MOTOR_LEFT * (long) ((float) angle * CONST_POS * WHEELS_DIST * COEF_LEFT_WHEEL),
(long) ((float) vel * COEF_LEFT_WHEEL * CONST_VEL),
(long) ((float) acc * COEF_LEFT_WHEEL * CONST_ACC));
@@ -639,11 +643,11 @@ void turnLeft(short angle, short vel, short acc) {
resetInterrupt(MOTOR_BOTH);
newPosition(MOTOR_RIGHT,
- - (long) ((float) angle * CONST_POS * WHEELS_DIST * COEF_RIGHT_WHEEL),
+ CON_MOTOR_RIGHT * (long) ((float) angle * CONST_POS * WHEELS_DIST * COEF_RIGHT_WHEEL),
(long) ((float) vel * COEF_RIGHT_WHEEL * CONST_VEL),
(long) ((float) acc * COEF_RIGHT_WHEEL * CONST_ACC));
newPosition(MOTOR_LEFT,
- - (long) ((float) angle * CONST_POS * WHEELS_DIST * COEF_LEFT_WHEEL),
+ - CON_MOTOR_LEFT * (long) ((float) angle * CONST_POS * WHEELS_DIST * COEF_LEFT_WHEEL),
(long) ((float) vel * COEF_LEFT_WHEEL * CONST_VEL),
(long) ((float) acc * COEF_LEFT_WHEEL * CONST_ACC));
diff --git a/USB_Module/Motor_Controller/Firmware/lm629.h b/USB_Module/Motor_Controller/Firmware/lm629.h
index 479d779..a538f3e 100644
--- a/USB_Module/Motor_Controller/Firmware/lm629.h
+++ b/USB_Module/Motor_Controller/Firmware/lm629.h
@@ -19,10 +19,14 @@
//#define ENCODER_RES 15*500 ///< Impulsions du codeur par tour de roue (prendre en compte le rcteur selon le cas !)
//#define WHEELS_DIAMETER 80 ///< Diame des roues (en mm)
//#define WHEELS_DIST 268 ///< Distance entre les 2 roues (en mm)
+//#define CON_MOTOR_LEFT 1
+//#define CON_MOTOR_RIGHT 1
-#define ENCODER_RES 90 ///< Impulsions du codeur par tour de roue (prendre en compte le rcteur selon le cas !)
-#define WHEELS_DIAMETER 99 ///< Diame des roues (en mm)
-#define WHEELS_DIST 220 ///< Distance entre les 2 roues (en mm)
+#define ENCODER_RES 90 ///< Impulsions du codeur par tour de roue (prendre en compte le rcteur selon le cas !)
+#define WHEELS_DIAMETER 99 ///< Diame des roues (en mm)
+#define WHEELS_DIST 220 ///< Distance entre les 2 roues (en mm)
+#define CON_MOTOR_LEFT 1
+#define CON_MOTOR_RIGHT -1
/**
* Parames par dult du correcteur.
@@ -148,7 +152,6 @@
#define LM_LTRJ_STOP_SMOOTH 1024
#define LM_LTRJ_VEL_MODE 2048
#define LM_LTRJ_FORWARD_DIR 4096
-#define LM_LTRJ_BACKWARD_DIR 0
// Haut niveau
#define GOTO_STRAIGHT 0
@@ -195,8 +198,8 @@ void initLM(char axis, WORD kp, WORD ki, WORD kd, WORD il);
// Fonctions de gration des trajectoires
void newPosition(char axis, DWORD pos, DWORD vel, DWORD acc);
-void newVelocity(char axis, DWORD vel, DWORD acc, WORD dir);
-void changeVelocity(char axis, DWORD vel, WORD dir);
+void newVelocity(char axis, DWORD vel, DWORD acc, char dir);
+void changeVelocity(char axis, DWORD vel, char dir);
void start(char axis);
void stop(char axis, WORD type);
diff --git a/USB_Module/Motor_Controller/Firmware/main.c b/USB_Module/Motor_Controller/Firmware/main.c
index 99455f0..f668df4 100644
--- a/USB_Module/Motor_Controller/Firmware/main.c
+++ b/USB_Module/Motor_Controller/Firmware/main.c
@@ -1020,10 +1020,22 @@ void ProcessIO(void) {
word3.byte.HB = ReceivedDataBuffer.DATA[6];
word3.byte.LB = ReceivedDataBuffer.DATA[7];
- newPosition(ReceivedDataBuffer.DATA[1],
- (long) ((float) word1.Val * COEF_WHEEL),
- (long) ((float) word2.Val * COEF_WHEEL * CONST_VEL),
- (long) ((float) word3.Val * COEF_WHEEL * CONST_ACC));
+ if (ReceivedDataBuffer.DATA[1] == MOTOR_BOTH && CON_MOTOR_RIGHT != CON_MOTOR_LEFT) {
+ newPosition(MOTOR_RIGHT,
+ CON_MOTOR_RIGHT * (long) ((float) word1.Val * COEF_WHEEL),
+ (long) ((float) word2.Val * COEF_WHEEL * CONST_VEL),
+ (long) ((float) word3.Val * COEF_WHEEL * CONST_ACC));
+ newPosition(MOTOR_LEFT,
+ CON_MOTOR_LEFT * (long) ((float) word1.Val * COEF_WHEEL),
+ (long) ((float) word2.Val * COEF_WHEEL * CONST_VEL),
+ (long) ((float) word3.Val * COEF_WHEEL * CONST_ACC));
+ }
+ else {
+ newPosition(ReceivedDataBuffer.DATA[1],
+ CON_MOTOR_RIGHT * (long) ((float) word1.Val * COEF_WHEEL),
+ (long) ((float) word2.Val * COEF_WHEEL * CONST_VEL),
+ (long) ((float) word3.Val * COEF_WHEEL * CONST_ACC));
+ }
break;
case TRAJ_NEW_VELOCITY:
@@ -1031,24 +1043,42 @@ void ProcessIO(void) {
word1.byte.LB = ReceivedDataBuffer.DATA[3];
word2.byte.HB = ReceivedDataBuffer.DATA[4];
word2.byte.LB = ReceivedDataBuffer.DATA[5];
- word3.byte.HB = ReceivedDataBuffer.DATA[6];
- word3.byte.LB = ReceivedDataBuffer.DATA[7];
- newVelocity(ReceivedDataBuffer.DATA[1],
- (long) ((float) word1.Val * COEF_WHEEL * CONST_VEL),
- (long) ((float) word2.Val * COEF_WHEEL * CONST_ACC),
- word3.Val);
+ if (ReceivedDataBuffer.DATA[1] == MOTOR_BOTH && CON_MOTOR_RIGHT != CON_MOTOR_LEFT) {
+ newVelocity(MOTOR_RIGHT,
+ (long) ((float) word1.Val * COEF_WHEEL * CONST_VEL),
+ (long) ((float) word2.Val * COEF_WHEEL * CONST_ACC),
+ CON_MOTOR_RIGHT * ReceivedDataBuffer.DATA[6]);
+ newVelocity(MOTOR_LEFT,
+ (long) ((float) word1.Val * COEF_WHEEL * CONST_VEL),
+ (long) ((float) word2.Val * COEF_WHEEL * CONST_ACC),
+ CON_MOTOR_LEFT * ReceivedDataBuffer.DATA[6]);
+ }
+ else {
+ newVelocity(ReceivedDataBuffer.DATA[1],
+ (long) ((float) word1.Val * COEF_WHEEL * CONST_VEL),
+ (long) ((float) word2.Val * COEF_WHEEL * CONST_ACC),
+ CON_MOTOR_RIGHT * ReceivedDataBuffer.DATA[6]);
+ }
break;
case TRAJ_CHANGE_VELOCITY:
word1.byte.HB = ReceivedDataBuffer.DATA[2];
word1.byte.LB = ReceivedDataBuffer.DATA[3];
- word2.byte.HB = ReceivedDataBuffer.DATA[4];
- word2.byte.LB = ReceivedDataBuffer.DATA[5];
- changeVelocity(ReceivedDataBuffer.DATA[1],
- (long) ((float) word1.Val * COEF_WHEEL * CONST_VEL),
- word2.Val);
+ if (ReceivedDataBuffer.DATA[1] == MOTOR_BOTH && CON_MOTOR_RIGHT != CON_MOTOR_LEFT) {
+ changeVelocity(MOTOR_RIGHT,
+ (long) ((float) word1.Val * COEF_WHEEL * CONST_VEL),
+ CON_MOTOR_RIGHT * ReceivedDataBuffer.DATA[4]);
+ changeVelocity(MOTOR_LEFT,
+ (long) ((float) word1.Val * COEF_WHEEL * CONST_VEL),
+ CON_MOTOR_LEFT * ReceivedDataBuffer.DATA[4]);
+ }
+ else {
+ changeVelocity(ReceivedDataBuffer.DATA[1],
+ (long) ((float) word1.Val * COEF_WHEEL * CONST_VEL),
+ CON_MOTOR_RIGHT * ReceivedDataBuffer.DATA[4]);
+ }
break;
case TRAJ_START:
diff --git a/USB_Module/Motor_Controller/Firmware/output/Motor_controller.cof b/USB_Module/Motor_Controller/Firmware/output/Motor_controller.cof
index 6bb7b34..603e1c6 100644
Binary files a/USB_Module/Motor_Controller/Firmware/output/Motor_controller.cof and b/USB_Module/Motor_Controller/Firmware/output/Motor_controller.cof differ
diff --git a/USB_Module/Motor_Controller/Firmware/output/Motor_controller.hex b/USB_Module/Motor_Controller/Firmware/output/Motor_controller.hex
index da8ad26..32b1f0b 100644
--- a/USB_Module/Motor_Controller/Firmware/output/Motor_controller.hex
+++ b/USB_Module/Motor_Controller/Firmware/output/Motor_controller.hex
@@ -1,136 +1,136 @@
:020000040000FA
-:0600000053EF2FF0120087
+:060000002CEF33F01200AA
:0600080004EF04F01200F9
:060018000CEF04F01200E1
-:0608000053EF2FF012007F
+:060800002CEF33F01200A2
:060808002EEF04F01200C7
:0608180096EF04F012004F
-:06082A000400395F00002C
-:100830002601000021000000315F00005F01000080
-:1008400008000000235F0000470100000E000000C8
-:0C085000205F00006A01000003000000AF
+:06082A000400EB66000073
+:100830002601000021000000E36600005F010000C7
+:1008400008000000D5660000470100000E0000000F
+:0C085000D26600006A01000003000000F6
:04085C00DACFE4FF0C
:10086000E2CFDAFFE9CFE4FFEACFE4FFF6CFE4FF1F
:10087000F7CFE4FFF5CFE4FFF3CFE4FFF4CFE4FFDD
:10088000FACFE4FF00EE45F0140EE80403E3EECFE8
:10089000E4FFFBD700EE00F0450EE80403E3EECFE3
-:1008A000E4FFFBD794EC0FF09EA013D09EEC0FF06A
+:1008A000E4FFFBD760EC13F09EA013D06AEC13F0CA
:1008B00001014D2B000E4E23E80E4D5D030E4E59E7
-:1008C00005E34D6B4E6B4F2B000E5023FDEC27F0D4
-:1008D0009E90A7EC0FF002E2E16AE552E16EE5526C
+:1008C00005E34D6B4E6B4F2B000E5023D6EC2BF0F7
+:1008D0009E9073EC13F002E2E16AE552E16EE5529C
:1008E000E7CFD9FFE55200EE44F0450EE80403E3FC
:1008F000E5CFEDFFFBD700EE58F0140EE80403E35C
:10090000E5CFEDFFFBD7E5CFFAFFE5CFF4FFE5CF6D
:10091000F3FFE5CFF5FFE5CFF7FFE5CFF6FFE5CF36
:10092000EAFFE5CFE9FFE5CFDAFF1100D8CFE4FF1A
:10093000E0CFE4FFE46EDACFE4FFE2CFDAFFF3CFFB
-:10094000E4FFF4CFE4FF94EC0FF0A7EC0FF002E229
+:10094000E4FFF4CFE4FF60EC13F073EC13F002E289
:10095000E16AE552E16EE552E7CFD9FFE552E5CF16
:10096000F4FFE5CFF3FFE5CFDAFFE550E5CFE0FF99
-:10097000E5CFD8FF100004D8E0EC1AF060D8FCD71F
-:100980000F0EC11202D8AAEF1AF0B7EC0FF0E65220
-:100990006BEC0FF00101676F070E675D10E1E66A0F
-:1009A0006DEC2EF0E552DF6E000EDF80AFEC0FF045
-:1009B000E66A26EC2FF0E552DF70AFEC0FF0D08E38
+:10097000E5CFD8FF100004D8B9EC1EF060D8FCD742
+:100980000F0EC11202D883EF1EF083EC13F0E65273
+:1009900037EC13F00101676F070E675D10E1E66A3F
+:1009A00046EC32F0E552DF6E000EDF807BEC13F098
+:1009B000E66AFFEC32F0E552DF707BEC13F0D08E8C
:1009C000F28EF28CF30E8C1695160101476B486B74
:1009D000496B4A6B010E4B6FF90E921680160E0E84
-:1009E000E66E7C0EE66EE10EE66EE0EC2DF0E55272
+:1009E000E66E7C0EE66EE10EE66EB9EC31F0E55295
:1009F000E552E552CF0E9216939894943F0E9516B9
-:100A0000010EE66EBCEC0FF0E552838C8188828487
-:100A1000808A838E80888294010EE66E61EC2FF0CE
-:100A2000E55282849D80C50EE66EB6EC2EF0E5524E
-:100A30009EEC0FF0E552E552E7CFD9FF1200D9CF77
+:100A0000010EE66E88EC13F0E552838C81888284B7
+:100A1000808A838E80888294010EE66E3AEC33F0F1
+:100A2000E55282849D80C50EE66E8FEC32F0E55271
+:100A30006AEC13F0E552E552E7CFD9FF1200D9CFA7
:100A4000E6FFE1CFD9FF0F0EE12601014B5102E095
-:100A5000B0EC0EF0200E0101005D03E36D50020BBF
-:100A600002E0A6EF0EF0010149514A1102E1000E29
+:100A50007CEC12F0200E0101005D03E36D50020BEF
+:100A600002E072EF12F0010149514A1102E1000E59
:100A700008D049C1E9FF4AC1EAFFEF50800B01E00D
:100A8000010E000947E101014651EA6A260FE96EAD
:100A9000010EEA22EF5000083DE20501406B010122
:100AA0004C514C2B0501416F0501040E426F0101B1
:100AB0004651EA6A260FE96E010EEA22EFCF43F5AE
:100AC000400EE66E400EE66E050EE66E010EE66E18
-:100AD000010EE66EFBEC1EF0006E050EE15E0050AE
+:100AD000010EE66ED4EC22F0006E050EE15E0050D1
:100AE000F3CF49F1F4CF4AF101014651EA6A260FEA
:100AF000E96E010EEA22EF6A01014651000803E2A5
:100B00000101460707D001014551000803E2010138
:100B10001F0E466F010149514A1102E1000E08D033
:100B200049C1E9FF4AC1EAFFEF50800B01E0010E25
-:100B300000092CE10101520529E132EC17F000090E
+:100B300000092CE10101520529E10DEC1BF000092F
:100B400025E00501406B01014C514C2B0501416F23
:100B500005010A0E426F0501436B0501010E486F46
:100B6000400EE66E400EE66E050EE66E010EE66E77
-:100B7000010EE66EFBEC1EF0006E050EE15E00500D
+:100B7000010EE66ED4EC22F0006E050EE15E005030
:100B8000F3CF49F1F4CF4AF10101526B000E01019C
:100B9000E76E5119E8AE02D0513503D0E750D88046
:100BA000515501E38ED001015151FF0A29E0FD0AA0
-:100BB00013E0030A01E06ED0020EE66E49EC29F064
-:100BC000E552E3EC12F0000904E00101020E516F5E
+:100BB00013E0030A01E06ED0020EE66E22EC2DF087
+:100BC000E552AFEC16F0000904E00101020E516F8E
:100BD00002D00101516960D0200EE66E030EE66E70
-:100BE000C80EE66EE66AE80EE66E030EE66E35ECBB
-:100BF00014F0006E060EE15E00500101516B4CD006
+:100BE000C80EE66EE66AE80EE66E030EE66E0FECE1
+:100BF00018F0006E060EE15E00500101516B4CD002
:100C0000010149514A1102E1000E08D049C1E9FF32
:100C10004AC1EAFFEF50800B01E0010E000939E103
:100C20000501406B01014C514C2B0501416F050141
-:100C3000050E426F0501436B0501486BA10E006E66
-:100C40005B0E016E026A00C0E6FF01C0E6FF02C053
-:100C5000E6FF480EE66E050EE66E31EC2EF0036EF2
+:100C3000050E426F0501436B0501486B530E006EB4
+:100C4000630E016E026A00C0E6FF01C0E6FF02C04B
+:100C5000E6FF480EE66E050EE66E0AEC32F0036E15
:100C6000050EE15E0350400EE66E400EE66E050E88
-:100C7000E66E010EE66E010EE66EFBEC1EF0006EF7
+:100C7000E66E010EE66E010EE66ED4EC22F0006E1A
:100C8000050EE15E0050F3CF49F1F4CF4AF10101C6
-:100C9000516B02D00101516B020EE66EE66A7EECEA
-:100CA00012F0E552E55200090AE1020EE66E010E6D
-:100CB000E66E7EEC12F0E552E552000902E0010119
+:100C9000516B02D00101516B020EE66EE66A4AEC1E
+:100CA00016F0E552E55200090AE1020EE66E010E69
+:100CB000E66E4AEC16F0E552E552000902E0010149
:100CC000516901014751481102E1000E08D047C1A6
:100CD000E9FF48C1EAFFEF50800B01E0010E000977
-:100CE00002E0A6EF0EF005010251070A02E107EF4C
-:100CF0000EF00D0A01E10CD2010A01E1DCD10D0A6E
+:100CE00002E072EF12F005010251070A02E1D3EFB0
+:100CF00011F00D0A01E10CD2010A01E1DCD10D0A6B
:100D000001E174D1040A1AE0030A07E0010A02E0D3
-:100D100065EF0EF0FF00A6EF0EF0E66A6DEC2EF028
-:100D2000E552DF6E000EDB80DFCFE6FFE66A4DECBA
-:100D30002EF0E552E552FF00A6EF0EF001014951F9
+:100D100031EF12F0FF0072EF12F0E66A46EC32F0AB
+:100D2000E552DF6E000EDB80DFCFE6FFE66A26ECE1
+:100D300032F0E552E552FF0072EF12F00101495125
:100D40004A1102E1000E08D049C1E9FF4AC1EAFF99
:100D5000EF50800B01E0010E000901E045D100C514
:100D600040F50501416B0501030E426F0501436B20
:100D700005010851070A01E1BBD0010A01E17ED05B
:100D8000020A71E0070A64E0010A20E0030A06E0B3
:100D9000010A01E0FFD067C148F5FFD00501486BAB
-:100DA0007D0E006E5B0E016E026A00C0E6FF01C0A0
-:100DB000E6FF02C0E6FF480EE66E050EE66E31EC79
-:100DC0002EF0036E050EE15E0350E7D00501486B7F
-:100DD000710E006E5B0E016E026A00C0E6FF01C07C
-:100DE000E6FF02C0E6FF480EE66E050EE66E31EC49
-:100DF0002EF0036E050EE15E03506F0E006E5B0E6B
+:100DA0002F0E006E630E016E026A00C0E6FF01C0E6
+:100DB000E6FF02C0E6FF480EE66E050EE66E0AECA0
+:100DC00032F0036E050EE15E0350E7D00501486B7B
+:100DD000230E006E630E016E026A00C0E6FF01C0C2
+:100DE000E6FF02C0E6FF480EE66E050EE66E0AEC70
+:100DF00032F0036E050EE15E0350210E006E630EAD
:100E0000016E026A00C0E6FF01C0E6FF02C0E6FF15
-:100E1000480EE66E050EE66E31EC2EF0036E050E02
-:100E2000E15E0350660E006E5B0E016E026A00C04A
+:100E1000480EE66E050EE66E0AEC32F0036E050E25
+:100E2000E15E0350180E006E630E016E026A00C090
:100E3000E6FF01C0E6FF02C0E6FF480EE66E050EC3
-:100E4000E66E31EC2EF0036E050EE15E0350A5D088
+:100E4000E66E0AEC32F0036E050EE15E0350A5D0AB
:100E500092CF48F593CF49F594CF4AF595CF4BF50E
:100E600096CF4CF59AD080CF48F581CF49F582CF07
-:100E70004AF583CF4BF584CF4CF58FD0E66AA3ECCF
-:100E800028F0E552010E49C0DBFF020E4AC0DBFF2D
+:100E70004AF583CF4BF584CF4CF58FD0E66A7CECF6
+:100E80002CF0E552010E49C0DBFF020E4AC0DBFF29
:100E9000030E4BC0DBFF040E4CC0DBFF040EDBCFA8
:100EA00048F5030EDBCF49F5020EDBCF4AF5010E04
-:100EB000DBCF4BF5010EE66EA3EC28F0E552010EF8
+:100EB000DBCF4BF5010EE66E7CEC2CF0E552010E1B
:100EC00049C0DBFF020E4AC0DBFF030E4BC0DBFF55
:100ED000040E4CC0DBFF040EDBCF4CF5030EDBCF62
:100EE0004DF5020EDBCF4EF5010EDBCF4FF555D0A1
-:100EF0000A0EE66EE66A0CEC10F0E552E552E66A80
-:100F000070EC11F0E552030EF3CFDBFF040EF4CFCB
-:100F1000DBFFE66A70EC11F0E552DE52F3CFDEFF44
+:100EF0000A0EE66EE66AD8EC13F0E552E552E66AB1
+:100F00003CEC15F0E552030EF3CFDBFF040EF4CFFB
+:100F1000DBFFE66A3CEC15F0E552DE52F3CFDEFF74
:100F2000F4CFDDFFDD52040EDBCF48F5030EDBCF3F
:100F300049F5020EDBCF4AF5010EDBCF4BF50A0E69
-:100F4000E66E010EE66E0CEC10F0E552E552010E75
-:100F5000E66E70EC11F0E552030EF3CFDBFF040EEA
-:100F6000F4CFDBFF010EE66E70EC11F0E552DE52BD
+:100F4000E66E010EE66ED8EC13F0E552E552010EA6
+:100F5000E66E3CEC15F0E552030EF3CFDBFF040E1A
+:100F6000F4CFDBFF010EE66E3CEC15F0E552DE52ED
:100F7000F3CFDEFFF4CFDDFFDD52040EDBCF4CF507
:100F8000030EDBCF4DF5020EDBCF4EF5010EDBCFAE
:100F90004FF503D00501020E436F400EE66E400E82
-:100FA000E66E050EE66E010EE66E010EE66EFBECD9
-:100FB0001EF0006E050EE15E0050F3CF49F1F4CF54
+:100FA000E66E050EE66E010EE66E010EE66ED4EC00
+:100FB00022F0006E050EE15E0050F3CF49F1F4CF50
:100FC0004AF1400EE66E000EE66E050EE66EE66A2B
-:100FD000010EE66EFBEC1EF0006E050EE15E0050A9
-:100FE000F3CF47F1F4CF48F1A6EF0EF00501085119
+:100FD000010EE66ED4EC22F0006E050EE15E0050CC
+:100FE000F3CF47F1F4CF48F172EF12F00501085149
:100FF000030A37E0010A25E0030A13E0010A01E0D1
:1010000040D005010951921205010A5193120501C0
:101010000B51941205010C51951205010D519612B8
@@ -140,1297 +140,1418 @@
:101050000B1D8B1605010C1D8C1605010D1D8D1623
:1010600015D005010951891205010A518A1205019D
:101070000B518B1205010C518C1205010D518D1273
-:1010800005D0030EE66EF3EC2EF0E552400EE66E50
-:10109000000EE66E050EE66EE66A010EE66EFBECED
-:1010A0001EF0006E050EE15E0050F3CF47F1F4CF65
-:1010B00048F1A6EF0EF005010851020A09E0030A03
-:1010C00001E00CD009C5E6FF49EC29F0E5520BD050
-:1010D00009C5E6FF59EC29F0E55205D0010EE66E90
-:1010E000F3EC2EF0E552400EE66E000EE66E050EB5
-:1010F000E66EE66A010EE66EFBEC1EF0006E050E73
-:10110000E15E0050F3CF47F1F4CF48F1A6EF0EF0C7
-:1011100005010851060A02E1C6EF0DF0080A02E1D6
-:101120008CEF0DF0030A02E183EF0DF0070A02E1F4
-:101130001AEF0DF0030A01E1C0D3010A01E1D2D296
-:101140000F0A01E1B9D2020A01E16ED2010A01E1FE
-:101150003DD2070A01E10CD2010A01E1DBD1030A09
-:1011600001E1AAD1010A01E1A4D10C0A01E126D1D1
-:10117000030A01E194D0040A02E0EEEF0DF005014C
-:10118000095104E0020E0501095D40E10AC5E6FFD0
-:10119000010EE66E4DEC2EF0E552E5520BC5E6FF72
-:1011A000020EE66E4DEC2EF0E552E5520CC5E6FF60
-:1011B000030EE66E4DEC2EF0E552E5520DC5E6FF4E
-:1011C000040EE66E4DEC2EF0E552E5520EC5E6FF3C
-:1011D000050EE66E4DEC2EF0E552E5520FC5E6FF2A
-:1011E000060EE66E4DEC2EF0E552E55210C5E6FF18
-:1011F000070EE66E4DEC2EF0E552E55211C5E6FF06
-:10120000080EE66E4DEC2EF0E552E552050109059B
-:1012100004E0020E0501095D40E10AC5E6FF090E82
-:10122000E66E4DEC2EF0E552E5520BC5E6FF0A0ED8
-:10123000E66E4DEC2EF0E552E5520CC5E6FF0B0EC6
-:10124000E66E4DEC2EF0E552E5520DC5E6FF0C0EB4
-:10125000E66E4DEC2EF0E552E5520EC5E6FF0D0EA2
-:10126000E66E4DEC2EF0E552E5520FC5E6FF0E0E90
-:10127000E66E4DEC2EF0E552E55210C5E6FF0F0E7E
-:10128000E66E4DEC2EF0E552E55211C5E6FF100E6C
-:10129000E66E4DEC2EF0E552E552F3EF0DF000C591
-:1012A00040F50501416B0501030E426F0501436BDB
-:1012B000010EE66E6DEC2EF0E5520501486F020E50
-:1012C000E66E6DEC2EF0E5520501496F030EE66EF9
-:1012D0006DEC2EF0E55205014A6F040EE66E6DECE2
-:1012E0002EF0E55205014B6F050EE66E6DEC2EF00B
-:1012F000E55205014C6F060EE66E6DEC2EF0E552E0
-:1013000005014D6F070EE66E6DEC2EF0E5520501FE
-:101310004E6F080EE66E6DEC2EF0E55205014F6F34
-:10132000090EE66E6DEC2EF0E5520501506F0A0EC7
-:10133000E66E6DEC2EF0E5520501516F0B0EE66E78
-:101340006DEC2EF0E5520501526F0C0EE66E6DEC61
-:101350002EF0E5520501536F0D0EE66E6DEC2EF08A
-:10136000E5520501546F0E0EE66E6DEC2EF0E5525F
-:101370000501556F0F0EE66E6DEC2EF0E55205017E
-:10138000566F100EE66E6DEC2EF0E5520501576FAC
-:10139000400EE66E400EE66E050EE66E010EE66E3F
-:1013A000010EE66EFBEC1EF0006E050EE15E0050D5
-:1013B000F3CF49F1F4CF4AF1F3EF0DF0030EE66EEF
-:1013C000010EE66E4DEC2EF0E552E552E80EE66EAB
-:1013D000020EE66E4DEC2EF0E552E552E66A030E83
-:1013E000E66E4DEC2EF0E552E552010EE66E040E6F
-:1013F000E66E4DEC2EF0E552E552E66A050EE66E1D
-:101400004DEC2EF0E552E552E66A060EE66E4DEC26
-:101410002EF0E552E552270EE66E070EE66E4DEC15
-:101420002EF0E552E552100EE66E080EE66E4DEC1B
-:101430002EF0E552E552030EE66E090EE66E4DEC17
-:101440002EF0E552E552E80EE66E0A0EE66E4DEC21
-:101450002EF0E552E552E66A0B0EE66E4DEC2EF0EC
-:10146000E552E552010EE66E0C0EE66E4DEC2EF0E6
-:10147000E552E552E66A0D0EE66E4DEC2EF0E552B1
-:10148000E552E66A0E0EE66E4DEC2EF0E552E552A0
-:10149000270EE66E0F0EE66E4DEC2EF0E552E5528D
-:1014A000100EE66E100EE66E4DEC2EF0E552E55293
-:1014B0009AD3E3EC12F097D3060E09C5DBFF050EB5
-:1014C0000AC5DBFF080E0BC5DBFF070E0CC5DBFFF3
-:1014D0000A0E0DC5DBFF090E0EC5DBFF090EDBCFC3
-:1014E000E6FF0A0EDBCFE6FF070EDBCFE6FF080EB6
-:1014F000DBCFE6FF050EDBCFE6FF060EDBCFE6FF18
-:1015000035EC14F0006E060EE15E00500101010E94
-:10151000526F69D3060E09C5DBFF050E0AC5DBFF56
-:10152000080E0BC5DBFF070E0CC5DBFF0A0E0DC551
-:10153000DBFF090E0EC5DBFF090EDBCFE6FF0A0E4F
-:10154000DBCFE6FF070EDBCFE6FF080EDBCFE6FFC3
-:10155000050EDBCFE6FF060EDBCFE6FF40EC14F016
-:10156000006E060EE15E00500101010E526F3BD38A
-:10157000060E09C5DBFF050E0AC5DBFF080E0BC50D
-:10158000DBFF070E0CC5DBFF0A0E0DC5DBFF090EE6
-:101590000EC5DBFF090EDBCFE6FF0A0EDBCFE6FF51
-:1015A000070EDBCFE6FF080EDBCFE6FF050EDBCF35
-:1015B000E6FF060EDBCFE6FF4BEC14F0006E060EE6
-:1015C000E15E00500101010E526F0DD3060E09C5F8
-:1015D000DBFF050E0AC5DBFF080E0BC5DBFF070EA0
-:1015E0000CC5DBFF0A0E0DC5DBFF090E0EC5DBFFC8
-:1015F000090EDBCFE6FF0A0EDBCFE6FF070EDBCFDF
-:10160000E6FF080EDBCFE6FF050EDBCFE6FF060E9A
-:10161000DBCFE6FF5AEC14F0006E060EE15E0050E0
-:101620000101010E526FDFD2060E09C5DBFF050E68
-:101630000AC5DBFF080E0BC5DBFF070E0CC5DBFF81
-:101640000A0E0DC5DBFF090E0EC5DBFF0C0E0FC524
-:10165000DBFF0B0E10C5DBFF0E0E12C5DBFF0D0E00
-:1016600013C5DBFF0D0EDBCFE6FF0E0EDBCFE6FF73
-:1016700011C5E6FF0B0EDBCFE6FF0C0EDBCFE6FF5E
-:10168000090EDBCFE6FF0A0EDBCFE6FF070EDBCF4E
-:10169000E6FF080EDBCFE6FF050EDBCFE6FF060E0A
-:1016A000DBCFE6FF67EC14F0006E0B0EE15E00503E
-:1016B0000101010E526F97D2060E0AC5DBFF050E1F
-:1016C0000BC5DBFF050EDBCFE6FF060EDBCFE6FF2B
-:1016D00009C5E6FF2DEC14F0E552E552E552010193
-:1016E000526B81D2060E0AC5DBFF050E0BC5DBFF70
-:1016F000080E0CC5DBFF070E0DC5DBFF0A0E0EC57D
-:10170000DBFF090E0FC5DBFF090EDBCF4BF00A0E26
-:10171000DBCF4CF050EC20F04AC008F04BC009F091
-:101720004CC00AF04DC00BF0A60E4F6E280E506E46
-:10173000940E516E3F0E526E08C04AF009C04BF035
-:101740000AC04CF00BC04DF06AEC21F04AC004F026
-:101750004BC005F04CC006F04DC007F0CC0E4F6EEC
-:10176000BC0E506E8C0E516E3B0E526E04C04AF091
-:1017700005C04BF006C04CF007C04DF06AEC21F0FC
-:1017800006EC22F049C000F04AC001F04BC002F064
-:101790004CC003F000C0E6FF01C0E6FF02C0E6FF58
-:1017A00003C0E6FF070EDBCF4BF0080EDBCF4CF09B
-:1017B00050EC20F04AC014F04BC015F04CC016F0AD
-:1017C0004DC017F0A60E4F6E280E506E940E516E3F
-:1017D0003F0E526E14C04AF015C04BF016C04CF0CC
-:1017E00017C04DF06AEC21F04AC010F04BC011F068
-:1017F0004CC012F04DC013F0BD0E4F6E370E506E40
-:10180000860E516E410E526E10C04AF011C04BF060
-:1018100012C04CF013C04DF06AEC21F006EC22F03F
-:1018200049C00CF04AC00DF04BC00EF04CC00FF098
-:101830000CC0E6FF0DC0E6FF0EC0E6FF0FC0E6FFDE
-:10184000050EDBCF4BF0060EDBCF4CF050EC20F05A
-:101850004AC01CF04BC01DF04CC01EF04DC01FF024
-:10186000A60E4F6E280E506E940E516E3F0E526EA5
-:101870001CC04AF01DC04BF01EC04CF01FC04DF004
-:101880006AEC21F006EC22F049C018F04AC019F0C9
-:101890004BC01AF04CC01BF018C0E6FF19C0E6FFA1
-:1018A0001AC0E6FF1BC0E6FF09C5E6FF65EC13F0B2
-:1018B000206E0D0EE15E205096D1060E0AC5DBFFAC
-:1018C000050E0BC5DBFF080E0CC5DBFF070E0DC5B3
-:1018D000DBFF0A0E0EC5DBFF090E0FC5DBFF090E8D
-:1018E000DBCFE6FF0A0EDBCFE6FF070EDBCF4BF0C8
-:1018F000080EDBCF4CF050EC20F04AC008F04BC093
-:1019000009F04CC00AF04DC00BF0A60E4F6E280E29
-:10191000506E940E516E3F0E526E08C04AF009C0D0
-:101920004BF00AC04CF00BC04DF06AEC21F04AC0FD
-:1019300004F04BC005F04CC006F04DC007F0CC0ED3
-:101940004F6EBC0E506E8C0E516E3B0E526E04C02C
-:101950004AF005C04BF006C04CF007C04DF06AECF1
-:1019600021F006EC22F049C000F04AC001F04BC063
-:1019700002F04CC003F000C0E6FF01C0E6FF02C069
-:10198000E6FF03C0E6FF050EDBCF4BF0060EDBCF14
-:101990004CF050EC20F04AC014F04BC015F04CC095
-:1019A00016F04DC017F0A60E4F6E280E506E940E16
-:1019B000516E3F0E526E14C04AF015C04BF016C067
-:1019C0004CF017C04DF06AEC21F04AC010F04BC04B
-:1019D00011F04CC012F04DC013F0BD0E4F6E370E1B
-:1019E000506E860E516E410E526E10C04AF011C0FC
-:1019F0004BF012C04CF013C04DF06AEC21F006EC35
-:101A000022F049C00CF04AC00DF04BC00EF04CC0A3
-:101A10000FF00CC0E6FF0DC0E6FF0EC0E6FF0FC0E2
-:101A2000E6FF09C5E6FFABEC13F0186E0B0EE15EA6
-:101A30001850D9D0060E0AC5DBFF050E0BC5DBFF1B
-:101A4000080E0CC5DBFF070E0DC5DBFF070EDBCF55
-:101A5000E6FF080EDBCFE6FF050EDBCF4BF0060EF0
-:101A6000DBCF4CF050EC20F04AC008F04BC009F03E
-:101A70004CC00AF04DC00BF0A60E4F6E280E506EF3
-:101A8000940E516E3F0E526E08C04AF009C04BF0E2
-:101A90000AC04CF00BC04DF06AEC21F04AC004F0D3
-:101AA0004BC005F04CC006F04DC007F0BD0E4F6EA8
-:101AB000370E506E860E516E410E526E04C04AF0C3
-:101AC00005C04BF006C04CF007C04DF06AEC21F0A9
-:101AD00006EC22F049C000F04AC001F04BC002F011
-:101AE0004CC003F000C0E6FF01C0E6FF02C0E6FF05
-:101AF00003C0E6FF09C5E6FFE2EC13F00C6E070E2B
-:101B0000E15E0C5070D009C5E6FFFFEC13F0E55222
-:101B10000101010E526F67D001EC17F0050EF3CFF3
-:101B2000DBFF060EF4CFDBFF19EC17F0070EF3CF47
-:101B3000DBFF080EF4CFDBFF00C540F50501416B6C
-:101B40000501030E426F0501436B060EDBCF48F51E
-:101B5000050EDBCF49F5080EDBCF4AF5070EDBCFCC
-:101B60004BF5400EE66E400EE66E050EE66E010E7B
-:101B7000E66E010EE66EFBEC1EF0006E050EE15EF9
-:101B80000050F3CF49F1F4CF4AF12DD000C540F514
-:101B90000501416B0501030E426F0501436B32ECF9
-:101BA00017F0000904E00501010E486F02D005019D
-:101BB000486B400EE66E400EE66E050EE66E010EB8
-:101BC000E66E010EE66EFBEC1EF0006E050EE15EA9
-:101BD0000050F3CF49F1F4CF4AF105D0010EE66E83
-:101BE000F3EC2EF0E552400EE66E000EE66E050EAA
-:101BF000E66EE66A010EE66EFBEC1EF0006E050E68
-:101C0000E15E0050F3CF47F1F4CF48F19FD00101DE
-:101C100049514A1102E1000E08D049C1E9FF4AC109
-:101C2000EAFFEF50800B01E0010E00094DE10101D8
-:101C3000010E516F0501406B01014C514C2B050108
-:101C4000416F0501050E426F0501436B0501486BAD
-:101C5000520E006E5B0E016E026A00C0E6FF01C00C
-:101C6000E6FF02C0E6FF480EE66E050EE66E31ECBA
-:101C70002EF0036E050EE15E0350400EE66E400E40
-:101C8000E66E050EE66E010EE66E010EE66EFBECEC
-:101C90001EF0006E050EE15E0050F3CF49F1F4CF67
-:101CA0004AF1400EE66E000EE66E050EE66EE66A3E
-:101CB000010EE66EFBEC1EF0006E050EE15E0050BC
-:101CC000F3CF47F1F4CF48F141D0010149514A1116
-:101CD00002E1000E08D049C1E9FF4AC1EAFFEF5016
-:101CE000800B01E0010E000931E100C540F505015E
-:101CF000416B0501030E426F0501010E436F400E5B
-:101D0000E66E400EE66E050EE66E010EE66E010E04
-:101D1000E66EFBEC1EF0006E050EE15E0050F3CFA8
-:101D200049F1F4CF4AF1400EE66E000EE66E050E64
-:101D3000E66EE66A010EE66EFBEC1EF0006E050E26
-:101D4000E15E0050F3CF47F1F4CF48F10F0EE15CB4
-:101D500002E2E16AE552E16EE552E7CFD9FF1200F7
-:101D600001015351541104E1100E536F270E546FAB
-:101D70005307000E545B6DA207D0535154112EE14E
-:101D80008C748CB413D027D00101005102E18C94E3
-:101D900022D0000502E18C8409D0020E005D02E130
-:101DA0008C8419D0040E005D03E18C948C861200A3
-:101DB000100E005D06E10101535154110FE18C74C6
-:101DC0000AD0200E005D0AE101015351541106E1D1
-:101DD0008C748CA402D08C9612008C861200120097
-:101DE0001200120012009AEF2CF012001E0EE66E86
-:101DF000010EE66EC9EC1EF0E552E552400EE66EAD
-:101E0000000EE66E050EE66EE66A010EE66EFBEC6F
-:101E10001EF0006E050EE15E0050F3CF47F1F4CFE7
-:101E200048F112006D840101080E686F070E696F9A
-:101E30006807000E695B68516911FAE16D94120040
-:101E4000D9CFE6FFE1CFD9FFFD0EDBCF4BF0FE0E81
-:101E5000DBCF4CF0010E4B1801E14C5033E0E86849
-:101E60004B1802E1E8684C182BE0030E4B1801E117
-:101E70004C5024E0040E4B1801E14C501DE0020EC2
-:101E80004B1801E14C5016E0170E4B1801E14C5075
-:101E90000FE0160E4B1801E14C5008E0150E4B18E0
-:101EA00001E14C5001E010D0A1DF0FD09EDF0DD03A
-:101EB0009ADF0BD096DF09D092DF07D091DF05D0F3
-:101EC00091DF03D0000001D000D0010E00D0E55218
-:101ED000E7CFD9FF12004BD8E652D0B202D0010EA4
-:101EE00015D0D0B802D0020E11D0D0B002D0030E5F
-:101EF0000DD0D0B602D0040E09D0FCAE02D0050E33
-:101F000005D0FCAC02D0060E01D0070EDF6ED088E3
-:101F1000D086D084D082D080FC9EFC9CDF50E552DD
-:101F2000E552E7CFD9FF1200E65221D8020EE12692
-:101F3000F350DF6E010EF4CFDBFF1200C00EE66E31
-:101F4000E00EE66ED7EC2EF0E552E5521200DF50BF
-:101F5000F36E010EDB50F46E020EE15C1200DFCF77
-:101F6000E6FFE66A4DEC2EF0E552E5521200D9CFBD
-:081F7000E6FFE1CFD9FF1200EA
-:081F7800FBEC17F0FE0EDB503C
-:101F800006E1F80E96163C0E9416959808D0FE0EB3
-:101F9000DB0405E1070E9612C30E9412958800EF3C
-:101FA00018F0D9CFE6FFE1CFD9FFE652010EE66E79
-:101FB000E3DFE552809AFE0EDB5004E0FE0EDB50BC
-:101FC00002080FE1839C81880000839E00000000CE
-:101FD00000008450010BDF6E838E00000000DF04E0
-:101FE000F4E0FE0EDB0404E0FE0EDB5002080FE11D
-:101FF000838C81980000839E0000000000008450C4
-:10200000010BDF6E838E00000000DF04F4E0E55278
-:10201000E552E7CFD9FF1200D9CFE6FFE1CFD9FFD4
-:10202000E652FD0EDB50DF6EFE0EDBCFE6FFB9DFC2
-:10203000E552E66AA1DFE552FE0EDB5003E1839C28
-:1020400081880CD0FE0EDB0403E1838C819806D0DE
-:10205000FE0EDB50020802E1839C8198809A00000A
-:102060008098D9CFE9FFDACFEAFFEF50010B02E009
-:10207000848001D08490D9CFE9FFDACFEAFFEF5016
-:10208000020B02E0848201D08492D9CFE9FFDACF3B
-:10209000EAFFEF50040B02E0848401D08494D9CF8E
-:1020A000E9FFDACFEAFFEF50080B02E0838801D0A6
-:1020B0008398D9CFE9FFDACFEAFFEF50100B02E0A7
-:1020C000828201D08292D9CFE9FFDACFEAFFEF50C6
-:1020D000200B02E0828E01D0829ED9CFE9FFDACFB9
-:1020E000EAFFEF50400B02E0828001D08290D9CF0E
-:1020F000E9FFDACFEAFFEF50800B02E0828C01D0DB
-:10210000829C00000000808800000000E552E5523B
-:10211000E7CFD9FF1200D9CFE6FFE1CFD9FF020EFA
-:10212000E126FC0EDBCFDEFFDBCFDDFFFE0EDBCFDB
-:10213000E6FF37DFE552E66A1FDFE552FE0EDB50B1
-:1021400003E1839C81880CD0FE0EDB0403E1838CC9
-:10215000819806D0FE0EDB50020802E1839C819834
-:10216000808A00008098D9CFE9FFDACFEAFFEE52EB
-:10217000EF50010B02E0848001D08490D9CFE9FFB9
-:10218000DACFEAFFEE52EF50020B02E0848201D078
-:102190008492D9CFE9FFDACFEAFFEE52EF50040B79
-:1021A00002E0848401D08494D9CFE9FFDACFEAFF3A
-:1021B000EE52EF50080B02E0838801D08398D9CF0C
-:1021C000E9FFDACFEAFFEE52EF50100B02E0828215
-:1021D00001D08292D9CFE9FFDACFEAFFEE52EF5079
-:1021E000200B02E0828E01D0829ED9CFE9FFDACFA8
-:1021F000EAFFEE52EF50400B02E0828001D0829065
-:10220000D9CFE9FFDACFEAFFEE52EF50800B02E0C0
-:10221000828C01D0829C00000000808800000000B9
-:102220008098D9CFE9FFDACFEAFFEF50010B02E047
-:10223000848001D08490D9CFE9FFDACFEAFFEF5054
-:10224000020B02E0848201D08492D9CFE9FFDACF79
-:10225000EAFFEF50040B02E0848401D08494D9CFCC
-:10226000E9FFDACFEAFFEF50080B02E0838801D0E4
-:102270008398D9CFE9FFDACFEAFFEF50100B02E0E5
-:10228000828201D08292D9CFE9FFDACFEAFFEF5004
-:10229000200B02E0828E01D0829ED9CFE9FFDACFF7
-:1022A000EAFFEF50400B02E0828001D08290D9CF4C
-:1022B000E9FFDACFEAFFEF50800B02E0828C01D019
-:1022C000829C00000000808800000000020EE15C9B
-:1022D00002E2E16AE552E16EE552E7CFD9FF120072
-:1022E000D9CFE6FFE1CFD9FF020EE126FE0EDBCF0C
-:1022F000E6FF57DEE552010EE66E3EDEE552FE0ECB
-:10230000DB5003E1839C818805D0FE0EDB0402E1F3
-:10231000838C8198808A0000839E0000000000006A
-:102320008450010B066E8450020B01E0010EE8247C
-:10233000056E8450040B01E0010E040DF3CF04F090
-:102340008350100B01E0010E080DF3CF03F0825013
-:10235000020B01E0010E100DF3CF02F08250800B52
-:1023600001E0010E200DF3CF01F08250010B400D72
-:10237000F3CF00F08250400B01E0010E800DF350CE
-:102380000010011002100310041005100610E76E73
-:10239000010EE7CFDBFF838E00000000839E00006C
-:1023A000000000008450010B066E8450020B01E017
-:1023B000010EE824056E8450040B01E0010E040DAB
-:1023C000F3CF04F08350100B01E0010E080DF3CFA2
-:1023D00003F08250020B01E0010E100DF3CF02F06A
-:1023E0008250800B01E0010E200DF3CF01F08250EE
-:1023F000010B400DF3CF00F08250400B01E0010EC5
-:10240000800DF3500010011002100310041005108D
-:102410000610DF6E838EDECF00F0DDCF01F000C04E
-:10242000F3FF01C0F4FF00D0020EE15C02E2E16ABA
-:10243000E552E16EE552E7CFD9FF1200D9CFE6FFB2
-:10244000E1CFD9FFE652DF6AFE0EDBCFE6FFA9DD62
-:10245000E552010EE66E90DDE552FE0EDB5003E123
-:10246000839C818805D0FE0EDB0402E1838C819879
-:10247000809A0000839E0000000000008450010B41
-:10248000066E8450020B01E0010EE824056E8450B4
-:10249000040B01E0010E040DF3CF04F08350100B88
-:1024A00001E0010E080DF3CF03F08250020B01E0B2
-:1024B000010E100DF3CF02F08250800B01E0010EEF
-:1024C000200DF3CF01F08250010B400DF3CF00F04F
-:1024D0008250400B01E0010E800DF35000100110FE
-:1024E00002100310041005100610DF6E838EDF50FB
-:1024F00000D0E552E552E7CFD9FF1200FBEC17F010
-:10250000E652DF6A52EC18F0DF6EFD0EDB50DF148E
-:10251000DF6EDF5002E0010E01D0000EE55200EF49
-:1025200018F0FBEC17F01D0EA9EC17F0000ECDEC27
-:1025300019F000EF18F0FBEC17F052EC18F08408DB
-:102540000DE052EC18F0C40809E0E66ADBEC19F083
-:10255000CDEC18F026EC2FF0E552EFD71C0EA9ECCD
-:1025600017F00A0ECDEC19F0D1EC18F052EC18F07F
-:10257000800804E052EC18F0C008E7E152EC18F0D3
-:10258000C00802E1D1EC18F01E0EA9EC17F00F0EF6
-:10259000CDEC19F07FEC1AF0FA0EDBCFE6FFFB0E64
-:1025A0006BEC19F0F80EDBCFE6FFF90E6BEC19F0CF
-:1025B000F60EDBCFE6FFF70E6BEC19F0040EA9EC7C
-:1025C00017F000EF18F0FBEC17F0080EE126010EF3
-:1025D000D3EC17F0010EE7CFDBFF020E00EC1AF090
-:1025E000DF6E030ED3EC17F0030EE7CFDBFF040E14
-:1025F000D3EC17F0020EE7CFDBFF050ED3EC17F09C
-:10260000050EE7CFDBFF060ED3EC17F0040EE7CF85
-:10261000DBFF070ED3EC17F0070EE7CFDBFF080E4A
-:10262000D3EC17F030EC18F0E66AD6EC18F0090E8F
-:10263000D3EC17F0010EE7CFDBFF0A0E00EC1AF027
-:10264000DF6E0B0ED3EC17F0030EE7CFDBFF0C0EA3
-:10265000D3EC17F0020EE7CFDBFF0D0ED3EC17F033
-:10266000050EE7CFDBFF0E0ED3EC17F0040EE7CF1D
-:10267000DBFF0F0ED3EC17F0070EE7CFDBFF100EDA
-:10268000D3EC17F030EC18F0010EE66ED6EC18F033
-:10269000020EE66EE66ECDEC18F0E66AB5EC18F0C8
-:1026A00007E1020EE66E010EE66EB5EC18F002E0F0
-:1026B000000E01D0010E006E080EE15C02E2E16A3C
-:1026C000E552E16E005000EF18F0FBEC17F00C0E35
-:1026D000DAEC17F0D950F20FD1EC19F0080EEECF6A
-:1026E000DBFF090EEECFDBFF0A0EEECFDBFF0B0E9A
-:1026F000EECFDBFF1F0EA9EC17F0080EDBCF00F0CA
-:10270000090EDBCF01F00A0EDBCF02F00B0EDDEC81
-:1027100018F010E02B0ECDEC19F00A0EDBCFE6FF1F
-:102720000B0E6BEC19F0080EDBCFE6FF090EDBCFCA
-:10273000E6FF03D00B0EE66EE66A47EC1AF06BEC90
-:1027400019F059EC1AF00C0EE15C02E2E16AE55274
-:10275000E16E00EF18F0FBEC17F0080EDAEC17F062
-:102760001F0EF7DB040EDBCF00F0050EDBCF01F010
-:10277000060EDBCF02F0070EDDEC18F00FE0E4EC04
-:1027800018F0280E0012080E011200C0E6FF01C06A
-:10279000E6FF47EC1AF0DBCFE6FF09D0E4EC18F0D7
-:1027A000080E0012011200C0E6FF01C0E6FF7DDB4B
-:1027B00059EC1AF0080EE15C02E2E16AE552E16EC2
-:1027C00000EF18F0FBEC17F085EC1AF0E66AE66A09
-:1027D000E66AE66AD950FA0FD1EC19F0EECFE6FFBF
-:1027E000EECFE6FFEECFE6FFEFCFE6FFDBEC19F032
-:1027F000B2DF006E0B0EE15E005000EF18F0FBEC54
-:1028000017F0FE0EDB5004E0FE0EDB5002080DE177
-:10281000A4EC18F0F3CF61F1F4CF62F1E66A17ECA3
-:102820001AF0F3CF5FF1F4CF60F1FE0EDB0404E0A9
-:10283000FE0EDB5002080EE17CEC18F0F3CF65F1E0
-:10284000F4CF66F1010EE66E17EC1AF0F3CF63F1E8
-:10285000F4CF64F1010E7DDBD3D3CDDB1F0E79DB2A
-:102860007FEC1AF0010E75DBCBD378EC1AF0E5ECB7
-:1028700019F09CEC18F093EC19F049EC18F0C0D367
-:1028800078EC1AF093EC19F09CEC18F0E5EC19F0E8
-:1028900049EC18F0B5D378EC1AF019EC19F01BECF0
-:1028A0001AF0E66A6FEC18F019EC19F01BEC1AF04C
-:1028B0009CEF19F078EC1AF019EC19F02DDBE66AB0
-:1028C0006FEC18F019EC19F027DB9CEF19F093DB93
-:1028D000200EE1266FEC19F01FEC1AF0E9EC19F06C
-:1028E000EBDAF1DB6AEC21F028EC1AF0A7EC1AF035
-:1028F00035EC1AF097EC19F085EC18F0DDDABBEC4A
-:1029000018F06AEC21F075EC19F084DB81EC20F012
-:102910002ADB4F6A506A800E516E93EC1AF01C0E3F
-:102920004AC0DBFF1D0E4BC0DBFF1E0E4CC0DBFFA1
-:102930001F0E4DC0DBFF6FEC19F015DB37DB97EC9A
-:1029400019F065DB05EC1AF0086E080EE15E085020
-:10295000080E49C0DBFF090E4AC0DBFF0A0E4BC060
-:10296000DBFF0B0E4CC0DBFFC1DBF60EDB5007E0DC
-:10297000D950F40FD1EC19F0EE50ED1059E163ECA1
-:1029800019F0026A036AB40E046E420E056E080E58
-:10299000DBCF0EF0090EDBCF0FF00A0EDBCF10F00D
-:1029A0000B0EDBCF11F0EFEC19F00EC04AF00FC0A8
-:1029B0004BF010C04CF011C04DF06AEC21F04AC051
-:1029C0000AF04BC00BF04CC00CF04DC00DF0A5EC64
-:1029D00019F0DADB71DA02C04AF0EBEC18F080ECA7
-:1029E00020F078EC19F057DF126E060EE15E1250FF
-:1029F00046DA63EC19F08BEC19F0C6DBD7DADCECC5
-:102A000025F0E552E552E552E55249C002F04AC0D0
-:102A100003F04BC004F04CC005F049C04AF0DBDBCA
-:102A200078EC19F022DF0A6E060EE15E0A50E2D160
-:102A30001C0EDBCF04F01D0EDBCF05F01E0EDBCF2E
-:102A400006F01F0EDBCF07F00C6A0D6A0E6A400E0F
-:102A50000F6E08EC1AF031EC1AF075EC19F00CC09E
-:102A60004AF00DC04BF00EC04CF00FC04DF06AECB8
-:102A700021F01FEC1AF069EC1AF008EC1AF045DBB3
-:102A80005EDB35EC1AF0ADEC19F080EC20F0140EA2
-:102A90004AC0DBFF150E4BC0DBFF160E4CC0DBFF40
-:102AA000170E4DC0DBFF140EDBCF00F0150EDBCF91
-:102AB00001F0160EDBCF02F0170EDBCF03F008ECAF
-:102AC0001AF0A5DAADEC19F081EC20F0180E4AC02E
-:102AD000DBFF190E4BC0DBFF1A0E4CC0DBFF1B0ED9
-:102AE0004DC0DBFFE9EC19F02ADB1FEC1AF0140EE5
-:102AF000DBCF18F0150EDBCF19F0160EDBCF1AF076
-:102B0000170EDBCF1BF0A7EC1AF0B2EC19F0D4D9FA
-:102B100018C04AF019C04BF01AC04CF01BC04DF061
-:102B20006AEC21F035EC1AF0F6DB91DAC5D923DB3B
-:102B300017EC21F0DADBC7DA81EC20F028EC1AF090
-:102B400035DAA7EC1AF04AC02CF04BC02DF04CC07F
-:102B50002EF04DC02FF0F3DA4AC028F04BC029F018
-:102B60004CC02AF04DC02BF0140EDBCF38F0150E00
-:102B7000DBCF39F0160EDBCF3AF0170EDBCF3BF090
-:102B8000AEDB4AC03CF04BC03DF04CC03EF04DC007
-:102B90003FF092D938C04AF039C04BF03AC04CF0FF
-:102BA0003BC04DF06AEC21F04AC034F04BC035F028
-:102BB0004CC036F04DC037F0AEDB4AC040F04BC0E1
-:102BC00041F04CC042F04DC043F076D934C04AF0D9
-:102BD00035C04BF036C04CF037C04DF017EC21F04B
-:102BE0004AC030F04BC031F04CC032F04DC033F031
-:102BF00063D928C04AF029C04BF02AC04CF02BC042
-:102C00004DF080EC20F01ADA05EC1AF0446E080E54
-:102C1000E15E445060EC1AF0E5DA49C04AF05CDA53
-:102C20007EDA140EDBCF4AF0150EDBCF4BF0160E1A
-:102C3000DBCF4CF0170EDBCF4DF039DA28EC1AF071
-:102C40001C0EDBCF4AF01D0EDBCF4BF01E0EDBCF90
-:102C50004CF01F0EDBCF4DF070D9F1DB2DD9DAD956
-:102C600080EC20F080D9A2D94A6A4B6A4C6A400EA7
-:102C70004D6E1DDA62D97FDBC8DB106E080EE15E97
-:102C80001050100E49C0DBFF110E4AC0DBFF120EC0
-:102C90004BC0DBFF130E4CC0DBFF100EDBCF04F08C
-:102CA000110EDBCF05F0120EDBCF06F0130EDBCFDB
-:102CB00007F04F6A506A516A526AACD93DEC22F073
-:102CC000010A0DE0100EDBCF00F0110EDBCF01F09A
-:102CD000120EDBCF02F0130EDBCF03F011D0100E7B
-:102CE000DBCF08F0110EDBCF09F0120EDBCF0AF0BC
-:102CF000130EDBCF0BF076DAE6D96AEC21F033D98C
-:102D0000100E00C0DBFF110E01C0DBFF120E02C06F
-:102D1000DBFF130E03C0DBFFF60EDB50020816E1EB
-:102D2000D4D880EC20F019D981EC20F07CD9060EA3
-:102D30004BC0DBFF070E4CC0DBFF6FDB68D972DBDB
-:102D4000A1DA040E4BC0DBFF050E3DD04A6A4B6A88
-:102D50004C6A400E4D6E080EDBCF4FF0090EDBCFF4
-:102D600050F00A0EDBCF51F00B0EC5DBFCD80C0E79
-:102D7000DBCF04F00D0EDBCF05F00E0EDBCF06F03F
-:102D80000F0EDBCF07F004C04FF005C050F006C0B7
-:102D900051F007C052F080EC20F0C1D996D881ECF8
-:102DA00020F0DBD880EC20F03ED9040E4BC0DBFFD6
-:102DB000050E4CC0DBFF36DB2AD92FDB63DA060EAB
-:102DC0004BC0DBFF070E4CC0DBFF59D89FD8040E69
-:102DD000DBCF4BF0050E14DA20DB08DB9DD8ACD935
-:102DE00095D8060EDBCF4BF0070E0ADA1BDBFEDAB6
-:102DF00022DB4FD9200EE15C02E2E16AE552E16E8E
-:102E0000FFD0F9D8040EE1269FD9F3D9E66AA3D9F9
-:102E100001015F51EE5C066E6051EE58076E615124
-:102E2000EE58086E6251A8D802E2E16AE552E16EFE
-:102E3000E7D0E1D8040EE1265FD9DBD9010EE66EBA
-:102E40008AD901016351EE5C066E6451EE58076E3B
-:102E50006551EE58086E66518FD802E2E16AE5527C
-:102E6000E16ECED0040EE66EE66A7FD906E0040E6F
-:102E7000E66E010EE66E79D901E1000C010CF2DF7D
-:102E80000009FDE0120053DBEBD951DAB9D96FEF3D
-:102E900019F068DAF3DA50DB49C018F04AC019F0CB
-:102EA0004BC01AF04CC01BF0120085DA8BEC10F00E
-:102EB000E552E552E55212004AC04FF04BC050F0C7
-:102EC0004CC051F04DC052F01200FDD90C0EDBCFBA
-:102ED00006F00D0EDBCF07F00E0EDBCF08F00F0E65
-:102EE000DBCF09F07CDA06C04AF007C04BF008C01F
-:102EF0004CF009C04DF06AEC21F046DA26DAF8D938
-:102F0000CADC0A6E060EE15E0A50C7D1F70EDBCFAF
-:102F10004BF0F80E30EF19F0000E186C191E192244
-:102F20001A1E1A221B1E1B2218C0E6FF19C0E6FF3C
-:102F30001AC0E6FF1BC0E6FF12001C0EDBCF4FF0ED
-:102F40001D0EDBCF50F01E0EDBCF51F01F0E7BEFBE
-:102F50001AF0E66E30DAD6EF19F0D0D94BC0DEFFAA
-:102F60004CC0DDFF9AD14AC000F04BC001F04CC00C
-:102F700002F04DC003F01200EE58096E06C049F091
-:102F800007C04AF008C04BF04C6E67EC20F0FCD94B
-:102F900075DA17EC21F0C0DA4BC0F3FF4CC0F4FF38
-:102FA000040EE15C12002CDAE76E1200C9DA4DC0A3
-:102FB000E6FF1200E126D9CFE9FFDACFEAFFFA0EE9
-:102FC000DBCFEEFFFB0EDBCFEEFFFC0EDBCFEEFF29
-:102FD000FD0EDBCFEEFFD950F60FE3D9040EEECF96
-:102FE000DBFF050EEECFDBFF060EEECFDBFF070E9D
-:102FF000EECFDBFF1200D9CFE6FFE1CFD9FF120001
-:10300000E552E7CFD9FF12002CDABBEF19F029DA2D
-:1030100028EF1AF004C04AF005C04BF006C04CF08F
-:1030200007C04DF012006AD9020E4BC0DBFF030E41
-:103030004CC0DBFF7CDADBCF4CF012004AC024F03E
-:103040004BC025F04CC026F04DC027F012004AC0FE
-:1030500020F04BC021F04CC022F04DC023F01200F4
-:10306000060EE7CFDBFFDBCFE6FF070EDBCFE6FF89
-:10307000040EDBCFE6FF050EDBCFE6FF020EDBCF53
-:10308000E6FF030EDBCFE6FFDECFE6FFDDCFE6FF98
-:103090001200010EE66EADD9020EE66EFFEC13F0E3
-:1030A000E552120088D91EEC12F0E5521200140EFF
-:1030B000DBCF4FF0150EDBCF50F0160EDBCF51F00B
-:1030C000170E7BEF1AF008C04AF009C04BF00AC097
-:1030D0004CF00BC04DF01200E5D96AEF21F065EC21
-:1030E00013F0286E0D0EE15E28501200020EE66EFF
-:1030F00091EC12F0E55212000A0EE66E010EE66E39
-:1031000055D9010EE66E17EF1AF0ABD94AC018F088
-:103110004BC019F04CC01AF04DC01BF012000C0E41
-:103120004AC0DBFF0D0E4BC0DBFF0E0E4CC0DBFFB9
-:103130000F0E4DC0DBFF1200E66AF9EF19F04F6A7F
-:10314000506A516A93EF1AF00A0EE66EE66A2ED9BB
-:10315000E66A17EF1AF06BD9F3CFDEFFF4CFDDFF8D
-:10316000D9CFE9FFDACFEAFF12007EEC12F0E55288
-:10317000E5520009120014C04AF015C04BF016C009
-:103180004CF017C04DF012004AC006F04BC007F0DB
-:103190004CC008F04DC009F0120008D9020EE66ECE
-:1031A000120009D991EC12F0E55212009BEC12F0DA
-:1031B000006E090EE15E00501200DBCF03F00050FC
-:1031C0000110021003101200F40EDBCF00F0F50E18
-:1031D000DBCF01F0120003C04BF004C04CF005C07F
-:1031E0004DF012004F6A506A800E516EBF0E526E43
-:1031F0001200020EF3CFDBFF030EF4CFDBFF120051
-:1032000030D933D93BD96AEC21F069D9BD0E4F6E64
-:10321000370E506E860E516E410E526E8DD949C0DA
-:103220000CF04AC00DF04BC00EF04CC00FF01BEF7D
-:103230001AF029DE03DF350E4F6EFA0E506E0E0EB9
-:10324000516E3C0E526E6AEC21F001DF4F6A506AFB
-:103250005C0E516E430E526E6AEC21F049EF17F08E
-:1032600000D9EDD80BD96AEC21F0F2D8CC0E4F6E14
-:10327000BC0E506E8C0E516E3B0E526E5DD920D935
-:103280001BEF1AF0EED8DBD824D951D9BDDE14DEFD
-:1032900000C04AF021DFD7EF21F0180EDBCF00F09D
-:1032A000190EDBCF01F01A0EDBCF02F01B0EDBCFC5
-:1032B00003F04F6A506ADC0E516E420E526E00C02F
-:1032C0004AF052EF1AF0F70EDBCFE6FF1ED9FA0EE6
-:1032D000DBCFE6FF1200DBCFE6FF55EF17F0FD0E68
-:1032E000DBCF4BF0FE0E31EF1AF0F9D85CEF17F0A0
-:1032F00013D94BC0E6FF4CC0E6FF1200100EDBCF27
-:103300004FF0110EDBCF50F0120EDBCF51F0130E49
-:10331000F2D8D7EF21F04A6A4B6A800E4C6E400E0D
-:103320004D6E9DEF17F0AFDDB4DD1BEF1AF0FB0E15
-:10333000DBCF4BF0FC0E1200010EE66ED0DE020E6B
-:10334000E66EFFEC13F0E5525BD6DB0E4F6E0F0E10
-:10335000506E490E516E93EF1AF0AEDD00C04AF088
-:1033600052EF1AF04AC01CF04BC01DF04CC01EF0CA
-:103370004DC01FF012004AC00CF04BC00DF04CC005
-:103380000EF04DC00FF012004AC002F04BC003F027
-:103390004CC004F04DC005F01200E66EE66A55EF31
-:1033A00017F0E96EFF0EDA20EA6E12000CEC10F056
-:1033B000E552E5521200FE0EDBCFE6FF1200DECF33
-:1033C000E6FFDDCFE6FF55EF17F05DDD62DD8CEF48
-:1033D00017F0FD0EDBCF4BF0FE0E04EF18F04F6A36
-:1033E000506A340E516E430E526E12003AD849EFB5
-:1033F00017F065EC13F0206E0D0EE15E2050120008
-:10340000E66E6DEC2EF0E5521200D0DDC9EF29F02A
-:10341000F40EDBCF4BF0F50E1200000EDFCF4BF0B9
-:10342000010E1200020EDBCF4BF0030E120070EC07
-:1034300011F0E552120049C0E6FFA0EF1AF04AC0B1
-:1034400008F04BC009F04CC00AF04DC00BF0120060
-:103450004AC004F04BC005F04CC006F04DC007F068
-:103460001200DBCF4CF052EF20F04AC014F04BC0FA
-:1034700015F04CC016F04DC017F01200A60E4F6E9E
-:10348000280E506E940E516E3F0E526E12000DDDDE
-:10349000060EDBCFE6FF070E1EDF040EDBCFE6FFD6
-:1034A000050E120001C04BF002C04CF003C04DF0FD
-:1034B0001200020EDBCFE6FF030E0DDFDFEF19F087
-:1034C00049C000F04AC001F04BC002F04CC003F00C
-:1034D0001200F2DC9FDD17EC21F0B3EF17F04AC0C9
-:1034E00010F04BC011F04CC012F04DC013F01200A0
-:1034F00082DD76EF18F0DBCF52F06AEF21F0FC0EA0
-:10350000DBCFE6FFFD0E6BEF19F0F80EDBCFE6FF29
-:10351000F90EDBCFE6FF1200D7EC21F04BC000F034
-:103520004CC001F01200400E526E17EF21F0F90E60
-:10353000DBCF4BF0FA0E12006AEC21F006EF22F01E
-:103540004AC0E6FF4BC0E6FF4CC0E6FF1200EFDECC
-:0435500031EF1AF04D
-:0C355400A2EC1FF06A6A686AD5EC1FF058
-:103560006D8C6E6A85EC1FF06D9CDF6AB6EC1FF007
-:1035700010E2DF50040DF3CFE9FFF4CFEAFF000EB5
-:10358000E926040EEA22EE6AEE6AEE6AEE6ADF2AA5
-:10359000EDD7160E706E68A604D0030E4BEC1FF02C
-:1035A000FAD70101136B186B196B1A6B6D98080E23
-:1035B0000B6F040E0C6F016B006BE55260EF1FF098
-:1035C000A2EC1FF0010100510BE16D6A696AD5ECB4
-:1035D0001FF06DB602D06D86FCD70101010E006FA1
-:1035E000000508E16DBA06D0686A696A6980698871
-:1035F000020E006F6850040B07E06950040B04E0F2
-:10360000020E4BEC1FF089D86DB247D06850010B09
-:1036100014E06950010B11E09DDF0101040E006F01
-:103620000401200E026F040E036F080E016F006B81
-:103630008C0E0013E66A14EC20F06850100B07E0C3
-:103640006950100B04E060D8040E4BEC1FF068507A
-:10365000400B0BE06950400B08E0DCEC1FF0020E61
-:1036600053EC1FF0060E4BEC1FF06850200B04E0EB
-:103670006950200B01E035D86850020B0AE0695010
-:10368000020B07E0DCEC1FF0E668E66834EC20F0A3
-:103690006A6A040E0101005D02E2A19A1FD069A6C8
-:1036A0001CD0DF6A040EDF5C18E268A616D06CCF6F
-:1036B00020F1030E4BEC1FF0780E0101201502E102
-:1036C00038D809D0000EE66EE66A200EE66E010ECE
-:1036D000E66E010EE8DBDF2AE5D7A19AE55260EF3E
-:1036E0001FF070A00ED06EEC1FF0EF50800808E1C4
-:1036F000D5DBEF50840804E16EEC1FF08C0EEF6E0A
-:103700007090050E4BEF1FF06984040EC4DB6D82D0
-:103710008EEC1FF0040E53EF1FF08EEC1FF0030E23
-:10372000C2DB6D92699468A403D0020EB4DBFBD7B0
-:103730001200A2EC1FF0FD0E010120153DE17E0EEE
-:103740002015E8407F0B040DF3CF03F1F4CF04F113
-:10375000000E0327040E042303C105F104C106F182
-:103760000575BCDBEF503C0BE842E8420D0822E156
-:10377000B5DB0BEC20F0EECF00F0EFCF01F0280E20
-:10378000001816E1040E011813E145EC20F0DF6A81
-:10379000EDDB0EE2DF50BEEC1FF0DF50EA6A200FD7
-:1037A000E96E040EEA22E552E750EF6EDF2AF0D709
-:1037B0000AD807D01AD805D0FD0E2015040801E15B
-:1037C00022D8E5527DD36ADBEF50800B02E066DB46
-:1037D000EF6A01010F6B106B146B156B136B64D8E0
-:1037E0009DDB170E60DB89EF1DF0020E0101105DFD
-:1037F00002E116EF1EF034D80101215102E110EF71
-:1038000020F0216B12009EDB49DBEF50400B01E002
-:10381000010EDF6E01010B75080E005D09E122C487
-:103820006EFF6E50000802E2100E01D0040E006F11
-:10383000100513E149EC20F0A6D9020E01010F5D3D
-:1038400003E12CDB840E07D0DF5003E127DBC80E39
-:1038500002D024DB880EEF6E01D002D8E55230D3BF
-:103860002BDB0101106B1ADBEF6A040E0B19006EE3
-:103870000CC101F0DE6E0CC1DDFF19DBEF6A18AF81
-:103880000CD01B511C1107E005D01CC1FAFF01012F
-:103890001B51F96EFADF0101189F020EE15C02E292
-:1038A000E16AE552E16E0CD304012051600BE8425D
-:1038B000E842E842E842E842000901E012002151F2
-:1038C0000C0A45E00B0A3FE00C0A31E0010A22E055
-:1038D0000B0A1EE0020A1CE0030A18E0080A10E0C6
-:1038E000010A0CE00F0A08E0030A01E012000101DE
-:1038F000138F080E006F120009EF1DF072EF1EF01B
-:103900000101010E116F010E126F0CD04AEF1DF074
-:10391000A8EF1CF024510101116F126B020E112748
-:10392000010E12231381010E146F138F1200010177
-:10393000138F04012451EA6A020FE96E010EEA2294
-:1039400022C4EFFF1200EADA160E53EF1FF0120046
-:103950007EDB040EE1260401220510E120511F0B3D
-:1039600000090CE10101138F030E0401215D04E144
-:103970000101010E1F6F02D001011F6B04012251D2
-:1039800041E120511F0B02083DE124510F0B0009BA
-:1039900039E00101138F040124BF05D0A4DA070E1A
-:1039A000E926010E04D09FDA0B0EE926010ED2DAC9
-:1039B000030E215D03E17BDA840E23D024510F0B2B
-:1039C000016A700F006E0F0E0122020E00C0DBFFB5
-:1039D000030E01C0DBFF020EDBCFE9FF030EDBCFDE
-:1039E000EAFFEE90ED5224AF06D061DAEF6ADF74A1
-:1039F0005EDA400E06D05BDA880EEF6EDF7457DABF
-:103A0000C80EEF6E040EE15C02E2E16AE552E16E7F
-:103A100057D2800E0401205D3CE10101C00E136FFE
-:103A200004012351030A1EE0010A09E0030A2FE101
-:103A30000101020E116F5A0E126F120E22D0C3DA5C
-:103A4000AC0EF6265A0EA2DA020E0101F76A112513
-:103A5000F66E1251F7220900F5CF14F10A00F5CFE6
-:103A600015F11200030E225D0FE2ADDAAE0EF6265E
-:103A70005A0E8CDA11C1F6FF12C1F7FF0800F5509B
-:103A80000101146F156B12000101136B120001018B
-:103A9000136B120011DA0401286B296B20511F0BE4
-:103AA000020A11E0030A0CE0010A22E10101138F6E
-:103AB0000401288101011F051BE10401288318D09E
-:103AC0000101138F15D00101138F040124BF05D00C
-:103AD0000ADA070EE926010E04D005DA0B0EE926F4
-:103AE000010E38DAE4D9EF50040B02E0010E286F22
-:103AF000010113AF07D0280E116F040E126F13814E
-:103B0000020E146F020EE15C02E2E16AE552E16E20
-:103B1000D7D16D98010113BF08D018AF02D061DA78
-:103B20002AD07EDABBD9840E27D018BF2BD004014F
-:103B300020AF24D0010114510401265D010115516B
-:103B40000401275904E226C414F127C415F11BD837
-:103B50000101010E106FA1DA800EEF6E216BBED94C
-:103B6000EE52080EEF6E91DAB9D9840EEF6E010EA7
-:103B7000216F8FDA93D9C80EEF6E1200010131DA8E
-:103B8000C80EEF6E120098D90101080E145D000EE8
-:103B900015590DE214C1DEFF15C1DDFF0F5102E121
-:103BA000010E03D00F0506E1020E0F6F03D0080EC1
-:103BB000DE6EDD6A73D9EF9271D9EF906FD9010E85
-:103BC000DB50EF126BD9EE52DFCFEFFF000EDB5070
-:103BD000145F010EDB50155B280E1D6F040E1E6F67
-:103BE00013B10FD0F7D91BE011C1F6FF12C1F7FFD7
-:103BF000112B000E12230800F55096D9F3E2DB06D4
-:103C0000F1D7E8D90CE011C1E9FF12C1EAFF112B8D
-:103C1000000E1223EF5088D9F4E2DB06F2D7020E31
-:103C2000E15C02E2E16AE552E16E4AD145D956D93A
-:103C3000EE52EFCFDFFFDFCF00F000500101195D42
-:103C4000000E1A5903E219C1DFFF09D0DF50006EE0
-:103C5000016AE850195D196F01501A591A6F010E67
-:103C6000DB6ADF50F36E010EDBCFF4FFF350F45C40
-:103C700010E2010EDB5082D916C1E9FF17C1EAFF3D
-:103C8000162B000E1723E552E750EF6E010EDB2ACC
-:103C9000E8D7000ED8801955000E1A550DE2F4D859
-:103CA00054D91CD9EF50400B03E1EAD9C80E02D019
-:103CB000E7D9880EEF6E0FD0F0D9840EEF6E1B514E
-:103CC0001C1107E005D01CC1FAFF01011B51F96E60
-:103CD000FADF0101189F020EE15C02E2E16AE5529F
-:103CE000E16EEED00101138F10D9010EE66EE66A87
-:103CF000E66A020EE66E010EAFD922C401F104019C
-:103D0000225104E10101100E006F12000101200E8A
-:103D1000006F04D9150E53EF1FF0CED8000EDE6EE3
-:103D2000040EDD6EE8D8040DF350006E016A020E39
-:103D30000F0B05E0D89001320032E806FBE1D89085
-:103D400000360136D89000360136D9CFE9FFDACFF8
-:103D5000EAFF0050EE260150ED22A9D8EF9EFD0E9D
-:103D6000DB5002E16AD901D06DD9EA22DECFEEFF45
-:103D7000DDCFEDFF9CD8EF9C9AD8040EE926000E0B
-:103D8000EA22EF8C020EE15C02E2E16AE552E16EAA
-:103D900097D092D8FE0EDB50016A700F006E0F0EA6
-:103DA000DFD885D8FD0EDBCFEFFFDBA402D0E66ABB
-:103DB000F5D8FD0EDBA203D0010EE66EEFD8020EA1
-:103DC000E15C02E2E16AE552E16E7AD075D8FE0E5E
-:103DD000DB5005E125D962D8840EEF6E05D08BD873
-:103DE0000CD989D8010F09D9020EE15C02E2E16A1F
-:103DF000E552E16E65D060D8FD0EDB5002E022D9BD
-:103E000001D01BD9A7D853D806D9FB0EDBCFEEFFC4
-:103E1000FC0EDBCFEDFF4BD8EE52FA0EDBCFEFFFFF
-:103E2000400E45D8E850EF16880E41D8E850EF1202
-:103E3000FD0EDB5002E006D901D0FFD8EA22EF7474
-:103E4000DECF00F0DDCF01F000C0F3FF01C0F4FFD2
-:103E5000020EE15C02E2E16AE552E16E31D0F7D890
-:103E6000010EF36EFC0EDB5004E0D890F336E8064A
-:103E7000FCE1F31C006EFD0EDBCFE9FFFE0EDBCF95
-:103E8000EAFF0050EF161CD0FBD8EE52080EEF6E82
-:103E9000F7D80BEF20F0E66E14EF20F00BC1E9FF2E
-:103EA0000CC1EAFF1200E66EE66A34EF20F0DECFC6
-:103EB000E9FFDDCFEAFF1200CAD8020EE1261200A8
-:103EC000E552E7CFD9FF1200D6D840EF20F0FE0E22
-:103ED000EA6ADB34FE0BEA36E96E120003C1E9FF41
-:103EE00004C1EAFF120024510F0BE96EEA6AD89070
-:103EF000E936EA361200FD0EDB50E824026EFE0EB3
-:103F0000DB50040DF35002241200000EE66EE66A48
-:103F1000E66A710EE66E0F0E2CEF20F0000EE66ED4
-:103F2000E66AE66EE66A1200E66E1DC1E9FF1EC192
-:103F3000EAFF1D2B000E1E23E552E750EF6EDF0651
-:103F4000010E120084D8E6521200280EEE6E040E06
-:103F5000ED6E1200EA22EECFDEFFEDCFDDFF1200A4
-:103F6000012200C0DEFF01C0DDFF1200DF50006E45
-:103F7000016A080E005C000E01581200EA6A280F60
-:103F8000E96E040EEA22EF50E66E1200F7220900F5
-:103F9000F5CF11F10A00F5CF12F11200FE0EDBCFC2
-:103FA000E6FFBBDEE552E5521200160E6F6E9F0E65
-:103FB0006B6E7B0E696E1200010EE66EE66A000EF5
-:103FC000E66EE66A12002251F66EF76AD890F6366F
-:103FD000F7361200D9CFE9FFDACFEAFFEE50ED1045
-:103FE0001200020E106F5ADFEE52EF6A57DFC80E52
-:103FF000EF6E4ADFAADF40EF20F0040DF3CF00F0B0
-:10400000F4CF01F0000E0026040EAADF840E4FDF6D
-:10401000E850EF121200020EE926000EEA2212000A
-:104020003CD88C0EEF6E1200680EE66E0F0EE66E38
-:1040300016DFE552E552E552120049DF070EE92688
-:10404000010E120044DF0B0EE926010E1200D9CF3B
-:10405000E6FFE1CFD9FF1200E66E17EC2EF0006EFE
-:10406000050EE15E0050120020EC0FF0006E060E0F
-:10407000E15E00501200200EEE6E040EED6E120096
-:1040800005C1E9FF06C1EAFF120028DFC4DF3BEFEC
-:1040900020F004DFC0DFA5EF1FF0F6DE64EF1FF0B5
-:1040A000549E08D0549E4CAE05D04B6C4C1EE86A12
-:1040B0004C22548E4CC046F04BC045F0586A576AAB
-:1040C0008E0E476E486AB7EF22F0549E0CD0549E75
-:1040D0004CAE09D0496C4A1E4B1E4C1EE86A4A225F
-:1040E0004B224C22548E4CC046F04BC045F04AC087
-:1040F00058F049C057F09E0E476E486AB7EF22F05D
-:10410000527E546AF3EC22F00BEC23F054B69BEF92
-:1041100022F054A20AD054AA03D054BE9BEF22F03E
-:1041200054A4A7EF22F0A4EF22F054AA05D054AC77
-:10413000A7EF22F0A4EF22F054A00AD054A808D090
-:1041400054BE04D054A402D0B0EF22F0B4EF22F059
-:10415000576A486A52504D5C566E10E34AC058F098
-:104160004BC045F04CC046F04DC055F04FC04AF032
-:1041700050C04BF051C04CF0543A09D04FC058F0E9
-:1041800050C045F051C046F052C055F0566C549E98
-:1041900054BC548E55C047F054B0E3EF22F01A0ED1
-:1041A0005660E3EF22F0476A4D6A54A408D04A6C87
-:1041B0004B1E4C1E4D1EE86A4B224C224D2254AC25
-:1041C00008D0586C451E461E471EE86A4522462206
-:1041D0004722496A565207E04D344C324B324A323C
-:1041E0004932562EF9D74A5058264B5045224C504A
-:1041F00046224D50472249C057F0549E47AE0BD03F
-:10420000576C581E451E461E471EE86A5822452216
-:1042100046224722548E47A006D0D88046324532E7
-:1042200058325732552A55C047F0B7EF22F0546A3A
-:10423000F3EC22F00BEC23F054B69BEF22F054A2E7
-:1042400005D054BA9BEF22F0A2EF22F054BAAEEFA1
-:1042500022F054A005D054B89BEF22F0AEEF22F02C
-:1042600054B8A2EF22F0486A7F0E4D24476EE86AE8
-:1042700048225250475EE86A485A1A0E556E4D6AF7
-:10428000576A586A456A466A4F504A5E50504B5AC0
-:1042900051504C5A000E4D5A09E74F504A26505083
-:1042A0004B2251504C22000E4D2201D0578AD890FB
-:1042B0004A364B364C364D36D890573658364536FA
-:1042C0004636552EE1D74C504B104A10D8A4578A89
-:1042D000B7...
[truncated message content] |
|
From: Olivier B. <Ba...@us...> - 2010-02-04 18:17:13
|
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 68d618fe759888d1531780cc195c6f35fc75bbff (commit)
from 579992aba17245d88ae186930491cd1e9cc752b8 (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 68d618fe759888d1531780cc195c6f35fc75bbff
Author: Olivier BICHLER <oli...@gm...>
Date: Thu Feb 4 19:16:30 2010 +0100
Ajout tourelle capteur avec décalage moteur ouverture porte + organisation des contraintes
-----------------------------------------------------------------------
Changes:
diff --git a/meca/Antiblocant balles .CATPart b/meca/Antiblocant balles .CATPart
index 3c1eb6c..4126f1b 100644
Binary files a/meca/Antiblocant balles .CATPart and b/meca/Antiblocant balles .CATPart differ
diff --git a/meca/Bac cote 1.CATPart b/meca/Bac cote 1.CATPart
index 4242128..9bba13f 100644
Binary files a/meca/Bac cote 1.CATPart and b/meca/Bac cote 1.CATPart differ
diff --git a/meca/Base assemblee.CATProduct b/meca/Base assemblee.CATProduct
index 5a4edb1..c0046b7 100644
Binary files a/meca/Base assemblee.CATProduct and b/meca/Base assemblee.CATProduct differ
diff --git a/meca/Base bac.CATPart b/meca/Base bac.CATPart
index 65c8450..5726740 100644
Binary files a/meca/Base bac.CATPart and b/meca/Base bac.CATPart differ
diff --git a/meca/Base.CATPart b/meca/Base.CATPart
index 8fd0706..278f566 100644
Binary files a/meca/Base.CATPart and b/meca/Base.CATPart differ
diff --git a/meca/Bras tige 1.CATPart b/meca/Bras tige 1.CATPart
index a972c68..586b2a0 100644
Binary files a/meca/Bras tige 1.CATPart and b/meca/Bras tige 1.CATPart differ
diff --git a/meca/Bras.CATProduct b/meca/Bras.CATProduct
index 8f27b68..fee3600 100644
Binary files a/meca/Bras.CATProduct and b/meca/Bras.CATProduct differ
diff --git a/meca/Courroie.CATPart b/meca/Courroie.CATPart
index 395aed5..77d81e3 100644
Binary files a/meca/Courroie.CATPart and b/meca/Courroie.CATPart differ
diff --git a/meca/Decalage pince guidage.CATPart b/meca/Decalage pince guidage.CATPart
index ba6ec52..f07658d 100644
Binary files a/meca/Decalage pince guidage.CATPart and b/meca/Decalage pince guidage.CATPart differ
diff --git a/meca/Niveau 1 bac.CATPart b/meca/Niveau 1 bac.CATPart
index 24edab8..e56b2bf 100644
Binary files a/meca/Niveau 1 bac.CATPart and b/meca/Niveau 1 bac.CATPart differ
diff --git a/meca/Niveau 1.CATPart b/meca/Niveau 1.CATPart
index b05ed76..b58e120 100644
Binary files a/meca/Niveau 1.CATPart and b/meca/Niveau 1.CATPart differ
diff --git a/meca/Niveau 2.CATPart b/meca/Niveau 2.CATPart
index 4d4f932..5136df6 100644
Binary files a/meca/Niveau 2.CATPart and b/meca/Niveau 2.CATPart differ
diff --git a/meca/Support BH0102-40-606.CATPart b/meca/Support BH0102-40-606.CATPart
index c4e9431..91bae83 100644
Binary files a/meca/Support BH0102-40-606.CATPart and b/meca/Support BH0102-40-606.CATPart differ
diff --git a/meca/Support moteur C03092.CATPart b/meca/Support moteur C03092.CATPart
index dbdc7a3..9f971e7 100644
Binary files a/meca/Support moteur C03092.CATPart and b/meca/Support moteur C03092.CATPart differ
diff --git a/meca/Support reducteur.CATPart b/meca/Support reducteur.CATPart
index acca045..1f629c1 100644
Binary files a/meca/Support reducteur.CATPart and b/meca/Support reducteur.CATPart differ
diff --git a/meca/Support tourelle.CATPart b/meca/Support tourelle.CATPart
new file mode 100644
index 0000000..0ec4e8a
Binary files /dev/null and b/meca/Support tourelle.CATPart differ
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-03 22:18:11
|
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 579992aba17245d88ae186930491cd1e9cc752b8 (commit)
from 7c9492bfc78f863b0653b59238963a4f61fa9d20 (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 579992aba17245d88ae186930491cd1e9cc752b8
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 23:17:32 2010 +0100
inverse direction for the left motor
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/tools/joy_control.ml b/PC_Mainboard/clients/tools/joy_control.ml
index f6ce1c1..1fb1edb 100644
--- a/PC_Mainboard/clients/tools/joy_control.ml
+++ b/PC_Mainboard/clients/tools/joy_control.ml
@@ -125,7 +125,7 @@ let parent_loop krobot pipe =
return ()
| JoyRAxis n ->
if not !rstop then
- lwt () = Krobot.set_speed krobot ~motor:`Right ~speed:(n * axis_coef) ~acc:acceleration in
+ lwt () = Krobot.set_speed krobot ~motor:`Right ~speed:((-n) * axis_coef) ~acc:acceleration in
loop ()
else
loop ()
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-03 21:58:13
|
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 7c9492bfc78f863b0653b59238963a4f61fa9d20 (commit)
from 6c6fc54b41b825a7fd7a7c4e3b66b5991e92b084 (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 7c9492bfc78f863b0653b59238963a4f61fa9d20
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 22:57:20 2010 +0100
add card tools (send_firmware, dump_memory)
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/card-tools/Makefile b/PC_Mainboard/card-tools/Makefile
new file mode 100644
index 0000000..8055020
--- /dev/null
+++ b/PC_Mainboard/card-tools/Makefile
@@ -0,0 +1,36 @@
+# Makefile
+# --------
+# Copyright : (c) 2009, Jeremie Dimino <je...@di...>
+# Licence : BSD3
+#
+# This file is a part of [kro]bot.
+
+PREFIX=/usr/local
+
+OC = ocamlbuild
+OF = ocamlfind
+
+ifeq ($(TERM),dumb)
+OC += -classic-display
+endif
+
+.PHONY: all
+all:
+ $(OC) all
+
+.PHONY: clean
+clean:
+ $(OC) -clean
+
+.PHONY: install
+install:
+ install -m0755 _build/src/send_firmare.best $(PREFIX)/bin/send-firmware
+ install -m0755 _build/src/dump_memory.best $(PREFIX)/bin/dump-memory
+
+.PHONY: uninstall
+uninstall:
+ rm -f $(PREFIX)/bin/send-firmware
+ rm -f $(PREFIX)/bin/dump-memory
+
+.PHONY: reinstall
+reinstall: uninstall install
diff --git a/PC_Mainboard/card-tools/PcInterface.h b/PC_Mainboard/card-tools/PcInterface.h
new file mode 100644
index 0000000..6928d8e
--- /dev/null
+++ b/PC_Mainboard/card-tools/PcInterface.h
@@ -0,0 +1,208 @@
+/**
+ * @file PcInterface.h
+ * Fichier commun avec le programme hsur la carte m (USB PC).
+ * Ce fichier dnit de nombreuses constantes utilis pour le protocole
+ * de communication carte <-> PC.
+*/
+
+#ifndef PC_INTERFACE_H
+#define PC_INTERFACE_H
+
+#define USB_VID 0x04D8 ///< Vendor ID commun aux diffntes cartes USB
+#define USB_PID_USB_DEV_BOARD 0x0001 ///< Product ID de la Carte d'essais
+#define USB_PID_PROXIMITY_SENSOR 0x0002 ///< Product ID de la Carte capteurs
+#define USB_PID_MOTOR_CONTROLLER 0x0003 ///< Product ID de la Carte d'asservissement
+#define USB_PID_ROBOT_INTERFACE 0x0004 ///< Product ID de la Carte d'actionneur
+#define USB_PID_BATTERY_MONITORING 0x0005 ///< Product ID de la carte Battery Monitoring
+#define USB_PID_BOOTLOADER 0x000b ///< Product ID d'une carte en mode bootloader
+
+// Protocole USB
+#define UP_HSEQ 0 ///< Host sequence number
+#define UP_DSEQ 1 ///< Device sequence number
+#define UP_CMD 2
+#define UP_ERR 3
+#define UP_RES0 4
+#define UP_RES1 5
+#define UP_RES2 6
+#define UP_RES3 7
+#define UP_RES4 60
+#define UP_RES5 61
+#define UP_RES6 62
+#define UP_RES7 63
+#define UP_DATA 8
+
+// Commande (premier bit)
+#define CMD_RESET 0 ///< Reset du PIC
+#define CMD_BOOTLOADER 1 ///< Reset du PIC en mode bootloader
+#define CMD_GET 2 ///< Obtenir une information
+#define CMD_RESPOND 3 ///< Rnse ne commande
+#define CMD_ERR 4 ///< Envoyer une erreur
+#define CMD_SEND 5 ///< Envoyer du texte
+#define CMD_SET 6 ///< Dnir l't d'un parame
+#define CMD_TEST 7 ///< Commande grique pour dencher une action de test
+#define CMD_CALIBRATE 8 ///< Lance la calibration d'un tme [Carte capteurs]
+#define CMD_AX12 9
+#define CMD_TRAJ 10 ///< Transmet une trajetoire au Krobot
+#define CMD_MOTOR 11 ///< Gestion des moteurs
+#define CMD_MOTOR_TOR 12
+
+// CMD_GET arguments
+#define GET_RESET_SOURCE 0 ///< Demande au PIC la source du Reset
+#define GET_BOARD_INFO 1 ///< Demande au PIC le nom de la carte et l'auteur
+#define GET_FIRMWARE_BUILD 2 ///< Demande au PIC la date et l'heure de compilation du firmware
+#define GET_PORTS_CONFIG 3 ///< Demande la config TRIS des ports du PIC
+#define GET_PORTS_STATE 4 ///< Demande l't des ports du PIC
+#define GET_RANGEFINDER_STATE 5 ///< Demande au PIC les mesures des tmes [Carte capteurs]
+#define GET_ISENS 6 ///< Demande au PIC les valeurs des courants moteurs mesur [Carte d'asservissement]
+#define GET_CURRENT_POS 7 ///< Demande au PIC les positions actuelles des moteurs [Carte d'asservissement]
+#define GET_RANGEFINDER_CALIBRATION 8 ///< Demande au PIC les valeurs de calibration des tmes [Carte capteurs]
+#define GET_TOR_STATE 9 ///< Demande au PIC l't des capteurs de contact [Carte capteurs]
+#define GET_CMP03_DATA 10 ///< Rp les infos du compas ctronique CMP03
+#define GET_CELL_VOLTAGE 11 ///< Tensions des cellules [Battery Monitoring]
+#define GET_CURRENT 12 ///< Valeur instantandu courant dtar la batterie [Battery Monitoring]
+#define GET_POWER_STATE 13 ///< Etat de l'alimentation de puissance (On/Off) [Battery Monitoring]
+#define GET_BATTERY_STATE 14 ///< Etat des batteries (Pleine charge/Charge moyenne/Charge faible) [Battery Monitoring]
+
+// CMD_ERR arguments
+#define ERR_UNKNOWN_CMD 1 ///< Commande inconnue
+#define ERR_UNKNOWN_GET 2 ///< Demande inconnue
+#define ERR_UNKNOWN_SET 3 ///< Demande inconnue
+#define ERR_INVALID_RESPONSE 4 ///< Rnse invalide
+#define ERR_AX12_WRONG_PACKET 5
+#define ERR_AX12_ERROR 6
+#define ERR_AX12_CHKSUM 7
+#define ERR_CMP03_NOT_RESPONDING 8
+#define ERR_ADJD_S371_NOT_RESPONDING 9
+
+// CMD_SET arguments
+#define SET_PORTS_CONFIG_INPUTS 0x00 ///< Dnir les entr du PIC
+#define SET_PORTS_CONFIG_OUTPUTS 0x01 ///< Dnir les sorties du PIC
+#define SET_PORTS_STATE_LOW 0x02 ///< Dnir les sorties 't bas du PIC
+#define SET_PORTS_STATE_HIGH 0x03 ///< Dnir les sorties 't haut du PIC
+#define SET_SERVO_CONFIG 0x04 ///< Dnir la config des servomoteurs
+#define SET_SERVO_STATE 0x05 ///< Dnir l't des servomoteurs
+
+// CMD_CALIBRATE arguments
+#define CAL_START 0x00
+#define CAL_CONTINUE 0x01
+#define CAL_STOP 0x02
+#define CAL_ERROR 0x03
+#define CAL_DONE 0x04
+#define CAL_PLACE_INF 0x05
+#define CAL_PLACE_30 0x06
+#define CAL_PLACE_100 0x07
+
+// GET_RESET_SOURCE reponse
+#define RESET_SOURCE_POR 0x01 ///< Power-on Reset
+#define RESET_SOURCE_RI 0x02 ///< RESET Instruction
+#define RESET_SOURCE_BOR 0x03 ///< Brown-out Reset
+#define RESET_SOURCE_WDT 0x04 ///< Watchdog Time-out Reset
+#define RESET_SOURCE_STKFUL 0x05 ///< Stack Full Reset
+#define RESET_SOURCE_STKUNF 0x06 ///< Stack Underflow Reset
+#define RESET_SOURCE_MCLR 0x07 ///< Master Clear Reset
+
+// CMD_AX12
+#define AX12_PING 0x01
+#define AX12_READ 0x02
+#define AX12_WRITE 0x03
+#define AX12_GOTO 0x04
+#define AX12_GET_POS 0x05
+#define AX12_GET_SPEED 0x06
+#define AX12_GET_LOAD 0x07
+#define AX12_GET_STATS 0x08
+#define AX12_WRITE_REG 0x09
+#define AX12_ACTION 0x10
+
+// CMD_TRAJ
+#define TRAJ_INIT 0x00
+#define TRAJ_FORWARD 0x01
+#define TRAJ_BACKWARD 0x02
+#define TRAJ_TR 0x03
+#define TRAJ_TL 0x04
+#define TRAJ_GOTO 0x05
+#define TRAJ_FINISHED 0x06
+#define TRAJ_STOP 0x07
+#define TRAJ_NEW_POSITION 0x08
+#define TRAJ_NEW_VELOCITY 0x09
+#define TRAJ_CHANGE_VELOCITY 0x0A
+#define TRAJ_CONFIG 0x0B
+#define TRAJ_CONFIG_DEFAULT 0x0C
+#define TRAJ_START 0x0D
+#define TRAJ_GET_REL_POS 0x0E
+#define TRAJ_READ_CONFIG 0x0F
+
+#define TRAJ_NOT_COMPLETED 0x00
+#define TRAJ_COMPLETED 0x01
+
+#define TRAJ_STOP_MOTOR_OFF 256
+#define TRAJ_STOP_ABRUPT 512
+#define TRAJ_STOP_SMOOTH 1024
+
+// CMD_MOTOR
+#define MOTOR_ENABLE 1
+#define MOTOR_DISABLE 2
+#define MOTOR_MOVE 3
+
+#define MOTOR_RIGHT 0 ///< Sction du moteur de droite (moteur 1)
+#define MOTOR_LEFT 1 ///< Sction du moteur de gauche (moteur 2)
+#define MOTOR_BOTH 2 ///< Sction des 2 moteurs simultannt
+
+// XXX omplr
+#define READ_VERSION 0x00
+#define READ_FLASH 0x01
+#define WRITE_FLASH 0x02
+#define ERASE_FLASH 0x03
+#define READ_EEDATA 0x04
+#define WRITE_EEDATA 0x05
+#define READ_CONFIG 0x06
+#define WRITE_CONFIG 0x07
+#define UPDATE_LED 0x32
+#define RESET 0xFF
+
+#define FLASH_BOOT_START 0x00
+#define FLASH_BOOT_END 0x7FF
+#define FLASH_VECTOR_START 0x800
+#define FLASH_VECTOR_END 0x829
+#define FLASH_PAGE_START 0x82A
+#define FLASH_PAGE_END 0x7FFF
+
+#define PORTA_RA0 1
+#define PORTA_RA1 2
+#define PORTA_RA2 4
+#define PORTA_RA3 8
+#define PORTA_RA4 16
+#define PORTA_RA5 32
+#define PORTA_RA6 64
+
+#define PORTB_RB0 1
+#define PORTB_RB1 2
+#define PORTB_RB2 4
+#define PORTB_RB3 8
+#define PORTB_RB4 16
+#define PORTB_RB5 32
+#define PORTB_RB6 64
+#define PORTB_RB7 128
+
+#define PORTC_RC0 1
+#define PORTC_RC1 2
+#define PORTC_RC2 4
+#define PORTC_RC4 16
+#define PORTC_RC5 32
+#define PORTC_RC6 64
+#define PORTC_RC7 128
+
+#define PORTD_RD0 1
+#define PORTD_RD1 2
+#define PORTD_RD2 4
+#define PORTD_RD3 8
+#define PORTD_RD4 16
+#define PORTD_RD5 32
+#define PORTD_RD6 64
+#define PORTD_RD7 128
+
+#define PORTE_RE0 1
+#define PORTE_RE1 2
+#define PORTE_RE2 4
+#define PORTE_RE3 8
+
+#endif // PC_INTERFACE_H
diff --git a/PC_Mainboard/card-tools/_tags b/PC_Mainboard/card-tools/_tags
new file mode 100644
index 0000000..e273d14
--- /dev/null
+++ b/PC_Mainboard/card-tools/_tags
@@ -0,0 +1,4 @@
+# -*- conf -*-
+
+<src/*.ml>: syntax_camlp4o, pkg_lwt.syntax
+<src/*>: thread, pkg_usb
diff --git a/PC_Mainboard/card-tools/myocamlbuild.ml b/PC_Mainboard/card-tools/myocamlbuild.ml
new file mode 100644
index 0000000..0607ed1
--- /dev/null
+++ b/PC_Mainboard/card-tools/myocamlbuild.ml
@@ -0,0 +1,146 @@
+(*
+ * myocamlbuild.ml
+ * ---------------
+ * Copyright : (c) 2009, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+open Printf
+open Ocamlbuild_plugin
+
+(* +-----------------------------------------------------------------+
+ | Configuration |
+ +-----------------------------------------------------------------+ *)
+
+let try_exec command =
+ try
+ let () = Command.execute ~quiet:true (Cmd(S[Sh command; Sh"> /dev/null"; Sh"2> /dev/null"])) in
+ true
+ with _ ->
+ false
+
+let () =
+ if not (try_exec "ocamlfind printconf") then begin
+ prerr_endline "ocamlfind is not available, please install it";
+ exit 1
+ end
+
+let have_native = try_exec "ocamlfind ocamlopt -version"
+
+let () =
+ let yes_no = function true -> "yes" | false -> "no" in
+ printf "\
++--[ compilation options ]----------+
+| native compilation: %3s |
++-----------------------------------+
+%!" (yes_no have_native)
+
+(* +-----------------------------------------------------------------+
+ | Ocamlfind |
+ +-----------------------------------------------------------------+ *)
+
+(* Put here packages you may use in this project: *)
+let packages = [
+ "type-conv";
+ "type-conv.syntax";
+ "camlp4";
+ "camlp4.extend";
+ "camlp4.lib";
+ "camlp4.macro";
+ "camlp4.quotations.o";
+ "camlp4.quotations.r";
+ "lwt";
+ "lwt.unix";
+ "lwt.syntax";
+ "lwt.syntax.log";
+ "str";
+ "xmlm";
+ "react";
+ "usb";
+ "obus";
+ "obus.syntax";
+ "bitstring";
+ "bitstring.syntax";
+]
+
+(* List of available syntaxes :*)
+let syntaxes = [
+ "camlp4o";
+ "camlp4r";
+]
+
+(* +-----------------------------------------------------------------+
+ | Utils |
+ +-----------------------------------------------------------------+ *)
+
+let flag_all_stages_except_link tag f =
+ flag ["ocaml"; "compile"; tag] f;
+ flag ["ocaml"; "ocamldep"; tag] f;
+ flag ["ocaml"; "doc"; tag] f
+
+let flag_all_stages tag f =
+ flag_all_stages_except_link tag f;
+ flag ["ocaml"; "link"; tag] f
+
+let _ =
+ dispatch begin function
+ | Before_options ->
+
+ (* override default commands by ocamlfind ones *)
+ let ocamlfind x = S[A"ocamlfind"; A x] in
+ Options.ocamlc := ocamlfind "ocamlc";
+ Options.ocamlopt := ocamlfind "ocamlopt";
+ Options.ocamldep := ocamlfind "ocamldep";
+ (* FIXME: sometimes ocamldoc say that elements are not found
+ even if they are present: *)
+ Options.ocamldoc := S[A"ocamlfind"; A"ocamldoc"; A"-hide-warnings"]
+
+ | After_rules ->
+
+ (* Génération du fichier contenant les détails du protocol à
+ partir du fichier .h *)
+ rule "protocol du krobot" ~dep:"PcInterface.h" ~prod:"protocol.ml"
+ (fun _ _ ->
+ Cmd(S[Sh"awk '$1 == \"#define\" && $3 != \"\" { print \"let \" tolower($2) \" = \" $3 }' PcInterface.h > protocol.ml"]));
+
+ (* +---------------------------------------------------------+
+ | Virtual targets |
+ +---------------------------------------------------------+ *)
+
+ if have_native then
+ rule "best" ~dep:"%.native" ~prod:"%.best"
+ (fun env _ -> cp (env "%.native") (env "%.best"))
+ else
+ rule "best" ~dep:"%.byte" ~prod:"%.best"
+ (fun env _ -> cp (env "%.byte") (env "%.best"));
+
+ let virtual_rule name deps =
+ rule name ~stamp:name ~deps (fun _ _ -> Nop)
+ in
+
+ virtual_rule "all" ["src/send_firmware.best"; "src/dump_memory.best"];
+
+ (* +---------------------------------------------------------+
+ | Ocamlfind stuff
|
+ +---------------------------------------------------------+ *)
+
+ (* When one link an OCaml binary, one should use -linkpkg *)
+ flag ["ocaml"; "link"; "program"] & A"-linkpkg";
+
+ (* For each ocamlfind package one inject the -package option
+ when compiling, computing dependencies, generating
+ documentation and linking. *)
+ List.iter
+ (fun package -> flag_all_stages ("pkg_" ^ package) (S[A"-package"; A package]))
+ packages;
+
+ (* Like -package but for extensions syntax. Morover -syntax is
+ useless when linking. *)
+ List.iter
+ (fun syntax -> flag_all_stages_except_link ("syntax_" ^ syntax) (S[A"-syntax"; A syntax]))
+ syntaxes;
+
+ | _ -> ()
+ end
diff --git a/PC_Mainboard/card-tools/src/boardname.mli b/PC_Mainboard/card-tools/src/boardname.mli
new file mode 100644
index 0000000..23b0032
--- /dev/null
+++ b/PC_Mainboard/card-tools/src/boardname.mli
@@ -0,0 +1,12 @@
+(*
+ * boardname.mli
+ * -------------
+ * Copyright : (c) 2009, Stéphane Glondu <st...@gl...>
+ * Licence : BSD3
+ *
+ * This file is a part of Krobot.
+ *)
+
+val get_board_name : string -> string option
+ (** [get_board_name dump] recherche dans le [dump] mémoire (peut
+ être également un fichier .hex chargé) le nom de la carte. *)
diff --git a/PC_Mainboard/card-tools/src/boardname.mll b/PC_Mainboard/card-tools/src/boardname.mll
new file mode 100644
index 0000000..30f99cf
--- /dev/null
+++ b/PC_Mainboard/card-tools/src/boardname.mll
@@ -0,0 +1,22 @@
+(*
+ * boardname.mll
+ * -------------
+ * Copyright : (c) 2009, Stéphane Glondu <st...@gl...>
+ * Licence : BSD3
+ *
+ * This file is a part of Krobot.
+ *)
+
+
+let boardname_regex = ("Carte " | "Robot Interface") [^'\n']+
+
+rule boardname = parse
+ | (boardname_regex as name) '\n' { Some name }
+ | _ { boardname lexbuf }
+ | eof { None }
+
+{
+ let get_board_name str =
+ let lexbuf = Lexing.from_string str in
+ boardname lexbuf
+}
diff --git a/PC_Mainboard/card-tools/src/bootloader.ml b/PC_Mainboard/card-tools/src/bootloader.ml
new file mode 100644
index 0000000..28044cc
--- /dev/null
+++ b/PC_Mainboard/card-tools/src/bootloader.ml
@@ -0,0 +1,184 @@
+(*
+ * bootloader.ml
+ * -------------
+ * Copyright : (c) 2009, Stéphane Glondu <st...@gl...>
+ * Licence : BSD3
+ *
+ * This file is a part of Krobot.
+ *)
+
+open Lwt
+open Lwt_io
+
+(* Code très inspiré de kard.ml, mais mis à part car le mode de
+ communication avec la carte est différent (bulk au lieu
+ d'interrupt). *)
+
+type t = {
+ mutable is_open : bool;
+ (* La carte est-elle ouverte ? *)
+
+ handle : USB.handle;
+ (* Handle pour le périphérique usb *)
+
+ kernel_active : bool;
+ (* Est-ce qu'un driver noyau était attaché à la carte avant qu'on
+ l'utilise ? *)
+}
+
+type error =
+ | IncompleteWrite of int * int
+ | IncompleteRead of int * int
+ | UnexpectedReply of string * string
+ | WriteError of string * string
+
+let string_of_error = function
+ | IncompleteWrite (a, b) -> Printf.sprintf "%d byte(s) written instead of %d" a b
+ | IncompleteRead (a, b) -> Printf.sprintf "%d byte(s) read instead of %d" a b
+ | UnexpectedReply (a, b) -> Printf.sprintf "received unexpected reply %S instead of %S" a b
+ | WriteError (a, b) -> Printf.sprintf "written: %S, read back: %S" a b
+
+exception Error of error
+
+let failwith e = fail (Error e)
+
+let close k =
+ if k.is_open then begin
+ lwt _ = USB.release_interface k.handle 0 in
+ lwt _ = USB.reset_device k.handle in
+ (*if k.kernel_active then USB.attach_kernel_driver k.handle 0;*)
+ (*USB.close k.handle;*)
+ k.is_open <- false;
+ return ()
+ end else return ()
+
+let open_card () =
+ let handle = USB.open_device_with
+ ~vendor_id:Protocol.usb_vid
+ ~product_id:Protocol.usb_pid_bootloader
+ in
+ let kernel_active = USB.kernel_driver_active handle 0 in
+ if kernel_active then USB.detach_kernel_driver handle 0;
+ lwt _ = USB.set_configuration handle 1 in
+ lwt _ = USB.claim_interface handle 0 in
+ let k = { is_open = true;
+ handle = handle;
+ kernel_active = kernel_active } in
+ let _ = Lwt_sequence.add_l (fun _ -> close k) Lwt_main.exit_hooks in
+ return k
+
+let header_length = 5
+
+let put_message buffer cmd length address data =
+ let body_length = String.length data in
+ assert (String.length buffer >= header_length+body_length);
+ let set i n = buffer.[i] <- char_of_int n in
+ set 0 cmd;
+ assert (length < 0x100);
+ set 1 length;
+ assert (address <= 0x1000000);
+ set 2 (address land 0xff);
+ set 3 ((address lsr 8) land 0xff);
+ set 4 ((address lsr 16) land 0xff);
+ String.blit data 0 buffer 5 body_length
+
+let send_receive_packet k send_buffer send_length receive_buffer receive_length send_delay receive_delay =
+ let handle = k.handle and endpoint = 1 in
+ lwt sent = USB.bulk_send ~handle ~endpoint ~timeout:1. send_buffer 0 send_length in
+ if sent <> send_length then
+ failwith (IncompleteWrite (sent, send_length))
+ else begin
+ lwt received = USB.bulk_recv ~handle ~endpoint ~timeout:3. receive_buffer 0 receive_length in
+ if received <> receive_length then
+ failwith (IncompleteRead (received, receive_length))
+ else
+ return ()
+ end
+
+let get_flash k ~address ~length =
+ let response_length = 64 in
+ let increment = response_length-header_length in
+ assert (increment < 256);
+ let send_buffer = String.create header_length in
+ let receive_buffer = String.create response_length in
+ let result_buffer = String.create length in
+ let rec loop offset total_length =
+ if total_length <= 0 then
+ return result_buffer
+ else begin
+ let length = min increment total_length in
+ let response_length = length+header_length in
+ let address = address+offset in
+ put_message send_buffer Protocol.read_flash length address "";
+ lwt () = send_receive_packet k send_buffer header_length receive_buffer response_length 1. 3. in
+ let receive_header = String.sub receive_buffer 0 header_length in
+ if receive_header <> send_buffer then
+ failwith (UnexpectedReply (receive_header, send_buffer))
+ else begin
+ String.blit receive_buffer header_length result_buffer offset length;
+ loop (offset+length) (total_length-length);
+ end
+ end
+ in loop 0 length
+
+let erase_flash k ~address ~length =
+ let response_length = 1 in
+ (* les effacements se font par blocs de 64 octets *)
+ let increment = 64 in
+ let send_buffer = String.create header_length in
+ let receive_buffer = String.create response_length in
+ let rec loop offset total_length =
+ if total_length <= 0 then
+ return ()
+ else begin
+ let address = address+offset in
+ put_message send_buffer Protocol.erase_flash 1 address "";
+ lwt () = send_receive_packet k send_buffer header_length receive_buffer response_length 1. 5. in
+ if int_of_char receive_buffer.[0] <> Protocol.erase_flash then
+ failwith (UnexpectedReply (receive_buffer, String.make 1 (char_of_int Protocol.erase_flash)))
+ else
+ loop (offset+increment) (total_length-increment);
+ end
+ in loop 0 length
+
+let reference = String.make 16 '\255'
+
+let write_flash k ~address data offset length =
+ let send_length = 64 and receive_length = 1 in
+ (* les écritures se font par blocs de 16 octets *)
+ let increment = 16 in
+ let send_buffer = String.create send_length in
+ let receive_buffer = String.create receive_length in
+ let rec loop address offset total_length =
+ (* address: sur le PIC, offset: dans data, total_length: taille restante *)
+ if total_length <= 0 then
+ return ()
+ else begin
+ let packet = String.make increment '\255' in
+ String.blit data offset packet 0 (min total_length increment);
+ if packet = reference then begin
+ (* le paquet n'a pas de contenu, on l'ignore *)
+ (* lwt () = printf "Skipping address 0x%06X...\n" address in *)
+ loop (address+increment) (offset+increment) (total_length-increment)
+ end else begin
+ (* lwt () = printf "Processing address 0x%06X...\n" address in *)
+ put_message send_buffer Protocol.write_flash increment address packet;
+ lwt () = send_receive_packet k send_buffer send_length receive_buffer receive_length 0.5 1. in
+ if int_of_char receive_buffer.[0] <> Protocol.write_flash then
+ failwith (UnexpectedReply (receive_buffer, String.make 1 (char_of_int Protocol.erase_flash)))
+ else begin
+ lwt written = get_flash k ~address ~length:increment in
+ if written <> packet then
+ failwith (WriteError (packet, written))
+ else
+ loop (address+increment) (offset+increment) (total_length-increment)
+ end
+ end
+ end
+ in loop address offset length
+
+let reset_board k =
+ let send_buffer = String.create 64 and receive_buffer = String.create 64 in
+ send_buffer.[0] <- char_of_int Protocol.reset;
+ lwt () = send_receive_packet k send_buffer 1 receive_buffer 64 5. 5. in
+ return ()
diff --git a/PC_Mainboard/card-tools/src/dump_memory.ml b/PC_Mainboard/card-tools/src/dump_memory.ml
new file mode 100644
index 0000000..5c746e0
--- /dev/null
+++ b/PC_Mainboard/card-tools/src/dump_memory.ml
@@ -0,0 +1,30 @@
+(*
+ * dump_memory.ml
+ * --------------
+ * Copyright : (c) 2009, Stéphane Glondu <st...@gl...>
+ * Licence : BSD3
+ *
+ * This file is a part of Krobot.
+ *)
+
+open Printf
+open Lwt
+open Lwt_io
+
+let main =
+ lwt k = Bootloader.open_card () in
+ try_lwt
+ lwt data = Bootloader.get_flash k ~address:0x0 ~length:0x8000 in
+ let msg = match Boardname.get_board_name data with
+ | Some s -> sprintf "Board: %S" s
+ | None -> "Unable to identify board!"
+ in
+ lwt () = eprintlf "%s" msg in
+ (if Unix.isatty Unix.stdout then hexdump else write) stdout data >> flush stdout
+ with
+ | Bootloader.Error e ->
+ eprintlf "%s" (Bootloader.string_of_error e)
+ | e ->
+ eprintlf "%s" (Printexc.to_string e)
+
+let _ = Lwt_main.run main
diff --git a/PC_Mainboard/card-tools/src/hexfile.ml b/PC_Mainboard/card-tools/src/hexfile.ml
new file mode 100644
index 0000000..a667957
--- /dev/null
+++ b/PC_Mainboard/card-tools/src/hexfile.ml
@@ -0,0 +1,112 @@
+(*
+ * hexfile.ml
+ * ----------
+ * Copyright : (c) 2009, Stéphane Glondu <st...@gl...>
+ * Licence : BSD3
+ *
+ * This file is a part of Krobot.
+ *)
+
+open Lwt
+open Lwt_io
+
+type hex_record =
+ | Data of int * string
+ | ExtendedLinearAddress of int
+ | EndOfFile of int
+
+let string_of_hexline str =
+ let n = String.length str in
+ assert (n > 0 && n mod 2 = 1 && str.[0] = ':');
+ let m = n/2 in
+ let result = String.create m in
+ for i = 0 to m-1 do
+ let j = 2*i+1 in
+ result.[i] <- char_of_int (int_of_string ("0x"^(String.sub str j 2)))
+ done;
+ result
+
+let compute_checksum str =
+ let rec aux i accu =
+ if i < 0 then
+ (-accu) land 0xff
+ else
+ aux (i-1) (accu+(int_of_char str.[i]))
+ in aux (String.length str - 2) 0
+
+let parse_line str =
+ let str = string_of_hexline str in
+ let get i = int_of_char str.[i] in
+ let n = String.length str in
+ assert (n >= 5 && compute_checksum str = int_of_char str.[n-1]);
+ let count = get 0 in
+ assert (count+5 = n);
+ let address = ((get 1) lsl 8) lor (get 2) in
+ let record_type = get 3 in
+ let data = String.sub str 4 count in
+ match record_type with
+ | 0x00 ->
+ Data (address, data)
+ | 0x01 ->
+ assert (count = 0);
+ EndOfFile address
+ | 0x04 ->
+ assert (count = 2 && address = 0);
+ let msb = int_of_char data.[0] and lsb = int_of_char data.[1] in
+ (* check for possible overflow *)
+ assert (msb land 0x80 = 0);
+ ExtendedLinearAddress ((msb lsl 8) lor lsb)
+ | _ -> assert false
+
+let parse_file file =
+ let ic = Lwt_io.open_file ~mode:input file in
+ let lines = Lwt_io.read_lines ic in
+ let lines = Lwt_stream.map parse_line lines in
+ lwt lines = Lwt_stream.get_while (fun _ -> true) lines in
+ lwt _ = Lwt_io.close ic in
+ return lines
+
+let print_record = function
+ | Data (address, data) ->
+ Printf.printf "DAT %04x" address;
+ String.iter (fun c -> Printf.printf " %02x" (int_of_char c)) data;
+ Printf.printf "\n"
+ | ExtendedLinearAddress address ->
+ Printf.printf "ELA %04x\n" address
+ | EndOfFile address ->
+ Printf.printf "EOF %04x\n" address
+
+let validate_and_copy hex addr_base buffer offset length =
+ assert (offset+length <= String.length buffer);
+ let min_address = addr_base+offset in
+ let max_address = min_address+length in
+ let addr_high = ref 0 in
+ let execute_record = function
+ | Data (address, data) ->
+ assert (address land 0xFFFF = address);
+ let address = !addr_high lor address in
+ if address < min_address || address >= max_address then
+ Printf.eprintf
+ "0x%04x is outside range, all bytes dropped\n"
+ address
+ else begin
+ let length =
+ let n = String.length data in
+ if address+n >= max_address then begin
+ Printf.eprintf
+ "some bytes at address 0x%04x are outside range (dropped)\n"
+ address;
+ max_address-address
+ end else n
+ in
+ let offset2 = address-addr_base in
+ String.blit data 0 buffer offset2 length;
+ end
+ | ExtendedLinearAddress address ->
+ assert (address land 0x8000 = 0);
+ addr_high := address lsl 16
+ | EndOfFile address ->
+ assert (address = 0);
+ raise Exit
+ in
+ try List.iter execute_record hex with Exit -> ()
diff --git a/PC_Mainboard/card-tools/src/hexfile.mli b/PC_Mainboard/card-tools/src/hexfile.mli
new file mode 100644
index 0000000..c6fa563
--- /dev/null
+++ b/PC_Mainboard/card-tools/src/hexfile.mli
@@ -0,0 +1,26 @@
+(*
+ * hexfile.mli
+ * -----------
+ * Copyright : (c) 2009, Stéphane Glondu <st...@gl...>
+ * Licence : BSD3
+ *
+ * This file is a part of Krobot.
+ *)
+
+type hex_record =
+ | Data of int * string
+ | ExtendedLinearAddress of int
+ | EndOfFile of int
+
+val parse_file : string -> hex_record list Lwt.t
+
+val print_record : hex_record -> unit
+ (** Prints one record on standard output. *)
+
+val validate_and_copy : hex_record list -> int -> string -> int -> int -> unit
+ (** [validate_and_copy hex addr_base buffer offset length] copies
+ the contents of the (parsed) [hex] file to [buffer]. [offset]
+ and [length] denote the valid range inside [buffer] that can be
+ written. [addr_base] is the address [buffer] is mapped to on the
+ microcontroller. Bytes outside the range are ignored (and a
+ warning is printed on standard error. *)
diff --git a/PC_Mainboard/card-tools/src/myocamlbuild.ml b/PC_Mainboard/card-tools/src/myocamlbuild.ml
new file mode 100644
index 0000000..593f6b9
--- /dev/null
+++ b/PC_Mainboard/card-tools/src/myocamlbuild.ml
@@ -0,0 +1,126 @@
+(*
+ * myocamlbuild.ml
+ * ---------------
+ * Copyright : (c) 2009, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+open Printf
+open Ocamlbuild_plugin
+
+(* +-----------------------------------------------------------------+
+ | Ocamlfind |
+ +-----------------------------------------------------------------+ *)
+
+(* Put here packages you may use in this project: *)
+let packages = [
+ "type-conv";
+ "type-conv.syntax";
+ "camlp4";
+ "camlp4.extend";
+ "camlp4.lib";
+ "camlp4.macro";
+ "camlp4.quotations.o";
+ "camlp4.quotations.r";
+ "lwt";
+ "lwt.unix";
+ "lwt.syntax";
+ "lwt.syntax.log";
+ "lwt.text";
+ "text";
+ "text.pcre";
+ "str";
+ "xmlm";
+ "react";
+ "usb";
+ "obus";
+ "obus.syntax";
+ "bitstring";
+ "bitstring.syntax";
+ "sdl";
+]
+
+(* List of available syntaxes :*)
+let syntaxes = [
+ "camlp4o";
+ "camlp4r";
+]
+
+(* +-----------------------------------------------------------------+
+ | Utils |
+ +-----------------------------------------------------------------+ *)
+
+let flag_all_stages_except_link tag f =
+ flag ["ocaml"; "compile"; tag] f;
+ flag ["ocaml"; "ocamldep"; tag] f;
+ flag ["ocaml"; "doc"; tag] f
+
+let flag_all_stages tag f =
+ flag_all_stages_except_link tag f;
+ flag ["ocaml"; "link"; tag] f
+
+let _ =
+ dispatch begin function
+ | Before_options ->
+
+ (* override default commands by ocamlfind ones *)
+ let ocamlfind x = S[A"ocamlfind"; A x] in
+ Options.ocamlc := ocamlfind "ocamlc";
+ Options.ocamlopt := ocamlfind "ocamlopt";
+ Options.ocamldep := ocamlfind "ocamldep";
+ (* FIXME: sometimes ocamldoc say that elements are not found
+ even if they are present: *)
+ Options.ocamldoc := S[A"ocamlfind"; A"ocamldoc"; A"-hide-warnings"]
+
+ | After_rules ->
+
+ (* D-Bus drivers can see the lowlevel interfaces *)
+ Pathname.define_context "dbus-drivers" [ "usb" ];
+
+ (* Génération du fichier contenant les détails du protocol à
+ partir du fichier .h *)
+ rule "protocol du krobot" ~dep:"PcInterface.h" ~prod:"protocol.ml"
+ (fun _ _ ->
+ Cmd(S[Sh"awk '$1 == \"#define\" && $3 != \"\" { print \"let \" tolower($2) \" = \" $3 }' PcInterface.h > protocol.ml"]));
+
+ (* +---------------------------------------------------------+
+ | Virtual targets |
+ +---------------------------------------------------------+ *)
+
+ let virtual_rule name deps =
+ rule name ~stamp:name ~deps (fun _ _ -> Nop)
+ in
+
+ virtual_rule "all" [
+ "lib-krobot/krobot.cma";
+ "lib-krobot/krobot.cmxa";
+ "tools/status.native";
+ "tools/controller.native";
+ "remote/forward_dbus.native";
+ "tools/joy_control.native";
+ ];
+
+ (* +---------------------------------------------------------+
+ | Ocamlfind stuff |
+ +---------------------------------------------------------+ *)
+
+ (* When one link an OCaml binary, one should use -linkpkg *)
+ flag ["ocaml"; "link"; "program"] & A"-linkpkg";
+
+ (* For each ocamlfind package one inject the -package option
+ when compiling, computing dependencies, generating
+ documentation and linking. *)
+ List.iter
+ (fun package -> flag_all_stages ("pkg_" ^ package) (S[A"-package"; A package]))
+ packages;
+
+ (* Like -package but for extensions syntax. Morover -syntax is
+ useless when linking. *)
+ List.iter
+ (fun syntax -> flag_all_stages_except_link ("syntax_" ^ syntax) (S[A"-syntax"; A syntax]))
+ syntaxes;
+
+ | _ -> ()
+ end
diff --git a/PC_Mainboard/card-tools/src/send_firmware.ml b/PC_Mainboard/card-tools/src/send_firmware.ml
new file mode 100644
index 0000000..1dedd01
--- /dev/null
+++ b/PC_Mainboard/card-tools/src/send_firmware.ml
@@ -0,0 +1,69 @@
+(*
+ * send_firmware.ml
+ * ----------------
+ * Copyright : (c) 2009, Stéphane Glondu <st...@gl...>
+ * Licence : BSD3
+ *
+ * This file is a part of Krobot.
+ *)
+
+open Lwt
+open Lwt_io
+
+let do_flash force filename =
+ lwt hex = Hexfile.parse_file filename in
+ let memory =
+ let buffer = String.make 0x8000 '\255' in
+ Hexfile.validate_and_copy hex 0x0 buffer 0 0x8000;
+ buffer
+ in
+ let firmware_name = Boardname.get_board_name memory in
+ lwt () = match firmware_name with
+ | Some s -> printf "Detected firmware: %S\n" s
+ | None -> printf "Unable to identify firmware!\n"
+ in
+ let address = 0x800 and length = 0x8000-0x800 in
+ lwt k = Bootloader.open_card () in
+ lwt () = printf "Card opened\n" in
+ lwt data = Bootloader.get_flash k ~address:0x0 ~length:0x8000 in
+ let board_name = Boardname.get_board_name data in
+ lwt () = match board_name with
+ | Some s -> printf "Detected card: %S\n" s
+ | None -> printf "Unable to identify card!\n"
+ in
+ lwt () =
+ if not force && (board_name = None || firmware_name = None || board_name <> firmware_name) then begin
+ lwt () = eprintf "board name and firmware name do not match, use --force\n" in
+ exit 1
+ end else return ()
+ in
+ lwt () = Bootloader.erase_flash k ~address ~length in
+ lwt () = printf "Flash erased\n" in
+ lwt () = Bootloader.write_flash k ~address memory address length in
+ lwt () = printf "Flashing completed\n" in
+ return ()
+
+let _ =
+ let force = ref false in
+ let filename = ref None in
+ let speclist = [
+ "--force", Arg.Set force, "Force flashing even if board id and firmware id do not match";
+ ] in
+ Arg.parse speclist
+ (fun s ->
+ match !filename with
+ | None -> filename := Some s
+ | Some _ -> raise (Arg.Bad s))
+ "Send a firmware to a board in bootloader mode";
+ let filename = match !filename with
+ | None -> Printf.eprintf "You must specify a .hex file!\n"; exit 1
+ | Some s -> s
+ in
+ Lwt_main.run
+ (try_lwt
+ do_flash !force filename
+ with
+ | Bootloader.Error e ->
+ eprintl (Bootloader.string_of_error e)
+ | e ->
+ eprintl (Printexc.to_string e))
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-03 21:01:15
|
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 6c6fc54b41b825a7fd7a7c4e3b66b5991e92b084 (commit)
via 42ea7b3fc3549e99b5dd1f690acbd4e2973c7471 (commit)
from 306a26a4ab748da3e97fe47c4c07e8330f4fecbc (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 6c6fc54b41b825a7fd7a7c4e3b66b5991e92b084
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 22:00:25 2010 +0100
fixes command parsing
commit 42ea7b3fc3549e99b5dd1f690acbd4e2973c7471
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 21:59:47 2010 +0100
enable lm629 on motor card
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/tools/script.ml b/PC_Mainboard/clients/tools/script.ml
index a23183a..3fc468c 100644
--- a/PC_Mainboard/clients/tools/script.ml
+++ b/PC_Mainboard/clients/tools/script.ml
@@ -96,41 +96,31 @@ let motor_of_string = function
| _ -> failwith "Script.motor_of_strig: invalid motor"
let exec krobot line =
- match Text.words line with
- | [] ->
+ let action, args = Script_lexer.whole_command (Lexing.from_string line) in
+ let arg_int key default = try int_of_string (List.assoc key args) with Not_found -> default in
+ let arg_string key default = try List.assoc key args with Not_found -> default in
+ match action with
+ | "forward" ->
+ Krobot.move krobot ~dist:(arg_int "dist" 100) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
+ | "backward" ->
+ Krobot.move krobot ~dist:(-(arg_int "dist" 100)) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
+ | "left" ->
+ Krobot.turn krobot ~angle:(arg_int "dist" 100) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
+ | "right" ->
+ Krobot.turn krobot ~angle:(-(arg_int "dist" 100)) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
+ | "stop-motors" ->
+ Krobot.stop_motors krobot
+ ~motor:(motor_of_string (arg_string "motor" "both"))
+ ~mode:(match arg_string "mode" "off" with
+ | "off" -> `Off
+ | "abrupt" -> `Abrupt
+ | "smooth" -> `Smooth
+ | _ -> failwith "Script.exec: invalid stop mode")
+ | "set-speed" ->
+ Krobot.set_speed krobot
+ ~motor:(motor_of_string (arg_string "motor" "both"))
+ ~speed:(arg_int "speed" 100)
+ ~acc:(arg_int "acc" 800)
+ | _ ->
return ()
- | action :: args ->
- let rec make_args acc = function
- | [] | [_] ->
- acc
- | key :: value :: rest ->
- make_args ((key, value) :: acc) rest
- in
- let args = make_args [] args in
- let arg_int key default = try int_of_string (List.assoc key args) with Not_found -> default in
- let arg_string key default = try List.assoc key args with Not_found -> default in
- match action with
- | "forward" ->
- Krobot.move krobot ~dist:(arg_int "dist" 100) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
- | "backward" ->
- Krobot.move krobot ~dist:(-(arg_int "dist" 100)) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
- | "left" ->
- Krobot.turn krobot ~angle:(arg_int "dist" 100) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
- | "right" ->
- Krobot.turn krobot ~angle:(-(arg_int "dist" 100)) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
- | "stop-motors" ->
- Krobot.stop_motors krobot
- ~motor:(motor_of_string (arg_string "motor" "both"))
- ~mode:(match arg_string "mode" "off" with
- | "off" -> `Off
- | "abrupt" -> `Abrupt
- | "smooth" -> `Smooth
- | _ -> failwith "Script.exec: invalid stop mode")
- | "set-speed" ->
- Krobot.set_speed krobot
- ~motor:(motor_of_string (arg_string "motor" "both"))
- ~speed:(arg_int "speed" 100)
- ~acc:(arg_int "acc" 800)
- | _ ->
- return ()
diff --git a/PC_Mainboard/clients/tools/script_lexer.mll b/PC_Mainboard/clients/tools/script_lexer.mll
index fea99ef..a32c26e 100644
--- a/PC_Mainboard/clients/tools/script_lexer.mll
+++ b/PC_Mainboard/clients/tools/script_lexer.mll
@@ -56,3 +56,15 @@ and arguments buf = parse
(TextSet.add key set, x) }
| ""
{ (TextSet.empty, `Nothing) }
+
+and whole_command = parse
+ | blank* (ident as command)
+ { (command, whole_arguments lexbuf) }
+ | ""
+ { raise Exit }
+
+and whole_arguments = parse
+ | blank+ (ident as key) blank* "=" blank* (value as value)
+ { (key, value) :: whole_arguments lexbuf }
+ | blank* eof
+ { [] }
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index 93aca19..2defde7 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -59,14 +59,20 @@ let motor_enable card =
RW.set_uint8 data 1 Protocol.motor_both;
Card.send_command card Protocol.cmd_motor data
+let init_lm629 card =
+ Log#info "enabling lm629 on %s card" (Card.name card);
+ let data = Card.make_buffer () in
+ RW.set_uint8 data 0 Protocol.traj_init;
+ Card.send_command card Protocol.cmd_traj data
+
(* Enable motors when a card comes up *)
-let enable_motor_on_running card =
+let on_running card f =
let stop = ref ignore in
let notifier =
Lwt_signal.notify_p
(function
| Card.Running ->
- motor_enable card
+ f card
| Card.Opening ->
return ()
| Card.Closed ->
@@ -77,8 +83,9 @@ let enable_motor_on_running card =
stop := (fun () -> Lwt_signal.disable notifier)
let () =
- enable_motor_on_running card_interface;
- enable_motor_on_running card_motor
+ on_running card_interface motor_enable;
+ on_running card_motor
+ (fun card -> motor_enable card <&> init_lm629 card)
(* +-----------------------------------------------------------------+
| Compass |
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-03 20:25:20
|
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 306a26a4ab748da3e97fe47c4c07e8330f4fecbc (commit)
via 16979aa5f30a0aa2f2af0bfb399583e4cb2b0c9f (commit)
via 137b19a3d05ee1d229bccc0479561d6b4198eff4 (commit)
from 7901902fd761df3dac5b3e8ac95a3863a1e8afd0 (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 306a26a4ab748da3e97fe47c4c07e8330f4fecbc
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 21:22:33 2010 +0100
more logs
commit 16979aa5f30a0aa2f2af0bfb399583e4cb2b0c9f
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 21:13:54 2010 +0100
typo in Driver.Motors.move (turn instead of move)
commit 137b19a3d05ee1d229bccc0479561d6b4198eff4
Author: Olivier BICHLER <oli...@en...>
Date: Wed Feb 3 21:06:40 2010 +0100
inverse forward and backward
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.ml b/PC_Mainboard/clients/lib-krobot/krobot.ml
index f40896c..155affe 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.ml
+++ b/PC_Mainboard/clients/lib-krobot/krobot.ml
@@ -206,7 +206,7 @@ OP_method StopMotors : motor -> stop_mode -> unit
OP_method SetSpeed : motor -> int -> int -> unit
let turn krobot ~angle ~speed ~acc = turn krobot angle speed acc
-let move krobot ~dist ~speed ~acc = turn krobot dist speed acc
+let move krobot ~dist ~speed ~acc = move krobot dist speed acc
let stop_motors krobot ~motor ~mode = stop_motors krobot motor mode
let set_speed krobot ~motor ~speed ~acc = set_speed krobot motor speed acc
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index ff0f8c7..93aca19 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -390,38 +390,56 @@ struct
RW.set_int16 data 5 arg3;
Card.send_command card Protocol.cmd_traj data
- let move_forward = move Protocol.traj_forward
- let move_backward = move Protocol.traj_backward
- let turn_right = move Protocol.traj_tr
- let turn_left = move Protocol.traj_tl
-
let turn dev angle speed acc =
+ Log#info "motor: turn(angle=%d, speed=%d, acc=%d)" angle speed acc;
if angle < 0 then
move Protocol.traj_tl dev.card (-angle) speed acc
else
move Protocol.traj_tr dev.card angle speed acc
let move dev dist speed acc =
+ Log#info "motor: move(dist=%d, speed=%d, acc=%d)" dist speed acc;
if dist < 0 then
- move Protocol.traj_backward dev.card (-dist) speed acc
+ move Protocol.traj_forward dev.card (-dist) speed acc
else
- move Protocol.traj_forward dev.card dist speed acc
+ move Protocol.traj_backward dev.card dist speed acc
let obus_motor = OBus_type.mapping obus_int
- [(Protocol.motor_left, -1);
- (Protocol.motor_both, 0);
- (Protocol.motor_right, 1)]
+ [(`Left, -1);
+ (`Both, 0);
+ (`Right, 1)]
let obus_stop_mode = OBus_type.mapping obus_int
- [(Protocol.traj_stop_motor_off, 0);
- (Protocol.traj_stop_abrupt, 1);
- (Protocol.traj_stop_smooth, 2)]
+ [(`Off, 0);
+ (`Abrupt, 1);
+ (`Smooth, 2)]
+
+ let int_of_motor = function
+ | `Left -> Protocol.motor_left
+ | `Both -> Protocol.motor_both
+ | `Right -> Protocol.motor_right
+
+ let string_of_motor = function
+ | `Left -> "left"
+ | `Both -> "both"
+ | `Right -> "right"
+
+ let int_of_stop_mode = function
+ | `Off -> Protocol.traj_stop_motor_off
+ | `Abrupt -> Protocol.traj_stop_abrupt
+ | `Smooth -> Protocol.traj_stop_smooth
+
+ let string_of_stop_mode = function
+ | `Off -> "off"
+ | `Abrupt -> "abrupt"
+ | `Smooth -> "smooth"
let stop_motors dev motor mode =
+ Log#info "motor: stopping(motor=%s, mode=%s)" (string_of_motor motor) (string_of_stop_mode mode);
let data = String.create 4 in
RW.set_uint8 data 0 Protocol.traj_stop;
- RW.set_uint8 data 1 motor;
- RW.set_uint16 data 2 mode;
+ RW.set_uint8 data 1 (int_of_motor motor);
+ RW.set_uint16 data 2 (int_of_stop_mode mode);
Card.send_command dev.card Protocol.cmd_traj data
(* Values comming from lm629.h *)
@@ -431,7 +449,7 @@ struct
let traj_new_velocity card motor vel acc dir =
let data = String.create 8 in
RW.set_uint8 data 0 Protocol.traj_new_velocity;
- RW.set_uint8 data 1 motor;
+ RW.set_uint8 data 1 (int_of_motor motor);
RW.set_int16 data 2 vel;
RW.set_int16 data 4 acc;
RW.set_int16 data 6 dir;
@@ -440,7 +458,7 @@ struct
let traj_change_velocity card motor vel dir =
let data = String.create 6 in
RW.set_uint8 data 0 Protocol.traj_change_velocity;
- RW.set_uint8 data 1 motor;
+ RW.set_uint8 data 1 (int_of_motor motor);
RW.set_int16 data 2 vel;
RW.set_int16 data 4 dir;
Card.send_command card Protocol.cmd_traj data
@@ -448,10 +466,11 @@ struct
let traj_start card motor =
let data = String.create 2 in
RW.set_uint8 data 0 Protocol.traj_start;
- RW.set_uint8 data 1 motor;
+ RW.set_uint8 data 1 (int_of_motor motor);
Card.send_command card Protocol.cmd_traj data
let set_speed dev motor speed acc =
+ Log#info "motor: set_speed(motor=%s, speed=%d, acc=%d)" (string_of_motor motor) speed acc;
let dir, speed = if speed < 0 then (backward, -speed) else (forward, speed) in
lwt () =
if Some acc <> dev.acceleration then begin
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-03 14:54:19
|
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 7901902fd761df3dac5b3e8ac95a3863a1e8afd0 (commit)
from 54394d487afb514fc3d7ffb36f15ad8f304c1972 (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 7901902fd761df3dac5b3e8ac95a3863a1e8afd0
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 15:53:47 2010 +0100
added joystick control
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/_tags b/PC_Mainboard/clients/_tags
index a232f9b..8582d38 100644
--- a/PC_Mainboard/clients/_tags
+++ b/PC_Mainboard/clients/_tags
@@ -10,3 +10,5 @@
# lib-krobot uses obus
<**/*>: pkg_obus
<tools/*>: pkg_lwt.text, pkg_text.pcre
+
+<tools/joy_control.*>: pkg_sdl
diff --git a/PC_Mainboard/clients/myocamlbuild.ml b/PC_Mainboard/clients/myocamlbuild.ml
index ff52740..593f6b9 100644
--- a/PC_Mainboard/clients/myocamlbuild.ml
+++ b/PC_Mainboard/clients/myocamlbuild.ml
@@ -39,6 +39,7 @@ let packages = [
"obus.syntax";
"bitstring";
"bitstring.syntax";
+ "sdl";
]
(* List of available syntaxes :*)
@@ -98,6 +99,7 @@ let _ =
"tools/status.native";
"tools/controller.native";
"remote/forward_dbus.native";
+ "tools/joy_control.native";
];
(* +---------------------------------------------------------+
diff --git a/PC_Mainboard/clients/tools/joy_control.ml b/PC_Mainboard/clients/tools/joy_control.ml
new file mode 100644
index 0000000..f6ce1c1
--- /dev/null
+++ b/PC_Mainboard/clients/tools/joy_control.ml
@@ -0,0 +1,182 @@
+(*
+ * joy_control.ml
+ * --------------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+(* Control the robot with a joystick *)
+
+open Lwt
+open Sdljoystick
+open Sdlevent
+open Sdlkey
+
+(* +-----------------------------------------------------------------+
+ | Joystick events |
+ +-----------------------------------------------------------------+ *)
+
+type button =
+ | ButtonCross
+ | ButtonSquare
+ | ButtonTriangle
+ | ButtonCircle
+ | ButtonDown
+ | ButtonLeft
+ | ButtonUp
+ | ButtonRight
+ | ButtonSelect
+ | ButtonStart
+ | ButtonR1
+ | ButtonR2
+ | ButtonL1
+ | ButtonL2
+ | ButtonPS3
+ | ButtonLAxis
+ | ButtonRAxis
+
+type event =
+ | JoyRAxis of int
+ | JoyLAxis of int
+ | JoyButtonPressed of button
+ | JoyButtonReleased of button
+ | KeyPressed of Sdlkey.t
+ | KeyReleased of Sdlkey.t
+
+(* +-----------------------------------------------------------------+
+ | int --> button |
+ +-----------------------------------------------------------------+ *)
+
+let raxis = 3
+let laxis = 1
+
+let axis_min = -32768
+let axis_max = 32767
+
+let button_of_num = function
+ | 14 -> ButtonCross
+ | 15 -> ButtonSquare
+ | 12 -> ButtonTriangle
+ | 13 -> ButtonCircle
+ | 6 -> ButtonDown
+ | 7 -> ButtonLeft
+ | 4 -> ButtonUp
+ | 5 -> ButtonRight
+ | 0 -> ButtonSelect
+ | 3 -> ButtonStart
+ | 11 -> ButtonR1
+ | 9 -> ButtonR2
+ | 10 -> ButtonL1
+ | 8 -> ButtonL2
+ | 16 -> ButtonPS3
+ | 1 -> ButtonLAxis
+ | 2 -> ButtonRAxis
+ | n -> Printf.ksprintf failwith "unknown button %d" n
+
+(* +-----------------------------------------------------------------+
+ | SDL events (executed in a child process) |
+ +-----------------------------------------------------------------+ *)
+
+let child_loop pipe joy =
+ let axis_state = Array.init (num_axes joy) (get_axis joy) in
+ let send ev =
+ Pervasives.output_value pipe ev;
+ Pervasives.flush pipe
+ in
+ while true do
+ match wait_event () with
+ | KEYDOWN { keysym = key } ->
+ send (KeyPressed key);
+ if key = KEY_ESCAPE then begin
+ Sdl.quit ();
+ exit 0
+ end
+ | JOYAXISMOTION { jae_axis = axis; jae_value = value } when axis = raxis || axis = laxis ->
+ let value = 100 - ((value - axis_min) * 200 / (axis_max - axis_min)) in
+ if value <> axis_state.(axis) then begin
+ axis_state.(axis) <- value;
+ if axis = laxis then
+ send (JoyLAxis value)
+ else
+ send (JoyRAxis value)
+ end
+ | JOYBUTTONUP { jbe_button = button } ->
+ send (JoyButtonPressed(button_of_num button))
+ | JOYBUTTONDOWN { jbe_button = button } ->
+ send (JoyButtonReleased(button_of_num button))
+ | _ ->
+ ()
+ done
+
+(* +-----------------------------------------------------------------+
+ | Handling events (in the parent process) |
+ +-----------------------------------------------------------------+ *)
+
+let axis_coef = 8
+let acceleration = 800
+
+let parent_loop krobot pipe =
+ let rstop = ref false and lstop = ref false in
+ let rec loop () =
+ Lwt_io.read_value pipe >>= function
+ | KeyPressed KEY_ESCAPE ->
+ return ()
+ | JoyRAxis n ->
+ if not !rstop then
+ lwt () = Krobot.set_speed krobot ~motor:`Right ~speed:(n * axis_coef) ~acc:acceleration in
+ loop ()
+ else
+ loop ()
+ | JoyLAxis n ->
+ if not !lstop then
+ lwt () = Krobot.set_speed krobot ~motor:`Left ~speed:(n * axis_coef) ~acc:acceleration in
+ loop ()
+ else
+ loop ()
+ | JoyButtonPressed ButtonL2 ->
+ lstop := true;
+ lwt () = Krobot.stop_motors krobot ~motor:`Left ~mode:`Abrupt in
+ ignore (lwt () = Lwt_unix.sleep 1.0 in lstop := false; return ());
+ loop ()
+ | JoyButtonPressed ButtonR2 ->
+ rstop := true;
+ lwt () = Krobot.stop_motors krobot ~motor:`Right ~mode:`Abrupt in
+ ignore (lwt () = Lwt_unix.sleep 1.0 in rstop := false; return ());
+ loop ()
+ | JoyButtonReleased ButtonCircle ->
+ rstop := false;
+ lstop := false;
+ loop ()
+ | _ ->
+ loop ()
+ in
+ loop ()
+
+(* +-----------------------------------------------------------------+
+ | Entry-point |
+ +-----------------------------------------------------------------+ *)
+
+let () =
+ let fd_r, fd_w = Unix.pipe () in
+ match Unix.fork () with
+ | 0 ->
+ Unix.close fd_r;
+ Sdl.init [`JOYSTICK;`VIDEO];
+ ignore (Sdlvideo.set_video_mode 100 100 []);
+ Sdljoystick.set_event_state true;
+ let joy =
+ try
+ open_joystick 0
+ with exn ->
+ Log#error "cannot open joystick: %S" (Printexc.to_string exn);
+ raise exn
+ in
+ child_loop (Unix.out_channel_of_descr fd_w) joy
+ | pid ->
+ Unix.close fd_w;
+ Lwt_main.run begin
+ lwt krobot = Krobot.create () in
+ parent_loop krobot (Lwt_io.of_unix_fd ~mode:Lwt_io.input fd_r)
+ end
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-03 14:17:38
|
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 54394d487afb514fc3d7ffb36f15ad8f304c1972 (commit)
from 4d6ec639024036a9a80a91c452ad8831db96671b (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 54394d487afb514fc3d7ffb36f15ad8f304c1972
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 15:17:18 2010 +0100
add the set-speed command
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.ml b/PC_Mainboard/clients/lib-krobot/krobot.ml
index 58b2177..f40896c 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.ml
+++ b/PC_Mainboard/clients/lib-krobot/krobot.ml
@@ -188,6 +188,8 @@ OP_method CloseGrip : unit
include MakeDevice(struct let name = "Motors" end)
+type motor = [ `Left | `Right | `Both ]
+
let obus_motor = OBus_type.mapping obus_int
[(`Left, -1);
(`Both, 0);
@@ -206,7 +208,7 @@ OP_method SetSpeed : motor -> int -> int -> unit
let turn krobot ~angle ~speed ~acc = turn krobot angle speed acc
let move krobot ~dist ~speed ~acc = turn krobot dist speed acc
let stop_motors krobot ~motor ~mode = stop_motors krobot motor mode
-let set_speed krobot ~motor ~mode = set_speed krobot motor mode
+let set_speed krobot ~motor ~speed ~acc = set_speed krobot motor speed acc
(* +-----------------------------------------------------------------+
| Cards |
diff --git a/PC_Mainboard/clients/tools/script.ml b/PC_Mainboard/clients/tools/script.ml
index 1bb167a..a23183a 100644
--- a/PC_Mainboard/clients/tools/script.ml
+++ b/PC_Mainboard/clients/tools/script.ml
@@ -35,6 +35,10 @@ let commands = [
{ name = "stop-motors";
args = [("motor", Arg_keyword ["left"; "right"; "both"]);
("mode", Arg_keyword ["off"; "abrupt"; "smooth"])] };
+ { name = "set-speed";
+ args = [("motor", Arg_keyword ["left"; "right"; "both"]);
+ ("speed", Arg_int);
+ ("acc", Arg_int)] };
]
let set_of_list l = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty l
@@ -85,6 +89,12 @@ let complete ~before ~after =
{ Lwt_read_line.comp_state = (before, after);
Lwt_read_line.comp_words = TextSet.empty }
+let motor_of_string = function
+ | "both" -> `Both
+ | "left" -> `Left
+ | "right" -> `Right
+ | _ -> failwith "Script.motor_of_strig: invalid motor"
+
let exec krobot line =
match Text.words line with
| [] ->
@@ -110,16 +120,17 @@ let exec krobot line =
Krobot.turn krobot ~angle:(-(arg_int "dist" 100)) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
| "stop-motors" ->
Krobot.stop_motors krobot
- ~motor:(match arg_string "motor" "both" with
- | "both" -> `Both
- | "left" -> `Left
- | "right" -> `Right
- | _ -> failwith "Script.exec: invalid motor")
+ ~motor:(motor_of_string (arg_string "motor" "both"))
~mode:(match arg_string "mode" "off" with
| "off" -> `Off
| "abrupt" -> `Abrupt
| "smooth" -> `Smooth
| _ -> failwith "Script.exec: invalid stop mode")
+ | "set-speed" ->
+ Krobot.set_speed krobot
+ ~motor:(motor_of_string (arg_string "motor" "both"))
+ ~speed:(arg_int "speed" 100)
+ ~acc:(arg_int "acc" 800)
| _ ->
return ()
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-03 14:12:21
|
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 4d6ec639024036a9a80a91c452ad8831db96671b (commit)
via bb8ab39552d9e5f3d8d28ea76ba5b39f9e92ae4c (commit)
from 817f11427cf4305cb7ee66ab1a248473c89e2992 (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 4d6ec639024036a9a80a91c452ad8831db96671b
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 15:11:28 2010 +0100
rename monitor to controller
commit bb8ab39552d9e5f3d8d28ea76ba5b39f9e92ae4c
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 15:09:28 2010 +0100
added per motor speed setting
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.ml b/PC_Mainboard/clients/lib-krobot/krobot.ml
index 05ef14d..58b2177 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.ml
+++ b/PC_Mainboard/clients/lib-krobot/krobot.ml
@@ -188,22 +188,25 @@ OP_method CloseGrip : unit
include MakeDevice(struct let name = "Motors" end)
+let obus_motor = OBus_type.mapping obus_int
+ [(`Left, -1);
+ (`Both, 0);
+ (`Right, 1)]
+
+let obus_stop_mode = OBus_type.mapping obus_int
+ [(`Off, 0);
+ (`Abrupt, 1);
+ (`Smooth, 2)]
+
OP_method Turn : int -> int -> int -> unit
OP_method Move : int -> int -> int -> unit
-OP_method StopMotors : int -> int -> unit
+OP_method StopMotors : motor -> stop_mode -> unit
+OP_method SetSpeed : motor -> int -> int -> unit
let turn krobot ~angle ~speed ~acc = turn krobot angle speed acc
let move krobot ~dist ~speed ~acc = turn krobot dist speed acc
-let stop_motors krobot ~motor ~mode =
- stop_motors krobot
- (match motor with
- | `Left -> -1
- | `Both -> 0
- | `Right -> 1)
- (match mode with
- | `Off -> 0
- | `Abrupt -> 1
- | `Smooth -> 2)
+let stop_motors krobot ~motor ~mode = stop_motors krobot motor mode
+let set_speed krobot ~motor ~mode = set_speed krobot motor mode
(* +-----------------------------------------------------------------+
| Cards |
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.mli b/PC_Mainboard/clients/lib-krobot/krobot.mli
index cf75746..4c7046b 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.mli
+++ b/PC_Mainboard/clients/lib-krobot/krobot.mli
@@ -71,9 +71,15 @@ val close_grip : t -> unit Lwt.t
val turn : t -> angle : int -> speed : int -> acc : int -> unit Lwt.t
val move : t -> dist : int -> speed : int -> acc : int -> unit Lwt.t
-val stop_motors : t -> motor : [ `Left | `Right | `Both ] -> mode : [ `Off | `Abrupt | `Smooth ] -> unit Lwt.t
+type motor = [ `Left | `Right | `Both ]
+
+val stop_motors : t -> motor : motor -> mode : [ `Off | `Abrupt | `Smooth ] -> unit Lwt.t
(** [stop_motorw t motor mode] stop the given motor(s). *)
+val set_speed : t -> motor : motor -> speed : int -> acc : int -> unit Lwt.t
+ (** [set_speed krobot ~motor ~speed ~acc] set the speed and
+ acceleration for the specified motors. *)
+
(** {6 Cards} *)
module Card : sig
diff --git a/PC_Mainboard/clients/myocamlbuild.ml b/PC_Mainboard/clients/myocamlbuild.ml
index 9e3cd7c..ff52740 100644
--- a/PC_Mainboard/clients/myocamlbuild.ml
+++ b/PC_Mainboard/clients/myocamlbuild.ml
@@ -96,7 +96,7 @@ let _ =
"lib-krobot/krobot.cma";
"lib-krobot/krobot.cmxa";
"tools/status.native";
- "tools/monitor.native";
+ "tools/controller.native";
"remote/forward_dbus.native";
];
diff --git a/PC_Mainboard/clients/tools/controller.ml b/PC_Mainboard/clients/tools/controller.ml
new file mode 100644
index 0000000..0eed0f3
--- /dev/null
+++ b/PC_Mainboard/clients/tools/controller.ml
@@ -0,0 +1,300 @@
+(*
+ * controller.ml
+ * -------------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+(* Prints status continuously *)
+
+open Lwt
+open Lwt_term
+open Lwt_read_line
+
+module TextSet = Set.Make(Text)
+
+(* +-----------------------------------------------------------------+
+ | Drawing |
+ +-----------------------------------------------------------------+ *)
+
+type section = {
+ screen : point array array;
+ x : int;
+ y : int;
+ w : int;
+ h : int;
+}
+
+let get_point clip x y =
+ if x >= 0 && x < clip.w && y >= 0 && y < clip.h then
+ clip.screen.(clip.y + y).(clip.x + x)
+ else
+ blank
+
+let set_point clip x y point =
+ if x >= 0 && x < clip.w && y >= 0 && y < clip.h then
+ clip.screen.(clip.y + y).(clip.x + x) <- point
+
+let draw_text clip ?style x y txt =
+ if y >= 0 && y < clip.h && x < clip.w then
+ let rec loop x ptr = match Text.next ptr with
+ | None ->
+ ()
+ | Some(ch, ptr) ->
+ if x >= 0 && x < clip.w then begin
+ match style with
+ | Some style ->
+ clip.screen.(clip.y + y).(clip.x + x) <- { char = ch; style = style }
+ | None ->
+ clip.screen.(clip.y + y).(clip.x + x) <- { blank with char = ch };
+ end;
+ loop (x + 1) ptr
+ in
+ loop x (Text.pointer_l txt)
+
+(* Prevent concurrent drawing: *)
+let drawer_mutex = Lwt_mutex.create ()
+
+(* Draw the whole screen *)
+let rec draw size (compass, logic_sensors, range_finders, team, jack) (engine_state, box, logs) (state_interface, state_sensor, state_motor) =
+ Lwt_mutex.with_lock drawer_mutex begin fun () ->
+ if Lwt_mutex.is_empty drawer_mutex then begin
+ (* Redraw the screen only if there is no other thread waiting to
+ do it *)
+
+ let screen = Zone.make ~width:size.columns ~height:size.lines in
+ let points = Zone.points screen in
+
+ (* ===== Borders ===== *)
+
+ for i = 1 to size.columns - 2 do
+ points.(0).(i) <- { blank with char = "─" };
+ points.(size.lines - 1).(i) <- { blank with char = "─" }
+ done;
+ for i = 1 to size.lines - 2 do
+ points.(i).(0) <- { blank with char = "│" };
+ points.(i).(size.columns - 1) <- { blank with char = "│" }
+ done;
+ points.(0).(0) <- { blank with char = "┌" };
+ points.(size.lines - 1).(0) <- { blank with char = "└" };
+ points.(size.lines - 1).(size.columns - 1) <- { blank with char = "┘" };
+ points.(0).(size.columns - 1) <- { blank with char = "┐" };
+
+ (* ===== Status ===== *)
+
+ Draw.text screen 1 0 "─[ Range finders ]─┬─[ Logic Sensors ]─┬─[ Status ]─";
+ points.(9).(0) <- { blank with char = "├" };
+ points.(9).(size.columns - 1) <- { blank with char = "┤" };
+ for i = 1 to size.columns - 2 do
+ points.(9).(i) <- { blank with char = "─" }
+ done;
+ for i = 1 to 8 do
+ points.(i).(20) <- { blank with char = "│" };
+ points.(i).(40) <- { blank with char = "│" }
+ done;
+ Draw.text screen 1 9 "───────────────────┴───────────────────┴";
+
+ let zone = Zone.inner screen in
+ for i = 0 to Array.length range_finders - 1 do
+ Draw.textf zone 0 i "%d : %d" i range_finders.(i)
+ done;
+ for i = 0 to Array.length logic_sensors / 2 - 1 do
+ let j = i * 2 in
+ Draw.textf zone 20 i "%02d : %s %02d : %s"
+ (j + 0) (if logic_sensors.(j + 0) then "O" else ".")
+ (j + 1) (if logic_sensors.(j + 1) then "O" else ".")
+ done;
+ let x = 40 in
+ Draw.textf zone x 0 "team = %s" (match team with Krobot.Team_red -> "red" | Krobot.Team_green -> "green");
+ Draw.textf zone x 1 "jack = %s" (if jack then "present" else "absent");
+ Draw.textf zone x 2 "compass = %d" compass;
+ let string_of_state = function
+ | `Running -> "running"
+ | `Opening -> "opening"
+ | `Closed -> "closed"
+ in
+ Draw.textf zone x 3 "interface card is %s" (string_of_state state_interface);
+ Draw.textf zone x 4 "sensor card is %s" (string_of_state state_sensor);
+ Draw.textf zone x 5 "motor card is %s" (string_of_state state_motor);
+
+ (* ===== History ===== *)
+
+ let zone = Zone.sub ~zone:screen ~x:1 ~y:10 ~width:(Zone.width screen - 2) ~height:(Zone.height screen - 15) in
+ let rec loop y = function
+ | [] ->
+ ()
+ | line :: rest ->
+ if y < 0 then
+ ()
+ else begin
+ Draw.text zone 0 y line;
+ loop (y - 1) rest
+ end
+ in
+ loop (Zone.height zone - 1) logs;
+
+ (* ===== Read-line ===== *)
+
+ points.(size.lines - 3).(0) <- { blank with char = "├" };
+ points.(size.lines - 3).(size.columns - 1) <- { blank with char = "┤" };
+ points.(size.lines - 5).(0) <- { blank with char = "├" };
+ points.(size.lines - 5).(size.columns - 1) <- { blank with char = "┤" };
+ for i = 1 to size.columns - 2 do
+ points.(size.lines - 5).(i) <- { blank with char = "─" };
+ points.(size.lines - 3).(i) <- { blank with char = "─" }
+ done;
+
+ let zone = Zone.sub ~zone:screen ~x:1 ~y:(size.lines - 4) ~width:(size.columns - 2) ~height:1 in
+ let cursor_position =
+ match engine_state.Engine.mode with
+ | Engine.Edition(before, after) ->
+ let len = Text.length before in
+ Draw.textc zone 0 0 [Text before; Text after];
+ len
+ | Engine.Selection state ->
+ let a = min state.Engine.sel_cursor state.Engine.sel_mark
+ and b = max state.Engine.sel_cursor state.Engine.sel_mark in
+ let part_before = Text.chunk (Text.pointer_l state.Engine.sel_text) a
+ and part_selected = Text.chunk a b
+ and part_after = Text.chunk (Text.pointer_r state.Engine.sel_text) b in
+ Draw.textc zone 0 0 [Text part_before; Underlined; Text part_selected; Reset; Text part_after];
+ if state.Engine.sel_cursor < state.Engine.sel_mark then
+ Text.length part_before
+ else
+ Text.length part_before + Text.length part_selected
+ | Engine.Search state ->
+ let len = Text.length state.Engine.search_word in
+ Draw.text zone 0 0 (Printf.sprintf "(reverse-i-search)'%s'" state.Engine.search_word);
+ begin match state.Engine.search_history with
+ | [] ->
+ 20 + len
+ | phrase :: _ ->
+ let ptr_start = match Text.find phrase state.Engine.search_word with
+ | Some ptr ->
+ ptr
+ | None ->
+ assert false
+ in
+ let ptr_end = Text.move len ptr_start in
+ let before = Text.chunk (Text.pointer_l phrase) ptr_start
+ and selected = Text.chunk ptr_start ptr_end
+ and after = Text.chunk ptr_end (Text.pointer_r phrase) in
+ Draw.textc zone (20 + len) 0 [
+ Text ": ";
+ Text before;
+ Underlined;
+ Text selected;
+ Reset;
+ Text after;
+ ];
+ 20 + len
+ end
+ in
+ Draw.map zone cursor_position 0 (fun point -> { point with style = { point.style with inverse = true } });
+
+ let zone = Zone.sub ~zone:screen ~x:1 ~y:(size.lines - 3) ~width:(size.columns - 2) ~height:3 in
+ begin
+ match box with
+ | Terminal.Box_none | Terminal.Box_empty ->
+ ()
+ | Terminal.Box_message msg ->
+ Draw.text zone 0 1 msg
+ | Terminal.Box_words(words, _) ->
+ ignore (TextSet.fold
+ (fun word i ->
+ let len = Text.length word in
+ Draw.text zone i 1 word;
+ let i = i + len in
+ Draw.text zone i 0 "┬";
+ Draw.text zone i 1 "│";
+ Draw.text zone i 2 "┴";
+ i + 1)
+ words 0)
+ end;
+
+ Lwt_term.render (Zone.points screen)
+ end else
+ return ()
+ end
+
+(* +-----------------------------------------------------------------+
+ | Read-line |
+ +-----------------------------------------------------------------+ *)
+
+let engine_state, set_engine_state = React.S.create (Engine.init [])
+let box, set_box = React.S.create Terminal.Box_empty
+
+let () =
+ Lwt_signal.always_notify
+ (function
+ | Engine.Edition(before, after) ->
+ let comp = Script.complete before after in
+ set_box (Terminal.Box_words(comp.comp_words, 0))
+ | Engine.Selection _ ->
+ set_box (Terminal.Box_message "<selection>")
+ | Engine.Search _ ->
+ set_box (Terminal.Box_message "<backward search>"))
+ (React.S.map (fun state -> state.Engine.mode) engine_state)
+
+let logs, set_logs = React.S.create []
+
+let rec loop krobot history =
+ lwt key = read_key () in
+ if key = key_escape then
+ return ()
+ else
+ match Command.of_key key with
+ | Command.Accept_line ->
+ let line = Text.strip (Engine.all_input (React.S.value engine_state)) in
+ if line = "exit" then
+ return ()
+ else begin
+ let history = Lwt_read_line.add_entry line history in
+ set_engine_state (Engine.init history);
+ set_logs (line :: React.S.value logs);
+ ignore (Script.exec krobot line);
+ loop krobot history
+ end
+ | Command.Complete ->
+ let engine_state = Engine.reset (React.S.value engine_state) in
+ let before, after = Engine.edition_state engine_state in
+ let comp = Script.complete before after in
+ set_engine_state { engine_state with Engine.mode = Engine.Edition comp.comp_state };
+ loop krobot history
+ | command ->
+ set_engine_state (Engine.update (React.S.value engine_state) command ());
+ loop krobot history
+
+(* +-----------------------------------------------------------------+
+ | Entry point |
+ +-----------------------------------------------------------------+ *)
+
+lwt () =
+ lwt () = hide_cursor () in
+ try_lwt
+ lwt krobot = Krobot.create () in
+ let signal =
+ React.S.l4 draw
+ Lwt_term.size
+ (React.S.l5 (fun a b c d e -> (a, b, c, d, e))
+ (Krobot.compass krobot)
+ (Krobot.logic_sensors krobot)
+ (Krobot.range_finders krobot)
+ (Krobot.team krobot)
+ (Krobot.jack krobot))
+ (React.S.l3 (fun a b c -> (a, b, c))
+ engine_state
+ box
+ logs)
+ (React.S.l3 (fun a b c -> (a, b, c))
+ (Krobot.Card.state krobot `Interface)
+ (Krobot.Card.state krobot `Sensor)
+ (Krobot.Card.state krobot `Motor))
+ in
+ (* Make the compiler happy: *)
+ ignore signal;
+ Lwt_term.with_raw_mode (fun () -> loop krobot [])
+ finally
+ show_cursor ()
diff --git a/PC_Mainboard/clients/tools/monitor.ml b/PC_Mainboard/clients/tools/monitor.ml
deleted file mode 100644
index 7c6e0c3..0000000
--- a/PC_Mainboard/clients/tools/monitor.ml
+++ /dev/null
@@ -1,300 +0,0 @@
-(*
- * monitor.ml
- * ----------
- * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
- * Licence : BSD3
- *
- * This file is a part of [kro]bot.
- *)
-
-(* Prints status continuously *)
-
-open Lwt
-open Lwt_term
-open Lwt_read_line
-
-module TextSet = Set.Make(Text)
-
-(* +-----------------------------------------------------------------+
- | Drawing |
- +-----------------------------------------------------------------+ *)
-
-type section = {
- screen : point array array;
- x : int;
- y : int;
- w : int;
- h : int;
-}
-
-let get_point clip x y =
- if x >= 0 && x < clip.w && y >= 0 && y < clip.h then
- clip.screen.(clip.y + y).(clip.x + x)
- else
- blank
-
-let set_point clip x y point =
- if x >= 0 && x < clip.w && y >= 0 && y < clip.h then
- clip.screen.(clip.y + y).(clip.x + x) <- point
-
-let draw_text clip ?style x y txt =
- if y >= 0 && y < clip.h && x < clip.w then
- let rec loop x ptr = match Text.next ptr with
- | None ->
- ()
- | Some(ch, ptr) ->
- if x >= 0 && x < clip.w then begin
- match style with
- | Some style ->
- clip.screen.(clip.y + y).(clip.x + x) <- { char = ch; style = style }
- | None ->
- clip.screen.(clip.y + y).(clip.x + x) <- { blank with char = ch };
- end;
- loop (x + 1) ptr
- in
- loop x (Text.pointer_l txt)
-
-(* Prevent concurrent drawing: *)
-let drawer_mutex = Lwt_mutex.create ()
-
-(* Draw the whole screen *)
-let rec draw size (compass, logic_sensors, range_finders, team, jack) (engine_state, box, logs) (state_interface, state_sensor, state_motor) =
- Lwt_mutex.with_lock drawer_mutex begin fun () ->
- if Lwt_mutex.is_empty drawer_mutex then begin
- (* Redraw the screen only if there is no other thread waiting to
- do it *)
-
- let screen = Zone.make ~width:size.columns ~height:size.lines in
- let points = Zone.points screen in
-
- (* ===== Borders ===== *)
-
- for i = 1 to size.columns - 2 do
- points.(0).(i) <- { blank with char = "─" };
- points.(size.lines - 1).(i) <- { blank with char = "─" }
- done;
- for i = 1 to size.lines - 2 do
- points.(i).(0) <- { blank with char = "│" };
- points.(i).(size.columns - 1) <- { blank with char = "│" }
- done;
- points.(0).(0) <- { blank with char = "┌" };
- points.(size.lines - 1).(0) <- { blank with char = "└" };
- points.(size.lines - 1).(size.columns - 1) <- { blank with char = "┘" };
- points.(0).(size.columns - 1) <- { blank with char = "┐" };
-
- (* ===== Status ===== *)
-
- Draw.text screen 1 0 "─[ Range finders ]─┬─[ Logic Sensors ]─┬─[ Status ]─";
- points.(9).(0) <- { blank with char = "├" };
- points.(9).(size.columns - 1) <- { blank with char = "┤" };
- for i = 1 to size.columns - 2 do
- points.(9).(i) <- { blank with char = "─" }
- done;
- for i = 1 to 8 do
- points.(i).(20) <- { blank with char = "│" };
- points.(i).(40) <- { blank with char = "│" }
- done;
- Draw.text screen 1 9 "───────────────────┴───────────────────┴";
-
- let zone = Zone.inner screen in
- for i = 0 to Array.length range_finders - 1 do
- Draw.textf zone 0 i "%d : %d" i range_finders.(i)
- done;
- for i = 0 to Array.length logic_sensors / 2 - 1 do
- let j = i * 2 in
- Draw.textf zone 20 i "%02d : %s %02d : %s"
- (j + 0) (if logic_sensors.(j + 0) then "O" else ".")
- (j + 1) (if logic_sensors.(j + 1) then "O" else ".")
- done;
- let x = 40 in
- Draw.textf zone x 0 "team = %s" (match team with Krobot.Team_red -> "red" | Krobot.Team_green -> "green");
- Draw.textf zone x 1 "jack = %s" (if jack then "present" else "absent");
- Draw.textf zone x 2 "compass = %d" compass;
- let string_of_state = function
- | `Running -> "running"
- | `Opening -> "opening"
- | `Closed -> "closed"
- in
- Draw.textf zone x 3 "interface card is %s" (string_of_state state_interface);
- Draw.textf zone x 4 "sensor card is %s" (string_of_state state_sensor);
- Draw.textf zone x 5 "motor card is %s" (string_of_state state_motor);
-
- (* ===== History ===== *)
-
- let zone = Zone.sub ~zone:screen ~x:1 ~y:10 ~width:(Zone.width screen - 2) ~height:(Zone.height screen - 15) in
- let rec loop y = function
- | [] ->
- ()
- | line :: rest ->
- if y < 0 then
- ()
- else begin
- Draw.text zone 0 y line;
- loop (y - 1) rest
- end
- in
- loop (Zone.height zone - 1) logs;
-
- (* ===== Read-line ===== *)
-
- points.(size.lines - 3).(0) <- { blank with char = "├" };
- points.(size.lines - 3).(size.columns - 1) <- { blank with char = "┤" };
- points.(size.lines - 5).(0) <- { blank with char = "├" };
- points.(size.lines - 5).(size.columns - 1) <- { blank with char = "┤" };
- for i = 1 to size.columns - 2 do
- points.(size.lines - 5).(i) <- { blank with char = "─" };
- points.(size.lines - 3).(i) <- { blank with char = "─" }
- done;
-
- let zone = Zone.sub ~zone:screen ~x:1 ~y:(size.lines - 4) ~width:(size.columns - 2) ~height:1 in
- let cursor_position =
- match engine_state.Engine.mode with
- | Engine.Edition(before, after) ->
- let len = Text.length before in
- Draw.textc zone 0 0 [Text before; Text after];
- len
- | Engine.Selection state ->
- let a = min state.Engine.sel_cursor state.Engine.sel_mark
- and b = max state.Engine.sel_cursor state.Engine.sel_mark in
- let part_before = Text.chunk (Text.pointer_l state.Engine.sel_text) a
- and part_selected = Text.chunk a b
- and part_after = Text.chunk (Text.pointer_r state.Engine.sel_text) b in
- Draw.textc zone 0 0 [Text part_before; Underlined; Text part_selected; Reset; Text part_after];
- if state.Engine.sel_cursor < state.Engine.sel_mark then
- Text.length part_before
- else
- Text.length part_before + Text.length part_selected
- | Engine.Search state ->
- let len = Text.length state.Engine.search_word in
- Draw.text zone 0 0 (Printf.sprintf "(reverse-i-search)'%s'" state.Engine.search_word);
- begin match state.Engine.search_history with
- | [] ->
- 20 + len
- | phrase :: _ ->
- let ptr_start = match Text.find phrase state.Engine.search_word with
- | Some ptr ->
- ptr
- | None ->
- assert false
- in
- let ptr_end = Text.move len ptr_start in
- let before = Text.chunk (Text.pointer_l phrase) ptr_start
- and selected = Text.chunk ptr_start ptr_end
- and after = Text.chunk ptr_end (Text.pointer_r phrase) in
- Draw.textc zone (20 + len) 0 [
- Text ": ";
- Text before;
- Underlined;
- Text selected;
- Reset;
- Text after;
- ];
- 20 + len
- end
- in
- Draw.map zone cursor_position 0 (fun point -> { point with style = { point.style with inverse = true } });
-
- let zone = Zone.sub ~zone:screen ~x:1 ~y:(size.lines - 3) ~width:(size.columns - 2) ~height:3 in
- begin
- match box with
- | Terminal.Box_none | Terminal.Box_empty ->
- ()
- | Terminal.Box_message msg ->
- Draw.text zone 0 1 msg
- | Terminal.Box_words(words, _) ->
- ignore (TextSet.fold
- (fun word i ->
- let len = Text.length word in
- Draw.text zone i 1 word;
- let i = i + len in
- Draw.text zone i 0 "┬";
- Draw.text zone i 1 "│";
- Draw.text zone i 2 "┴";
- i + 1)
- words 0)
- end;
-
- Lwt_term.render (Zone.points screen)
- end else
- return ()
- end
-
-(* +-----------------------------------------------------------------+
- | Read-line |
- +-----------------------------------------------------------------+ *)
-
-let engine_state, set_engine_state = React.S.create (Engine.init [])
-let box, set_box = React.S.create Terminal.Box_empty
-
-let () =
- Lwt_signal.always_notify
- (function
- | Engine.Edition(before, after) ->
- let comp = Script.complete before after in
- set_box (Terminal.Box_words(comp.comp_words, 0))
- | Engine.Selection _ ->
- set_box (Terminal.Box_message "<selection>")
- | Engine.Search _ ->
- set_box (Terminal.Box_message "<backward search>"))
- (React.S.map (fun state -> state.Engine.mode) engine_state)
-
-let logs, set_logs = React.S.create []
-
-let rec loop krobot history =
- lwt key = read_key () in
- if key = key_escape then
- return ()
- else
- match Command.of_key key with
- | Command.Accept_line ->
- let line = Text.strip (Engine.all_input (React.S.value engine_state)) in
- if line = "exit" then
- return ()
- else begin
- let history = Lwt_read_line.add_entry line history in
- set_engine_state (Engine.init history);
- set_logs (line :: React.S.value logs);
- ignore (Script.exec krobot line);
- loop krobot history
- end
- | Command.Complete ->
- let engine_state = Engine.reset (React.S.value engine_state) in
- let before, after = Engine.edition_state engine_state in
- let comp = Script.complete before after in
- set_engine_state { engine_state with Engine.mode = Engine.Edition comp.comp_state };
- loop krobot history
- | command ->
- set_engine_state (Engine.update (React.S.value engine_state) command ());
- loop krobot history
-
-(* +-----------------------------------------------------------------+
- | Entry point |
- +-----------------------------------------------------------------+ *)
-
-lwt () =
- lwt () = hide_cursor () in
- try_lwt
- lwt krobot = Krobot.create () in
- let signal =
- React.S.l4 draw
- Lwt_term.size
- (React.S.l5 (fun a b c d e -> (a, b, c, d, e))
- (Krobot.compass krobot)
- (Krobot.logic_sensors krobot)
- (Krobot.range_finders krobot)
- (Krobot.team krobot)
- (Krobot.jack krobot))
- (React.S.l3 (fun a b c -> (a, b, c))
- engine_state
- box
- logs)
- (React.S.l3 (fun a b c -> (a, b, c))
- (Krobot.Card.state krobot `Interface)
- (Krobot.Card.state krobot `Sensor)
- (Krobot.Card.state krobot `Motor))
- in
- (* Make the compiler happy: *)
- ignore signal;
- Lwt_term.with_raw_mode (fun () -> loop krobot [])
- finally
- show_cursor ()
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index 17b5236..ff0f8c7 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -367,6 +367,12 @@ struct
type t = {
obus : OBus_object.t;
card : Card.t;
+
+ mutable acceleration : int option;
+ (* The current acceleration *)
+
+ mutable state : unit React.signal;
+ (* Reinit [acceleraation] to None when the card state changes *)
}
module OBus = OBus_object.Make(struct
@@ -401,28 +407,76 @@ struct
else
move Protocol.traj_forward dev.card dist speed acc
+ let obus_motor = OBus_type.mapping obus_int
+ [(Protocol.motor_left, -1);
+ (Protocol.motor_both, 0);
+ (Protocol.motor_right, 1)]
+
+ let obus_stop_mode = OBus_type.mapping obus_int
+ [(Protocol.traj_stop_motor_off, 0);
+ (Protocol.traj_stop_abrupt, 1);
+ (Protocol.traj_stop_smooth, 2)]
+
let stop_motors dev motor mode =
let data = String.create 4 in
RW.set_uint8 data 0 Protocol.traj_stop;
- RW.set_uint8 data 1 (match motor with
- | -1 -> Protocol.motor_left
- | 0 -> Protocol.motor_both
- | 1 -> Protocol.motor_right
- | n -> Printf.ksprintf failwith "invalid motor (%d)" n);
- RW.set_uint16 data 2 (match mode with
- | 0 -> Protocol.traj_stop_motor_off
- | 1 -> Protocol.traj_stop_abrupt
- | 2 -> Protocol.traj_stop_smooth
- | n -> Printf.ksprintf failwith "invalid stop mode (%d)" n);
+ RW.set_uint8 data 1 motor;
+ RW.set_uint16 data 2 mode;
Card.send_command dev.card Protocol.cmd_traj data
+ (* Values comming from lm629.h *)
+ let forward = 0
+ let backward = 4096
+
+ let traj_new_velocity card motor vel acc dir =
+ let data = String.create 8 in
+ RW.set_uint8 data 0 Protocol.traj_new_velocity;
+ RW.set_uint8 data 1 motor;
+ RW.set_int16 data 2 vel;
+ RW.set_int16 data 4 acc;
+ RW.set_int16 data 6 dir;
+ Card.send_command card Protocol.cmd_traj data
+
+ let traj_change_velocity card motor vel dir =
+ let data = String.create 6 in
+ RW.set_uint8 data 0 Protocol.traj_change_velocity;
+ RW.set_uint8 data 1 motor;
+ RW.set_int16 data 2 vel;
+ RW.set_int16 data 4 dir;
+ Card.send_command card Protocol.cmd_traj data
+
+ let traj_start card motor =
+ let data = String.create 2 in
+ RW.set_uint8 data 0 Protocol.traj_start;
+ RW.set_uint8 data 1 motor;
+ Card.send_command card Protocol.cmd_traj data
+
+ let set_speed dev motor speed acc =
+ let dir, speed = if speed < 0 then (backward, -speed) else (forward, speed) in
+ lwt () =
+ if Some acc <> dev.acceleration then begin
+ dev.acceleration <- Some acc;
+ traj_new_velocity dev.card motor speed acc dir
+ end else
+ traj_change_velocity dev.card motor speed dir
+ in
+ traj_start dev.card motor
+
OL_method Turn : int -> int -> int -> unit
OL_method Move : int -> int -> int -> unit
+ OL_method StopMotors : motor -> stop_mode -> unit
+ OL_method SetSpeed : motor -> int -> int -> unit
- let make card path = {
- obus = OBus_object.make path;
- card = card;
- }
+ let make card path =
+ let dev = {
+ obus = OBus_object.make path;
+ card = card;
+ acceleration = None;
+ state = React.S.const ();
+ }
+ in
+ dev.state <- React.S.map (fun state -> dev.acceleration <- None) (Card.state card);
+ dev
end
(* +-----------------------------------------------------------------+
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-03 07:24:09
|
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 817f11427cf4305cb7ee66ab1a248473c89e2992 (commit)
from 317345f5f4277633b9600b366d2150d59cfcdfca (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 817f11427cf4305cb7ee66ab1a248473c89e2992
Author: Jérémie Dimino <je...@di...>
Date: Wed Feb 3 08:23:27 2010 +0100
rewrite completion stuff for the monitor
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/_tags b/PC_Mainboard/clients/_tags
index f829506..a232f9b 100644
--- a/PC_Mainboard/clients/_tags
+++ b/PC_Mainboard/clients/_tags
@@ -1,7 +1,7 @@
# -*- conf -*-
# Syntax extensions
-<**/*.ml>: syntax_camlp4o, pkg_camlp4, pkg_lwt.syntax, pkg_lwt.syntax.log, pkg_text.pcre
+<**/*.ml>: syntax_camlp4o, pkg_camlp4, pkg_lwt.syntax, pkg_lwt.syntax.log
<lib-krobot/*.ml>: pkg_obus.syntax
# Needed by the rest of the source
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.ml b/PC_Mainboard/clients/lib-krobot/krobot.ml
index 020fc0f..05ef14d 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.ml
+++ b/PC_Mainboard/clients/lib-krobot/krobot.ml
@@ -190,9 +190,20 @@ include MakeDevice(struct let name = "Motors" end)
OP_method Turn : int -> int -> int -> unit
OP_method Move : int -> int -> int -> unit
+OP_method StopMotors : int -> int -> unit
let turn krobot ~angle ~speed ~acc = turn krobot angle speed acc
let move krobot ~dist ~speed ~acc = turn krobot dist speed acc
+let stop_motors krobot ~motor ~mode =
+ stop_motors krobot
+ (match motor with
+ | `Left -> -1
+ | `Both -> 0
+ | `Right -> 1)
+ (match mode with
+ | `Off -> 0
+ | `Abrupt -> 1
+ | `Smooth -> 2)
(* +-----------------------------------------------------------------+
| Cards |
diff --git a/PC_Mainboard/clients/lib-krobot/krobot.mli b/PC_Mainboard/clients/lib-krobot/krobot.mli
index 546751e..cf75746 100644
--- a/PC_Mainboard/clients/lib-krobot/krobot.mli
+++ b/PC_Mainboard/clients/lib-krobot/krobot.mli
@@ -71,6 +71,9 @@ val close_grip : t -> unit Lwt.t
val turn : t -> angle : int -> speed : int -> acc : int -> unit Lwt.t
val move : t -> dist : int -> speed : int -> acc : int -> unit Lwt.t
+val stop_motors : t -> motor : [ `Left | `Right | `Both ] -> mode : [ `Off | `Abrupt | `Smooth ] -> unit Lwt.t
+ (** [stop_motorw t motor mode] stop the given motor(s). *)
+
(** {6 Cards} *)
module Card : sig
diff --git a/PC_Mainboard/clients/tools/monitor.ml b/PC_Mainboard/clients/tools/monitor.ml
index 0cf506b..7c6e0c3 100644
--- a/PC_Mainboard/clients/tools/monitor.ml
+++ b/PC_Mainboard/clients/tools/monitor.ml
@@ -220,73 +220,17 @@ let rec draw size (compass, logic_sensors, range_finders, team, jack) (engine_st
end
(* +-----------------------------------------------------------------+
- | Actions |
- +-----------------------------------------------------------------+ *)
-
-let handle_action krobot line =
- match Text.words line with
- | [] ->
- return ()
- | action :: args ->
- let rec make_args acc = function
- | [] | [_] ->
- acc
- | key :: value :: rest ->
- make_args ((key, value) :: acc) rest
- in
- let args = make_args [] args in
- let arg key default = try int_of_string (List.assoc key args) with Not_found -> default in
- match action with
- | "forward" ->
- Krobot.move krobot ~dist:(arg "dist" 100) ~speed:(arg "speed" 400) ?acc:(arg "acc" 800)
- | "backward" ->
- Krobot.move krobot ~dist:(-(arg "dist" 100)) ~speed:(arg "speed" 400) ?acc:(arg "acc" 800)
- | "left" ->
- Krobot.turn krobot ~angle:(arg "dist" 100) ~speed:(arg "speed" 400) ?acc:(arg "acc" 800)
- | "right" ->
- Krobot.turn krobot ~angle:(-(arg "dist" 100)) ~speed:(arg "speed" 400) ?acc:(arg "acc" 800)
- | _ ->
- return ()
-
-(* +-----------------------------------------------------------------+
| Read-line |
+-----------------------------------------------------------------+ *)
let engine_state, set_engine_state = React.S.create (Engine.init [])
let box, set_box = React.S.create Terminal.Box_empty
-let set_of_list l = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty l
-
-let functions = set_of_list [
- "exit";
- "forward";
- "backward";
- "left";
- "right";
-]
-
-let argument = <:re< alpha+ blank* "=" blank* alnum+ >>
-
-let complete before after =
- match before with
- | <:re< (blank* as before) (alpha* as word) eos >> ->
- Lwt_read_line.complete ~suffix:" " before word after functions
- | <:re< (blank* (alpha+ as action) (blank+ argument)* blank+ as before) (alpha* as arg) eos >> ->
- Lwt_read_line.complete ~suffix:"=" before arg after
- (set_of_list
- (match action with
- | "forward" | "backward" -> ["dist"; "speed"; "acc"]
- | "right" | "left" -> ["angle"; "speed"; "acc"]
- | _ -> []))
- | _ ->
- { comp_state = (before, after);
- comp_words = TextSet.empty }
-
let () =
Lwt_signal.always_notify
(function
| Engine.Edition(before, after) ->
- let comp = complete before after in
+ let comp = Script.complete before after in
set_box (Terminal.Box_words(comp.comp_words, 0))
| Engine.Selection _ ->
set_box (Terminal.Box_message "<selection>")
@@ -310,13 +254,13 @@ let rec loop krobot history =
let history = Lwt_read_line.add_entry line history in
set_engine_state (Engine.init history);
set_logs (line :: React.S.value logs);
- ignore (handle_action krobot line);
+ ignore (Script.exec krobot line);
loop krobot history
end
| Command.Complete ->
let engine_state = Engine.reset (React.S.value engine_state) in
let before, after = Engine.edition_state engine_state in
- let comp = complete before after in
+ let comp = Script.complete before after in
set_engine_state { engine_state with Engine.mode = Engine.Edition comp.comp_state };
loop krobot history
| command ->
diff --git a/PC_Mainboard/clients/tools/script.ml b/PC_Mainboard/clients/tools/script.ml
new file mode 100644
index 0000000..1bb167a
--- /dev/null
+++ b/PC_Mainboard/clients/tools/script.ml
@@ -0,0 +1,125 @@
+(*
+ * script.ml
+ * ---------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+open Lwt
+
+module TextSet = Set.Make(Text)
+
+type argument =
+ | Arg_int
+ | Arg_string
+ | Arg_keyword of string list
+
+type command = {
+ name : string;
+ args : (string * argument) list;
+}
+
+let commands = [
+ { name = "exit";
+ args = [] };
+ { name = "forward";
+ args = [("dist", Arg_int); ("speed", Arg_int); ("acc", Arg_int)] };
+ { name = "backward";
+ args = [("dist", Arg_int); ("speed", Arg_int); ("acc", Arg_int)] };
+ { name = "left";
+ args = [("angle", Arg_int); ("speed", Arg_int); ("acc", Arg_int)] };
+ { name = "right";
+ args = [("angle", Arg_int); ("speed", Arg_int); ("acc", Arg_int)] };
+ { name = "stop-motors";
+ args = [("motor", Arg_keyword ["left"; "right"; "both"]);
+ ("mode", Arg_keyword ["off"; "abrupt"; "smooth"])] };
+]
+
+let set_of_list l = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty l
+
+let command_names =
+ List.fold_left (fun acc command -> TextSet.add command.name acc) TextSet.empty commands
+
+let rec args_of_command command = function
+ | { name = name; args = args } :: _ when name = command ->
+ Some args
+ | _ :: rest ->
+ args_of_command command rest
+ | [] ->
+ None
+
+let complete ~before ~after =
+ try
+ match Script_lexer.command (Lexing.from_string before) with
+ | `Command(before, name) ->
+ Lwt_read_line.complete ~suffix:" " before name after command_names
+ | `Arg(before, name, args, `Key key) -> begin
+ match args_of_command name commands with
+ | None ->
+ raise Exit
+ | Some args' ->
+ let args' = set_of_list (List.map fst args') in
+ (* Remove already passed arguments *)
+ let args = TextSet.diff args' args in
+ Lwt_read_line.complete ~suffix:"=" before key after args
+ end
+ | `Arg(before, name, args, `Value(key, value)) -> begin
+ match args_of_command name commands with
+ | None ->
+ raise Exit
+ | Some args' ->
+ try
+ match List.assoc key args' with
+ | Arg_keyword words ->
+ Lwt_read_line.complete ~suffix:" " before value after (set_of_list words)
+ | _ ->
+ raise Exit
+ with Not_found ->
+ raise Exit
+ end
+ | `Arg(before, name, args, `Nothing) ->
+ raise Exit
+ with Exit ->
+ { Lwt_read_line.comp_state = (before, after);
+ Lwt_read_line.comp_words = TextSet.empty }
+
+let exec krobot line =
+ match Text.words line with
+ | [] ->
+ return ()
+ | action :: args ->
+ let rec make_args acc = function
+ | [] | [_] ->
+ acc
+ | key :: value :: rest ->
+ make_args ((key, value) :: acc) rest
+ in
+ let args = make_args [] args in
+ let arg_int key default = try int_of_string (List.assoc key args) with Not_found -> default in
+ let arg_string key default = try List.assoc key args with Not_found -> default in
+ match action with
+ | "forward" ->
+ Krobot.move krobot ~dist:(arg_int "dist" 100) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
+ | "backward" ->
+ Krobot.move krobot ~dist:(-(arg_int "dist" 100)) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
+ | "left" ->
+ Krobot.turn krobot ~angle:(arg_int "dist" 100) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
+ | "right" ->
+ Krobot.turn krobot ~angle:(-(arg_int "dist" 100)) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)
+ | "stop-motors" ->
+ Krobot.stop_motors krobot
+ ~motor:(match arg_string "motor" "both" with
+ | "both" -> `Both
+ | "left" -> `Left
+ | "right" -> `Right
+ | _ -> failwith "Script.exec: invalid motor")
+ ~mode:(match arg_string "mode" "off" with
+ | "off" -> `Off
+ | "abrupt" -> `Abrupt
+ | "smooth" -> `Smooth
+ | _ -> failwith "Script.exec: invalid stop mode")
+ | _ ->
+ return ()
+
diff --git a/PC_Mainboard/clients/tools/script.mli b/PC_Mainboard/clients/tools/script.mli
new file mode 100644
index 0000000..69d7d98
--- /dev/null
+++ b/PC_Mainboard/clients/tools/script.mli
@@ -0,0 +1,31 @@
+(*
+ * script.mli
+ * ----------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+(** Minit script language for the monitor *)
+
+(** Type of arguments *)
+type argument =
+ | Arg_int
+ | Arg_string
+ | Arg_keyword of string list
+
+(** Type of a command description *)
+type command = {
+ name : string;
+ args : (string * argument) list;
+}
+
+val commands : command list
+ (** The list of all commands *)
+
+val complete : before : string -> after : string -> Lwt_read_line.completion_result
+ (** [complete ~before ~after] try to complete the given string *)
+
+val exec : Krobot.t -> string -> unit Lwt.t
+ (** [exec krobot str] parses [str] and execute it *)
diff --git a/PC_Mainboard/clients/tools/script_lexer.mll b/PC_Mainboard/clients/tools/script_lexer.mll
new file mode 100644
index 0000000..fea99ef
--- /dev/null
+++ b/PC_Mainboard/clients/tools/script_lexer.mll
@@ -0,0 +1,58 @@
+(*
+ * script_lexer.mll
+ * ----------------
+ * Copyright : (c) 2010, Jeremie Dimino <je...@di...>
+ * Licence : BSD3
+ *
+ * This file is a part of [kro]bot.
+ *)
+
+{
+ module TextSet = Set.Make(Text)
+}
+
+
+let lower = ['a'-'z']
+let upper = ['A'-'Z']
+let alpha = lower | upper
+let digit = ['0'-'9']
+let alnum = alpha | digit
+let punct = ['!' '"' '#' '$' '%' '&' '\'' '(' ')' '*' '+' ',' '-' '.' '/' ':' ';' '<' '=' '>' '?' '@' '[' '\\' ']' '^' '_' '`' '{' '|' '}' '~']
+let graph = alnum | punct
+let print = graph | ' '
+let blank = ' ' | '\t'
+let cntrl = ['\x00'-'\x1F' '\x7F']
+let xdigit = digit | ['a'-'f' 'A'-'F']
+let space = blank | ['\n' '\x0b' '\x0c' '\r']
+
+let identstart = [ 'A'-'Z' 'a'-'z' '_' ]
+let identbody = [ 'A'-'Z' 'a'-'z' '_' '-' '\'' '0' - '9' ]
+let ident = identstart identbody*
+let maybe_ident = "" | ident
+
+let value = (alpha | digit | "-")+
+
+rule command = parse
+ | blank* as before (maybe_ident as id) eof
+ { `Command(before, id) }
+ | blank* (ident as command) as s
+ { let buf = Buffer.create 42 in
+ Buffer.add_string buf s;
+ let args, last = arguments buf lexbuf in
+ `Arg(Buffer.contents buf, command, args, last) }
+ | ""
+ { raise Exit }
+
+and arguments buf = parse
+ | (blank+ as before) (maybe_ident as key) eof
+ { Buffer.add_string buf before;
+ (TextSet.empty, `Key key) }
+ | (blank+ (ident as key) blank* "=" blank* as before) ((value | "") as value) eof
+ { Buffer.add_string buf before;
+ (TextSet.empty, `Value(key, value)) }
+ | blank+ (ident as key) blank* "=" blank* value as s
+ { Buffer.add_string buf s;
+ let set, x = arguments buf lexbuf in
+ (TextSet.add key set, x) }
+ | ""
+ { (TextSet.empty, `Nothing) }
diff --git a/PC_Mainboard/driver/src/driver.ml b/PC_Mainboard/driver/src/driver.ml
index b3287cc..17b5236 100644
--- a/PC_Mainboard/driver/src/driver.ml
+++ b/PC_Mainboard/driver/src/driver.ml
@@ -401,6 +401,21 @@ struct
else
move Protocol.traj_forward dev.card dist speed acc
+ let stop_motors dev motor mode =
+ let data = String.create 4 in
+ RW.set_uint8 data 0 Protocol.traj_stop;
+ RW.set_uint8 data 1 (match motor with
+ | -1 -> Protocol.motor_left
+ | 0 -> Protocol.motor_both
+ | 1 -> Protocol.motor_right
+ | n -> Printf.ksprintf failwith "invalid motor (%d)" n);
+ RW.set_uint16 data 2 (match mode with
+ | 0 -> Protocol.traj_stop_motor_off
+ | 1 -> Protocol.traj_stop_abrupt
+ | 2 -> Protocol.traj_stop_smooth
+ | n -> Printf.ksprintf failwith "invalid stop mode (%d)" n);
+ Card.send_command dev.card Protocol.cmd_traj data
+
OL_method Turn : int -> int -> int -> unit
OL_method Move : int -> int -> int -> unit
@@ -468,12 +483,12 @@ struct
OL_method GetFirmwareBuild : string = fun card ->
let data = Card.make_buffer () in
RW.set_uint8 data 0 Protocol.get_firmware_build;
- Card.send_request card Protocol.cmd_get data >|= string_of_azt
+ Card.send_request card.card Protocol.cmd_get data >|= string_of_azt
OL_method GetBoardInfo : string = fun card ->
let data = Card.make_buffer () in
RW.set_uint8 data 0 Protocol.get_board_info;
- Card.send_request card Protocol.cmd_get data >|= string_of_azt
+ Card.send_request card.card Protocol.cmd_get data >|= string_of_azt
OL_method GetState : Card.state = fun card ->
return (React.S.value (Card.state card.card))
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-02 14:52:29
|
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 317345f5f4277633b9600b366d2150d59cfcdfca (commit)
from 8370857c4bdbf0534e57609729a5b5ebcbceff17 (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 317345f5f4277633b9600b366d2150d59cfcdfca
Author: Jérémie Dimino <je...@di...>
Date: Tue Feb 2 15:51:57 2010 +0100
implement controls in the monitor
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/tools/monitor.ml b/PC_Mainboard/clients/tools/monitor.ml
index 01796f0..0cf506b 100644
--- a/PC_Mainboard/clients/tools/monitor.ml
+++ b/PC_Mainboard/clients/tools/monitor.ml
@@ -58,7 +58,7 @@ let draw_text clip ?style x y txt =
let drawer_mutex = Lwt_mutex.create ()
(* Draw the whole screen *)
-let rec draw size (compass, logic_sensors, range_finders, team, jack) (engine_state, box) (state_interface, state_sensor, state_motor) =
+let rec draw size (compass, logic_sensors, range_finders, team, jack) (engine_state, box, logs) (state_interface, state_sensor, state_motor) =
Lwt_mutex.with_lock drawer_mutex begin fun () ->
if Lwt_mutex.is_empty drawer_mutex then begin
(* Redraw the screen only if there is no other thread waiting to
@@ -119,6 +119,22 @@ let rec draw size (compass, logic_sensors, range_finders, team, jack) (engine_st
Draw.textf zone x 4 "sensor card is %s" (string_of_state state_sensor);
Draw.textf zone x 5 "motor card is %s" (string_of_state state_motor);
+ (* ===== History ===== *)
+
+ let zone = Zone.sub ~zone:screen ~x:1 ~y:10 ~width:(Zone.width screen - 2) ~height:(Zone.height screen - 15) in
+ let rec loop y = function
+ | [] ->
+ ()
+ | line :: rest ->
+ if y < 0 then
+ ()
+ else begin
+ Draw.text zone 0 y line;
+ loop (y - 1) rest
+ end
+ in
+ loop (Zone.height zone - 1) logs;
+
(* ===== Read-line ===== *)
points.(size.lines - 3).(0) <- { blank with char = "├" };
@@ -204,13 +220,44 @@ let rec draw size (compass, logic_sensors, range_finders, team, jack) (engine_st
end
(* +-----------------------------------------------------------------+
+ | Actions |
+ +-----------------------------------------------------------------+ *)
+
+let handle_action krobot line =
+ match Text.words line with
+ | [] ->
+ return ()
+ | action :: args ->
+ let rec make_args acc = function
+ | [] | [_] ->
+ acc
+ | key :: value :: rest ->
+ make_args ((key, value) :: acc) rest
+ in
+ let args = make_args [] args in
+ let arg key default = try int_of_string (List.assoc key args) with Not_found -> default in
+ match action with
+ | "forward" ->
+ Krobot.move krobot ~dist:(arg "dist" 100) ~speed:(arg "speed" 400) ?acc:(arg "acc" 800)
+ | "backward" ->
+ Krobot.move krobot ~dist:(-(arg "dist" 100)) ~speed:(arg "speed" 400) ?acc:(arg "acc" 800)
+ | "left" ->
+ Krobot.turn krobot ~angle:(arg "dist" 100) ~speed:(arg "speed" 400) ?acc:(arg "acc" 800)
+ | "right" ->
+ Krobot.turn krobot ~angle:(-(arg "dist" 100)) ~speed:(arg "speed" 400) ?acc:(arg "acc" 800)
+ | _ ->
+ return ()
+
+(* +-----------------------------------------------------------------+
| Read-line |
+-----------------------------------------------------------------+ *)
let engine_state, set_engine_state = React.S.create (Engine.init [])
let box, set_box = React.S.create Terminal.Box_empty
-let functions = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty [
+let set_of_list l = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty l
+
+let functions = set_of_list [
"exit";
"forward";
"backward";
@@ -218,10 +265,19 @@ let functions = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty [
"right";
]
+let argument = <:re< alpha+ blank* "=" blank* alnum+ >>
+
let complete before after =
match before with
- | <:re< (space* as before) (["a" - "z"]* as word) eos >> ->
- Lwt_read_line.complete before word after functions
+ | <:re< (blank* as before) (alpha* as word) eos >> ->
+ Lwt_read_line.complete ~suffix:" " before word after functions
+ | <:re< (blank* (alpha+ as action) (blank+ argument)* blank+ as before) (alpha* as arg) eos >> ->
+ Lwt_read_line.complete ~suffix:"=" before arg after
+ (set_of_list
+ (match action with
+ | "forward" | "backward" -> ["dist"; "speed"; "acc"]
+ | "right" | "left" -> ["angle"; "speed"; "acc"]
+ | _ -> []))
| _ ->
{ comp_state = (before, after);
comp_words = TextSet.empty }
@@ -238,7 +294,9 @@ let () =
set_box (Terminal.Box_message "<backward search>"))
(React.S.map (fun state -> state.Engine.mode) engine_state)
-let rec loop history =
+let logs, set_logs = React.S.create []
+
+let rec loop krobot history =
lwt key = read_key () in
if key = key_escape then
return ()
@@ -251,17 +309,19 @@ let rec loop history =
else begin
let history = Lwt_read_line.add_entry line history in
set_engine_state (Engine.init history);
- loop history
+ set_logs (line :: React.S.value logs);
+ ignore (handle_action krobot line);
+ loop krobot history
end
| Command.Complete ->
let engine_state = Engine.reset (React.S.value engine_state) in
let before, after = Engine.edition_state engine_state in
let comp = complete before after in
set_engine_state { engine_state with Engine.mode = Engine.Edition comp.comp_state };
- loop history
+ loop krobot history
| command ->
set_engine_state (Engine.update (React.S.value engine_state) command ());
- loop history
+ loop krobot history
(* +-----------------------------------------------------------------+
| Entry point |
@@ -280,9 +340,10 @@ lwt () =
(Krobot.range_finders krobot)
(Krobot.team krobot)
(Krobot.jack krobot))
- (React.S.l2 (fun a b -> (a, b))
+ (React.S.l3 (fun a b c -> (a, b, c))
engine_state
- box)
+ box
+ logs)
(React.S.l3 (fun a b c -> (a, b, c))
(Krobot.Card.state krobot `Interface)
(Krobot.Card.state krobot `Sensor)
@@ -290,6 +351,6 @@ lwt () =
in
(* Make the compiler happy: *)
ignore signal;
- Lwt_term.with_raw_mode (fun () -> loop [])
+ Lwt_term.with_raw_mode (fun () -> loop krobot [])
finally
show_cursor ()
hooks/post-receive
--
krobot
|
|
From: Jérémie D. <Ba...@us...> - 2010-02-01 21:11:18
|
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 8370857c4bdbf0534e57609729a5b5ebcbceff17 (commit)
from e007ef2fec366cfa70104c5d23dd9f53fa4b3947 (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 8370857c4bdbf0534e57609729a5b5ebcbceff17
Author: Jérémie Dimino <je...@di...>
Date: Mon Feb 1 22:10:30 2010 +0100
better monitor
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/_tags b/PC_Mainboard/clients/_tags
index ada7748..f829506 100644
--- a/PC_Mainboard/clients/_tags
+++ b/PC_Mainboard/clients/_tags
@@ -1,7 +1,7 @@
# -*- conf -*-
# Syntax extensions
-<**/*.ml>: syntax_camlp4o, pkg_camlp4, pkg_lwt.syntax, pkg_lwt.syntax.log
+<**/*.ml>: syntax_camlp4o, pkg_camlp4, pkg_lwt.syntax, pkg_lwt.syntax.log, pkg_text.pcre
<lib-krobot/*.ml>: pkg_obus.syntax
# Needed by the rest of the source
@@ -9,4 +9,4 @@
# lib-krobot uses obus
<**/*>: pkg_obus
-<tools/*>: pkg_lwt.text
+<tools/*>: pkg_lwt.text, pkg_text.pcre
diff --git a/PC_Mainboard/clients/myocamlbuild.ml b/PC_Mainboard/clients/myocamlbuild.ml
index 863a811..9e3cd7c 100644
--- a/PC_Mainboard/clients/myocamlbuild.ml
+++ b/PC_Mainboard/clients/myocamlbuild.ml
@@ -29,6 +29,8 @@ let packages = [
"lwt.syntax";
"lwt.syntax.log";
"lwt.text";
+ "text";
+ "text.pcre";
"str";
"xmlm";
"react";
diff --git a/PC_Mainboard/clients/tools/monitor.ml b/PC_Mainboard/clients/tools/monitor.ml
index c62812d..01796f0 100644
--- a/PC_Mainboard/clients/tools/monitor.ml
+++ b/PC_Mainboard/clients/tools/monitor.ml
@@ -11,76 +11,285 @@
open Lwt
open Lwt_term
+open Lwt_read_line
-let draw_text screen line column txt =
- if line >= 0 && line < Array.length screen then
- let rec loop column ptr = match Text.next ptr with
+module TextSet = Set.Make(Text)
+
+(* +-----------------------------------------------------------------+
+ | Drawing |
+ +-----------------------------------------------------------------+ *)
+
+type section = {
+ screen : point array array;
+ x : int;
+ y : int;
+ w : int;
+ h : int;
+}
+
+let get_point clip x y =
+ if x >= 0 && x < clip.w && y >= 0 && y < clip.h then
+ clip.screen.(clip.y + y).(clip.x + x)
+ else
+ blank
+
+let set_point clip x y point =
+ if x >= 0 && x < clip.w && y >= 0 && y < clip.h then
+ clip.screen.(clip.y + y).(clip.x + x) <- point
+
+let draw_text clip ?style x y txt =
+ if y >= 0 && y < clip.h && x < clip.w then
+ let rec loop x ptr = match Text.next ptr with
| None ->
()
| Some(ch, ptr) ->
- if column >= 0 && column < Array.length screen.(line) then
- screen.(line).(column) <- { blank with char = ch };
- loop (column + 1) ptr
+ if x >= 0 && x < clip.w then begin
+ match style with
+ | Some style ->
+ clip.screen.(clip.y + y).(clip.x + x) <- { char = ch; style = style }
+ | None ->
+ clip.screen.(clip.y + y).(clip.x + x) <- { blank with char = ch };
+ end;
+ loop (x + 1) ptr
in
- loop column (Text.pointer_l txt)
+ loop x (Text.pointer_l txt)
(* Prevent concurrent drawing: *)
let drawer_mutex = Lwt_mutex.create ()
(* Draw the whole screen *)
-let rec draw size compass logic_sensors range_finders team jack =
+let rec draw size (compass, logic_sensors, range_finders, team, jack) (engine_state, box) (state_interface, state_sensor, state_motor) =
Lwt_mutex.with_lock drawer_mutex begin fun () ->
if Lwt_mutex.is_empty drawer_mutex then begin
(* Redraw the screen only if there is no other thread waiting to
do it *)
- let screen = Array.make_matrix size.lines size.columns blank in
- draw_text screen 1 1 ("team = " ^ match team with Krobot.Team_red -> "red" | Krobot.Team_green -> "green");
- draw_text screen 2 1 ("jack = " ^ if jack then "present" else "absent");
- draw_text screen 3 1 ("compass = " ^ string_of_int compass);
- draw_text screen 4 1 ("logic_sensors = " ^ String.concat "" (List.map (function true -> "O" | false -> ".") (Array.to_list logic_sensors)));
- for i = 0 to Array.length range_finders - 1 do
- draw_text screen (5 + i) 1 (Printf.sprintf "range_finders[%d] = %d" i range_finders.(i))
- done;
+
+ let screen = Zone.make ~width:size.columns ~height:size.lines in
+ let points = Zone.points screen in
+
+ (* ===== Borders ===== *)
+
for i = 1 to size.columns - 2 do
- screen.(0).(i) <- { blank with char = "─" };
- screen.(size.lines - 1).(i) <- { blank with char = "─" }
+ points.(0).(i) <- { blank with char = "─" };
+ points.(size.lines - 1).(i) <- { blank with char = "─" }
done;
for i = 1 to size.lines - 2 do
- screen.(i).(0) <- { blank with char = "│" };
- screen.(i).(size.columns - 1) <- { blank with char = "│" }
+ points.(i).(0) <- { blank with char = "│" };
+ points.(i).(size.columns - 1) <- { blank with char = "│" }
+ done;
+ points.(0).(0) <- { blank with char = "┌" };
+ points.(size.lines - 1).(0) <- { blank with char = "└" };
+ points.(size.lines - 1).(size.columns - 1) <- { blank with char = "┘" };
+ points.(0).(size.columns - 1) <- { blank with char = "┐" };
+
+ (* ===== Status ===== *)
+
+ Draw.text screen 1 0 "─[ Range finders ]─┬─[ Logic Sensors ]─┬─[ Status ]─";
+ points.(9).(0) <- { blank with char = "├" };
+ points.(9).(size.columns - 1) <- { blank with char = "┤" };
+ for i = 1 to size.columns - 2 do
+ points.(9).(i) <- { blank with char = "─" }
+ done;
+ for i = 1 to 8 do
+ points.(i).(20) <- { blank with char = "│" };
+ points.(i).(40) <- { blank with char = "│" }
+ done;
+ Draw.text screen 1 9 "───────────────────┴───────────────────┴";
+
+ let zone = Zone.inner screen in
+ for i = 0 to Array.length range_finders - 1 do
+ Draw.textf zone 0 i "%d : %d" i range_finders.(i)
+ done;
+ for i = 0 to Array.length logic_sensors / 2 - 1 do
+ let j = i * 2 in
+ Draw.textf zone 20 i "%02d : %s %02d : %s"
+ (j + 0) (if logic_sensors.(j + 0) then "O" else ".")
+ (j + 1) (if logic_sensors.(j + 1) then "O" else ".")
+ done;
+ let x = 40 in
+ Draw.textf zone x 0 "team = %s" (match team with Krobot.Team_red -> "red" | Krobot.Team_green -> "green");
+ Draw.textf zone x 1 "jack = %s" (if jack then "present" else "absent");
+ Draw.textf zone x 2 "compass = %d" compass;
+ let string_of_state = function
+ | `Running -> "running"
+ | `Opening -> "opening"
+ | `Closed -> "closed"
+ in
+ Draw.textf zone x 3 "interface card is %s" (string_of_state state_interface);
+ Draw.textf zone x 4 "sensor card is %s" (string_of_state state_sensor);
+ Draw.textf zone x 5 "motor card is %s" (string_of_state state_motor);
+
+ (* ===== Read-line ===== *)
+
+ points.(size.lines - 3).(0) <- { blank with char = "├" };
+ points.(size.lines - 3).(size.columns - 1) <- { blank with char = "┤" };
+ points.(size.lines - 5).(0) <- { blank with char = "├" };
+ points.(size.lines - 5).(size.columns - 1) <- { blank with char = "┤" };
+ for i = 1 to size.columns - 2 do
+ points.(size.lines - 5).(i) <- { blank with char = "─" };
+ points.(size.lines - 3).(i) <- { blank with char = "─" }
done;
- screen.(0).(0) <- { blank with char = "┌" };
- screen.(size.lines - 1).(0) <- { blank with char = "└" };
- screen.(size.lines - 1).(size.columns - 1) <- { blank with char = "┘" };
- screen.(0).(size.columns - 1) <- { blank with char = "┐" };
- Lwt_term.render screen
+
+ let zone = Zone.sub ~zone:screen ~x:1 ~y:(size.lines - 4) ~width:(size.columns - 2) ~height:1 in
+ let cursor_position =
+ match engine_state.Engine.mode with
+ | Engine.Edition(before, after) ->
+ let len = Text.length before in
+ Draw.textc zone 0 0 [Text before; Text after];
+ len
+ | Engine.Selection state ->
+ let a = min state.Engine.sel_cursor state.Engine.sel_mark
+ and b = max state.Engine.sel_cursor state.Engine.sel_mark in
+ let part_before = Text.chunk (Text.pointer_l state.Engine.sel_text) a
+ and part_selected = Text.chunk a b
+ and part_after = Text.chunk (Text.pointer_r state.Engine.sel_text) b in
+ Draw.textc zone 0 0 [Text part_before; Underlined; Text part_selected; Reset; Text part_after];
+ if state.Engine.sel_cursor < state.Engine.sel_mark then
+ Text.length part_before
+ else
+ Text.length part_before + Text.length part_selected
+ | Engine.Search state ->
+ let len = Text.length state.Engine.search_word in
+ Draw.text zone 0 0 (Printf.sprintf "(reverse-i-search)'%s'" state.Engine.search_word);
+ begin match state.Engine.search_history with
+ | [] ->
+ 20 + len
+ | phrase :: _ ->
+ let ptr_start = match Text.find phrase state.Engine.search_word with
+ | Some ptr ->
+ ptr
+ | None ->
+ assert false
+ in
+ let ptr_end = Text.move len ptr_start in
+ let before = Text.chunk (Text.pointer_l phrase) ptr_start
+ and selected = Text.chunk ptr_start ptr_end
+ and after = Text.chunk ptr_end (Text.pointer_r phrase) in
+ Draw.textc zone (20 + len) 0 [
+ Text ": ";
+ Text before;
+ Underlined;
+ Text selected;
+ Reset;
+ Text after;
+ ];
+ 20 + len
+ end
+ in
+ Draw.map zone cursor_position 0 (fun point -> { point with style = { point.style with inverse = true } });
+
+ let zone = Zone.sub ~zone:screen ~x:1 ~y:(size.lines - 3) ~width:(size.columns - 2) ~height:3 in
+ begin
+ match box with
+ | Terminal.Box_none | Terminal.Box_empty ->
+ ()
+ | Terminal.Box_message msg ->
+ Draw.text zone 0 1 msg
+ | Terminal.Box_words(words, _) ->
+ ignore (TextSet.fold
+ (fun word i ->
+ let len = Text.length word in
+ Draw.text zone i 1 word;
+ let i = i + len in
+ Draw.text zone i 0 "┬";
+ Draw.text zone i 1 "│";
+ Draw.text zone i 2 "┴";
+ i + 1)
+ words 0)
+ end;
+
+ Lwt_term.render (Zone.points screen)
end else
return ()
end
-(* Loop until an exit key is pressed *)
-let rec loop_key () =
- Lwt_term.read_key () >>= function
- | Lwt_term.Key "q" | Lwt_term.Key_control ('c' | '[') ->
- return ()
+(* +-----------------------------------------------------------------+
+ | Read-line |
+ +-----------------------------------------------------------------+ *)
+
+let engine_state, set_engine_state = React.S.create (Engine.init [])
+let box, set_box = React.S.create Terminal.Box_empty
+
+let functions = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty [
+ "exit";
+ "forward";
+ "backward";
+ "left";
+ "right";
+]
+
+let complete before after =
+ match before with
+ | <:re< (space* as before) (["a" - "z"]* as word) eos >> ->
+ Lwt_read_line.complete before word after functions
| _ ->
- loop_key ()
+ { comp_state = (before, after);
+ comp_words = TextSet.empty }
+
+let () =
+ Lwt_signal.always_notify
+ (function
+ | Engine.Edition(before, after) ->
+ let comp = complete before after in
+ set_box (Terminal.Box_words(comp.comp_words, 0))
+ | Engine.Selection _ ->
+ set_box (Terminal.Box_message "<selection>")
+ | Engine.Search _ ->
+ set_box (Terminal.Box_message "<backward search>"))
+ (React.S.map (fun state -> state.Engine.mode) engine_state)
+
+let rec loop history =
+ lwt key = read_key () in
+ if key = key_escape then
+ return ()
+ else
+ match Command.of_key key with
+ | Command.Accept_line ->
+ let line = Text.strip (Engine.all_input (React.S.value engine_state)) in
+ if line = "exit" then
+ return ()
+ else begin
+ let history = Lwt_read_line.add_entry line history in
+ set_engine_state (Engine.init history);
+ loop history
+ end
+ | Command.Complete ->
+ let engine_state = Engine.reset (React.S.value engine_state) in
+ let before, after = Engine.edition_state engine_state in
+ let comp = complete before after in
+ set_engine_state { engine_state with Engine.mode = Engine.Edition comp.comp_state };
+ loop history
+ | command ->
+ set_engine_state (Engine.update (React.S.value engine_state) command ());
+ loop history
+
+(* +-----------------------------------------------------------------+
+ | Entry point |
+ +-----------------------------------------------------------------+ *)
lwt () =
lwt () = hide_cursor () in
try_lwt
lwt krobot = Krobot.create () in
let signal =
- React.S.l6 draw
+ React.S.l4 draw
Lwt_term.size
- (Krobot.compass krobot)
- (Krobot.logic_sensors krobot)
- (Krobot.range_finders krobot)
- (Krobot.team krobot)
- (Krobot.jack krobot)
+ (React.S.l5 (fun a b c d e -> (a, b, c, d, e))
+ (Krobot.compass krobot)
+ (Krobot.logic_sensors krobot)
+ (Krobot.range_finders krobot)
+ (Krobot.team krobot)
+ (Krobot.jack krobot))
+ (React.S.l2 (fun a b -> (a, b))
+ engine_state
+ box)
+ (React.S.l3 (fun a b c -> (a, b, c))
+ (Krobot.Card.state krobot `Interface)
+ (Krobot.Card.state krobot `Sensor)
+ (Krobot.Card.state krobot `Motor))
in
(* Make the compiler happy: *)
ignore signal;
- Lwt_term.with_raw_mode loop_key
+ Lwt_term.with_raw_mode (fun () -> loop [])
finally
show_cursor ()
hooks/post-receive
--
krobot
|