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-23 17:36:24
|
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 f3530f39db8f3f91c4e699cdb2b62dc4deecbd23 (commit) from b8f7544dccaa2e3b7fae129e3aab7753be831561 (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 f3530f39db8f3f91c4e699cdb2b62dc4deecbd23 Author: Jérémie Dimino <je...@di...> Date: Tue Feb 23 18:35:49 2010 +0100 [joy_control] cancel the previous thread when changing speed ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/joy_control.ml b/PC_Mainboard/clients/joy_control.ml index ac6b39a..f0dcd05 100644 --- a/PC_Mainboard/clients/joy_control.ml +++ b/PC_Mainboard/clients/joy_control.ml @@ -159,6 +159,7 @@ let parent_loop krobot pipe = and laxis_h = ref 0 and laxis_v = ref 0 in let set_velocities () = + cancel !thread; if not !stop then thread := set_velocities krobot hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-23 17:32: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 b8f7544dccaa2e3b7fae129e3aab7753be831561 (commit) via 04715e243dcdaeee3de34246586171c3b4c9883a (commit) from 819b0a90fd152d2390eea791f5a3ab115b2629a3 (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 b8f7544dccaa2e3b7fae129e3aab7753be831561 Author: Olivier BICHLER <oli...@en...> Date: Tue Feb 23 18:28:38 2010 +0100 [driver] fix directions for the right motor commit 04715e243dcdaeee3de34246586171c3b4c9883a Author: Olivier BICHLER <oli...@en...> Date: Tue Feb 23 18:20:48 2010 +0100 use Char.unsafe_chr in RW ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/driver/RW.ml b/PC_Mainboard/driver/RW.ml index 4406039..c43640f 100644 --- a/PC_Mainboard/driver/RW.ml +++ b/PC_Mainboard/driver/RW.ml @@ -21,11 +21,11 @@ let reader buffer = { buffer = buffer; offset = 0 } let get_uint8 pointer = let offset = pointer.offset in pointer.offset <- offset + 1; - int_of_char pointer.buffer.[offset] + Char.code pointer.buffer.[offset] let put_uint8 pointer value = let offset = pointer.offset in pointer.offset <- offset + 1; - pointer.buffer.[offset] <- char_of_int value + pointer.buffer.[offset] <- Char.unsafe_chr value let get_sint8 = get_uint8 let put_sint8 = put_uint8 diff --git a/PC_Mainboard/driver/driver.ml b/PC_Mainboard/driver/driver.ml index f213256..7a678d6 100644 --- a/PC_Mainboard/driver/driver.ml +++ b/PC_Mainboard/driver/driver.ml @@ -367,7 +367,7 @@ struct let _set_velocities dev (settings_l, settings_r) (velocity_l, velocity_r) (acceleration_l, acceleration_r) duration = let direction_l, velocity_l = if velocity_l < 0 then (`Backward, -velocity_l) else (`Forward, velocity_l) in - let direction_r, velocity_r = if velocity_r < 0 then (`Backward, -velocity_r) else (`Forward, velocity_r) in + let direction_r, velocity_r = if velocity_r < 0 then (`Forward, -velocity_r) else (`Backward, velocity_r) in let date = Unix.gettimeofday () in if ((direction_l = `Forward || direction_r = `Backward) && date < dev.inhibit_forward_until) || ((direction_l = `Backward || direction_r = `Backward) && date < dev.inhibit_backward_until) then hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-23 15:40:37
|
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 819b0a90fd152d2390eea791f5a3ab115b2629a3 (commit) from c6ca4d9dab2c4646c8d8e0b5bb9670fb30a3b8af (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 819b0a90fd152d2390eea791f5a3ab115b2629a3 Author: Jérémie Dimino <je...@di...> Date: Tue Feb 23 16:40:07 2010 +0100 [controller] automatic generation of result printer ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/_tags b/PC_Mainboard/_tags index 818fd97..a2972ff 100644 --- a/PC_Mainboard/_tags +++ b/PC_Mainboard/_tags @@ -25,8 +25,7 @@ <clients/**>: pkg_lwt.unix, pkg_obus <clients/joy_control.*>: pkg_sdl <clients/controller.*>: pkg_lwt.text -<clients/script_lexer.*>: pkg_text -<clients/script.*>: pkg_text +<clients/script*>: pkg_text # +------------------------------------------------------------------+ # | Services | diff --git a/PC_Mainboard/generators/gen_script_commands.ml b/PC_Mainboard/generators/gen_script_commands.ml index 42e21a4..9f9298f 100644 --- a/PC_Mainboard/generators/gen_script_commands.ml +++ b/PC_Mainboard/generators/gen_script_commands.ml @@ -10,7 +10,7 @@ open Printf open Interface -let print_common path caml_path name args = +let print_common path caml_path name args repl = printf " register ~path:[%s] \"%s\" (f%d" path name (List.fold_left (fun n arg -> match arg with @@ -33,28 +33,52 @@ let print_common path caml_path name args = | Cst _ -> ()) args; printf " ->\n"; - printf " lwt _ = Krobot_unsafe.%s%s krobot" caml_path (Name.lid name); + printf " lwt (%s) = Krobot_unsafe.%s%s krobot" + (String.concat ", " (List.map (fun (name, typ) -> Name.lid name) repl)) + caml_path (Name.lid name); List.iter (function | Arg(name, typ) -> printf " %s" (Name.lid name) | Cst _ -> ()) args; printf " in\n"; - printf " Lwt.return ());\n" + List.iter + (fun (name', typ) -> + printf " lwt () = logger [Lwt_term.Text \"%s -> %s = \"; Lwt_term.Text %s] in\n" name (Name.lid name') (typ.print (Name.lid name'))) + repl; + printf " Lwt.return ());\n" let rec print path caml_path = function | Request req -> print_common path caml_path req.req_name req.req_args + (List.map + (function + | Arg(name, typ) -> (name, typ) + | Cst _ -> failwith "constants not allow in replies") + req.req_repl) | Command cmd -> - print_common path caml_path cmd.cmd_name cmd.cmd_args + print_common path caml_path cmd.cmd_name cmd.cmd_args [] | Enum enum -> printf " let __type_%s name = keyword name [" (Name.lid enum.enum_name); List.iter (fun (name, code) -> printf "(\"%s\", `%s);" name (Name.uid name)) enum.enum_keys; - printf "] in\n" - | Record _ -> - () + printf "] in\n"; + printf " let print_%s = function\n" (Name.lid enum.enum_name); + List.iter (fun (name, code) -> + printf " | `%s -> \"%s\"\n" (Name.uid name) name) + enum.enum_keys; + printf " in\n"; + printf " let _ = print_%s in\n" (Name.lid enum.enum_name) + | Record record -> + printf " let print_%s x =\n" (Name.lid record.rec_name); + printf " \"{\" ^ (String.concat \"; \" ["; + List.iter + (fun (name, typ) -> + printf "\"%s = \" ^ %s; " name (typ.print (sprintf "x.Types.%s%s" record.rec_prefix (Name.lid name)))) + record.rec_args; + printf "]) ^ \"}\" in\n"; + printf " let _ = print_%s in\n" (Name.lid record.rec_name) | Module(name, items) -> let items = if name = "common" then begin diff --git a/PC_Mainboard/interface/interface.ml b/PC_Mainboard/interface/interface.ml index 9bf3bd3..7c640d8 100644 --- a/PC_Mainboard/interface/interface.ml +++ b/PC_Mainboard/interface/interface.ml @@ -24,6 +24,9 @@ type typ = { reader : string; (* [reader] represents an expression reading a value of the give type, using the reader "reader" *) + + print : string -> string; + (* Prints value of this type. *) } (* An argument *) @@ -116,60 +119,70 @@ let bool = { caml_type = "bool"; writer = sprintf "put_uint8 writer (if %s then 1 else 0)"; reader = "get_uint8 reader <> 0"; + print = sprintf "(string_of_bool %s)"; } let uint8 = { caml_type = "int"; writer = sprintf "put_uint8 writer %s"; reader = "get_uint8 reader"; + print = sprintf "(string_of_int %s)"; } let sint8 = { caml_type = "int"; writer = sprintf "put_sint8 writer %s"; reader = "get_sint8 reader"; + print = sprintf "(string_of_int %s)"; } let uint16 = { caml_type = "int"; writer = sprintf "put_uint16 writer %s"; reader = "get_uint16 reader"; + print = sprintf "(string_of_int %s)"; } let sint16 = { caml_type = "int"; writer = sprintf "put_sint16 writer %s"; reader = "get_sint16 reader"; + print = sprintf "(string_of_int %s)"; } let uint32 = { caml_type = "int"; writer = sprintf "put_uint32 writer %s"; reader = "get_uint32 reader"; + print = sprintf "(string_of_int %s)"; } let sint32 = { caml_type = "int"; writer = sprintf "put_sint32 writer %s"; reader = "get_sint32 reader"; + print = sprintf "(string_of_int %s)"; } let string = { caml_type = "string"; writer = sprintf "put_string writer %s"; reader = "get_string reader"; + print = sprintf "(Printf.sprintf \"%%S\" %s)"; } let array size typ = { caml_type = sprintf "%s array" typ.caml_type; - writer = sprintf "Array.iter (fun x -> %s) %s" (typ.writer "x"); - reader = sprintf "Array.init %d (fun _ -> %s)" size typ.reader; + writer = sprintf "(Array.iter (fun x -> %s) %s)" (typ.writer "x"); + reader = sprintf "(Array.init %d (fun _ -> %s))" size typ.reader; + print = sprintf "(String.concat \" \" (List.map (fun x -> %s) (Array.to_list %s)))" (typ.print "x"); } let bool_array size typ = { caml_type = "bool array"; writer = (fun _ -> failwith "not implemented"); - reader = sprintf "let _x = %s in Array.init %d (fun i -> _x land (1 lsl i) <> 0)" typ.reader size; + reader = sprintf "(let _x = %s in Array.init %d (fun i -> _x land (1 lsl i) <> 0))" typ.reader size; + print = sprintf "(String.concat \" \" (List.map string_of_bool (Array.to_list (%s))))"; } let typ name = @@ -178,6 +191,7 @@ let typ name = caml_type = name; writer = sprintf "put_%s writer %s" name; reader = sprintf "get_%s reader" name; + print = sprintf "(print_%s %s)" name; } (* +-----------------------------------------------------------------+ hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-23 14:54:54
|
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 c6ca4d9dab2c4646c8d8e0b5bb9670fb30a3b8af (commit) from c07439dbd3a468aa4347ee5c03fa9905637426d1 (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 c6ca4d9dab2c4646c8d8e0b5bb9670fb30a3b8af Author: Jérémie Dimino <je...@di...> Date: Tue Feb 23 15:53:59 2010 +0100 [driver] rewrite of the motor section Better support of switching between manual and trajextory mode. ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/joy_control.ml b/PC_Mainboard/clients/joy_control.ml index 45bd28f..ac6b39a 100644 --- a/PC_Mainboard/clients/joy_control.ml +++ b/PC_Mainboard/clients/joy_control.ml @@ -129,6 +129,7 @@ let child_loop pipe joy = let axis_coef = 6 let axis_coef_turn = 4 let accelerations = (800, 800) +let duration = 0.2 let try_call action f = try_lwt @@ -141,12 +142,12 @@ let rec set_velocities krobot velocities = lwt () = try_call "set-velocities" (fun () -> - Krobot.set_velocities krobot ~velocities ~accelerations) + Krobot.set_velocities krobot ~velocities ~accelerations ~duration) in if velocities = (0, 0) then return () else begin - lwt () = Lwt_unix.sleep (Config.stop_motors_delay /. 2.) in + lwt () = Lwt_unix.sleep (duration /. 2.) in set_velocities krobot velocities end @@ -187,7 +188,7 @@ let parent_loop krobot pipe = | JoyButtonPressed ButtonSquare -> stop := true; cancel !thread; - lwt () = try_call "stop-motors" (fun () -> Krobot.stop_motors krobot ~motor:`Both ~mode:`Abrupt) in + lwt () = try_call "stop-motors" (fun () -> Krobot.stop_motors krobot ~mode:`Abrupt) in loop () | JoyButtonReleased ButtonSquare -> stop := false; diff --git a/PC_Mainboard/clients/script.ml b/PC_Mainboard/clients/script.ml index 3c08ab6..2ee3211 100644 --- a/PC_Mainboard/clients/script.ml +++ b/PC_Mainboard/clients/script.ml @@ -196,20 +196,21 @@ let () = | Motors low-level conrol | +---------------------------------------------------------------+ *) - let motor = keyword ~default:`Both "motor" - [("left", `Left); ("right", `Right); ("both", `Both)] - and stop_mode = keyword ~default:`Smooth "stop-mode" + let stop_mode = keyword ~default:`Smooth "stop-mode" [("off", `Off); ("abrupt", `Abrupt); ("smooth", `Smooth)] + and duration = float ~default:1.0 "duration" and velocity motor = int ~default:400 ("velocity" ^ motor) and acceleration motor = int ~default:800 ("acceleration" ^ motor) in - register "stop-motors" (f2 motor stop_mode) - (fun logger krobot motor mode -> Krobot.stop_motors krobot ~motor ~mode); - register "set-velocity" (f3 motor (velocity "") (acceleration "")) - (fun logger krobot motor velocity acceleration -> Krobot.set_velocity krobot ~motor ~velocity ~acceleration); - register "set-velocities" (f4 (velocity "-left") (velocity "-right") (acceleration "-left") (acceleration "-right")) - (fun logger krobot velocity_left velocity_right acceleration_left acceleration_right -> - Krobot.set_velocities krobot ~velocities:(velocity_left, velocity_right) ~accelerations:(acceleration_left, acceleration_right)); + register "stop-motors" (f1 stop_mode) + (fun logger krobot mode -> + Krobot.stop_motors krobot ~mode); + register "set-velocities" (f5 (velocity "-left") (velocity "-right") (acceleration "-left") (acceleration "-right") duration) + (fun logger krobot velocity_left velocity_right acceleration_left acceleration_right duration -> + Krobot.set_velocities krobot + ~velocities:(velocity_left, velocity_right) + ~accelerations:(acceleration_left, acceleration_right) + ~duration); (* +---------------------------------------------------------------+ | Cards control | diff --git a/PC_Mainboard/clients/script_commands.ml b/PC_Mainboard/clients/script_commands.ml index 9cddb97..b7369a4 100644 --- a/PC_Mainboard/clients/script_commands.ml +++ b/PC_Mainboard/clients/script_commands.ml @@ -17,6 +17,7 @@ type logger = Lwt_term.styled_text -> unit Lwt.t (* Type of an argument *) type arg_type = | Int + | Float | Keyword of string list type command = { @@ -129,6 +130,17 @@ let int ?default name = { a_default = default; } +let float ?default name = { + a_name = name; + a_type = Float; + a_cast = (fun str -> + try + float_of_string str + with Failure _ -> + Printf.ksprintf arg_error "invalid value for argument '%s': a float was expected" name); + a_default = default; +} + let keyword ?default name keywords = { a_name = name; a_type = Keyword(List.map fst keywords); diff --git a/PC_Mainboard/common/config.ml b/PC_Mainboard/common/config.ml index 6c73d1d..c248d6e 100644 --- a/PC_Mainboard/common/config.ml +++ b/PC_Mainboard/common/config.ml @@ -13,4 +13,3 @@ let initial_position = 200 let bus_address = "unix:abstract=krobot" let update_delay = 0.05 let reopen_delay = 1.0 -let stop_motors_delay = 0.2 diff --git a/PC_Mainboard/common/config.mli b/PC_Mainboard/common/config.mli index f43c1eb..645ac10 100644 --- a/PC_Mainboard/common/config.mli +++ b/PC_Mainboard/common/config.mli @@ -26,7 +26,3 @@ val update_delay : float val reopen_delay : float (** Time to wait before retrying to open a card *) - -val stop_motors_delay : float - (** Amount of time to wait after a set-speed command to stop the - motors *) diff --git a/PC_Mainboard/driver/driver.ml b/PC_Mainboard/driver/driver.ml index 96d491f..f213256 100644 --- a/PC_Mainboard/driver/driver.ml +++ b/PC_Mainboard/driver/driver.ml @@ -192,45 +192,45 @@ end module Motors = struct - type move_state = - | Ms_static - (* No movement *) - | Ms_stopping - (* The trajectory has been stopped *) - | Ms_moving of [ `Forward | `Backward | `Turn | `Goto ] - (* Currently moving. The argument is a wakener to stop the - mover. *) + type trajectory = { + trajectory : [ `Forward | `Backward | `Left | `Right | `Goto ]; + mutable stopped : bool; + (* Wether the trajectory have been stopped or not *) + abort : unit Lwt.u; + (* Thread which abort waiting for trajectory completion when + wakened *) + } + + type settings = { + direction : [ `Forward | `Backward ]; + velocity : int; + acceleration : int; + } + + (* The current *) + type state = + | Static + (* The robot is not moving *) + | Trajectory of trajectory + (* The robot is following a trajectory. *) + | Manual of unit Lwt.t * settings * settings + (* Manual settings. The first argument is a threads which + suspend itself, then resume and stop the motors *) type t = { obus : OBus_object.t; card : Card.t; - mutable acceleration : int; - (* The current acceleration *) - mutable inhibit_forward_until : float; mutable inhibit_backward_until : float; - (* Date after which motor's inhition should be stopped *) - - mutable move_state : move_state; - (* Move state *) - - commands : int React.event; - (* CMD_TRAJ commands sent by the card *) + (* Date after which motor's inhibition should be stopped *) traj_completed : int React.event; (* Event which occurs each time a TRAJ_COMPLETED command is received *) - mutable velocity_left : int; - mutable velocity_right : int; - (* Velocity when manually controlled (by the joystick for example) *) - - mutable stop_rthread : unit Lwt.t; - mutable stop_lthread : unit Lwt.t; - (* When manually setting velocity with [set_velocity], these threads stop - motors after a small delay, unless a new command is - received. *) + mutable state : state; + (* The current state of the two motors *) } module OBus = OBus_object.Make(struct @@ -246,146 +246,168 @@ struct | High-level movement | +---------------------------------------------------------------+ *) - let stop_move dev = - match dev.move_state with - | Ms_moving _ -> - dev.move_state <- Ms_stopping - | _ -> - () - - let reset_velocity dev = - dev.velocity_left <- 0; - dev.velocity_right <- 0 - let move dev dist velocity acc = - lwt () = Log.info_f "motor: move(dist=%d, velocity=%d, acc=%d)" dist velocity acc in - match dev.move_state with - | Ms_moving _ | Ms_stopping -> - fail (Failure "already moving") - | Ms_static -> + match dev.state with + | Trajectory _ -> + fail (Failure "already in a trajectory") + | Manual _ -> + fail (Failure "currently in manual mode") + | Static -> let date = Unix.gettimeofday () in if (dist > 0 && date < dev.inhibit_forward_until) || (dist < 0 && date < dev.inhibit_backward_until) then fail (Failure "inhibited move") else begin - reset_velocity dev; - dev.move_state <- Ms_moving(if dist > 0 then `Forward else `Backward); + let waiter, wakener = Lwt.wait () in + let trajectory = { + abort = wakener; + trajectory = if dist > 0 then `Forward else `Backward; + stopped = false + } in + dev.state <- Trajectory trajectory; + let thread = Lwt_event.next dev.traj_completed >> return () in lwt () = - if dist > 0 then - USB_commands.Motor.forward dev.card dist velocity acc - else - USB_commands.Motor.backward dev.card (-dist) velocity acc - and _ = Lwt_event.next dev.traj_completed in - let result = match dev.move_state with - | Ms_stopping -> - `Stopped - | _ -> - `OK + select [waiter; + (lwt () = + if dist > 0 then + USB_commands.Motor.forward dev.card dist velocity acc + else + USB_commands.Motor.backward dev.card (-dist) velocity acc + in + thread)] in - dev.move_state <- Ms_static; - return result + dev.state <- Static; + return (if trajectory.stopped then `Stopped else `OK) end let turn dev angle velocity acc = - lwt () = Log.info_f "motor: turn(angle=%d, velocity=%d, acc=%d)" angle velocity acc in - match dev.move_state with - | Ms_moving _ | Ms_stopping -> - fail (Failure "already moving") - | Ms_static -> - reset_velocity dev; - dev.move_state <- Ms_moving `Turn; + match dev.state with + | Trajectory _ -> + fail (Failure "already in a trajectory") + | Manual _ -> + fail (Failure "currently in manual mode") + | Static -> + let waiter, wakener = Lwt.wait () in + let trajectory = { + abort = wakener; + trajectory = if angle > 0 then `Left else `Right; + stopped = false + } in + dev.state <- Trajectory trajectory; + let thread = Lwt_event.next dev.traj_completed >> return () in lwt () = - if angle > 0 then - USB_commands.Motor.right dev.card angle velocity acc - else - USB_commands.Motor.left dev.card (-angle) velocity acc - and _ = Lwt_event.next dev.traj_completed in - let result = match dev.move_state with - | Ms_stopping -> - `Stopped - | _ -> - `OK + select [waiter; + (lwt () = + if angle > 0 then + USB_commands.Motor.left dev.card angle velocity acc + else + USB_commands.Motor.right dev.card (-angle) velocity acc + in + thread)] in - dev.move_state <- Ms_static; - return result + dev.state <- Static; + return (if trajectory.stopped then `Stopped else `OK) let goto dev x y velocity acc mode bypass_distance = - match dev.move_state with - | Ms_moving _ | Ms_stopping -> - fail (Failure "already moving") - | Ms_static -> - reset_velocity dev; - dev.move_state <- Ms_moving `Goto; - lwt () = USB_commands.Motor.goto dev.card ~x ~y ~velocity:velocity ~acceleration:acc ~mode ~bypass_distance and _ = Lwt_event.next dev.traj_completed in - let result = match dev.move_state with - | Ms_stopping -> - `Stopped - | _ -> - `OK - in - dev.move_state <- Ms_static; - return result + match dev.state with + | Trajectory _ -> + fail (Failure "already in a trajectory") + | Manual _ -> + fail (Failure "currently in manual mode") + | Static -> + let date = Unix.gettimeofday () in + if date < dev.inhibit_forward_until then + fail (Failure "inhibited move") + else begin + let waiter, wakener = Lwt.wait () in + let trajectory = { + abort = wakener; + trajectory = `Goto; + stopped = false + } in + dev.state <- Trajectory trajectory; + let thread = Lwt_event.next dev.traj_completed >> return () in + lwt () = + select [waiter; + (lwt () = + USB_commands.Motor.goto dev.card + ~x ~y + ~velocity:velocity + ~acceleration:acc + ~mode + ~bypass_distance + in + thread)] + in + dev.state <- Static; + return (if trajectory.stopped then `Stopped else `OK) + end OL_method Turn : int -> int -> int -> Types.move_result OL_method Move : int -> int -> int -> Types.move_result OL_method Goto : int -> int -> int -> int -> Types.goto_mode -> int -> Types.move_result (* +---------------------------------------------------------------+ - | Low-level control of velocity and acceleration of each motor | + | Manually sets the velocity and acceleration of each motor | +---------------------------------------------------------------+ *) - let string_of_motor = function - | `Left -> "left" - | `Both -> "both" - | `Right -> "right" - - let string_of_stop_mode = function - | `Off -> "off" - | `Abrupt -> "abrupt" - | `Smooth -> "smooth" - - let stop_motors dev motor mode = - lwt () = Log.info_f "motor: stopping(motor=%s, mode=%s)" (string_of_motor motor) (string_of_stop_mode mode) in - stop_move dev; - USB_commands.Motor.traj_stop dev.card motor mode - - let set_velocity dev motor velocity acc = - lwt () = Log.info_f "motor: set_velocity(motor=%s, velocity=%d, acc=%d)" (string_of_motor motor) velocity acc in - stop_move dev; - let dir, abs_velocity = if velocity < 0 then (`Backward, -velocity) else (`Forward, velocity) in + let stop_motors dev mode = + match dev.state with + | Trajectory trajectory -> + trajectory.stopped <- true; + lwt () = USB_commands.Motor.traj_stop dev.card `Both mode in + wakeup trajectory.abort (); + return () + | Manual(stopper, left, right) -> + lwt () = USB_commands.Motor.traj_stop dev.card `Both mode in + dev.state <- Static; + cancel stopper; + return () + | Static -> + USB_commands.Motor.traj_stop dev.card `Both mode + + let _set_velocities dev (settings_l, settings_r) (velocity_l, velocity_r) (acceleration_l, acceleration_r) duration = + let direction_l, velocity_l = if velocity_l < 0 then (`Backward, -velocity_l) else (`Forward, velocity_l) in + let direction_r, velocity_r = if velocity_r < 0 then (`Backward, -velocity_r) else (`Forward, velocity_r) in let date = Unix.gettimeofday () in - if (dir = `Forward && date < dev.inhibit_forward_until) || (dir = `Backward && date < dev.inhibit_backward_until) then - fail (Failure "inhibited move") + if ((direction_l = `Forward || direction_r = `Backward) && date < dev.inhibit_forward_until) + || ((direction_l = `Backward || direction_r = `Backward) && date < dev.inhibit_backward_until) then + fail (Failure "inhibited move") else begin - if motor = `Both || motor = `Left then - dev.velocity_left <- velocity; - if motor = `Both || motor = `Right then - dev.velocity_right <- velocity; - lwt () = - if acc <> dev.acceleration then begin - dev.acceleration <- acc; - USB_commands.Motor.traj_new_velocity dev.card motor abs_velocity acc dir - end else - USB_commands.Motor.traj_change_velocity dev.card motor abs_velocity dir - in - lwt () = USB_commands.Motor.traj_start dev.card motor in - (* Stop motors after a small delay *) - if motor = `Both || motor = `Left then begin - cancel dev.stop_lthread; - if velocity <> 0 then - dev.stop_lthread <- (lwt () = Lwt_unix.sleep Config.stop_motors_delay in - stop_motors dev `Left `Smooth) - end; - if motor = `Both || motor = `Right then begin - cancel dev.stop_rthread; - if velocity <> 0 then - dev.stop_rthread <- (lwt () = Lwt_unix.sleep Config.stop_motors_delay in - stop_motors dev `Right `Smooth) - end; - return () + if velocity_l = 0 && velocity_r = 0 then + stop_motors dev `Smooth + else begin + dev.state <- Manual(Lwt_unix.sleep duration >> stop_motors dev `Smooth, + { velocity = velocity_l; acceleration = acceleration_l; direction = direction_l }, + { velocity = velocity_r; acceleration = acceleration_r; direction = direction_r }); + lwt () = + if acceleration_l <> settings_l.acceleration then + USB_commands.Motor.traj_new_velocity dev.card `Left velocity_l acceleration_l direction_l + else + USB_commands.Motor.traj_change_velocity dev.card `Left velocity_l direction_l + and () = + if acceleration_r <> settings_r.acceleration then + USB_commands.Motor.traj_new_velocity dev.card `Right velocity_r acceleration_r direction_r + else + USB_commands.Motor.traj_change_velocity dev.card `Right velocity_r direction_r + in + USB_commands.Motor.traj_start dev.card `Both + end end - OL_method StopMotors : Types.motor -> Types.stop_mode -> unit - OL_method SetVelocity : Types.motor -> int -> int -> unit + let set_velocities dev velocities accelerations duration = + match dev.state with + | Trajectory _ -> + fail (Failure "currently in trajectory mode") + | Manual(stopper, left, right) -> + cancel stopper; + dev.state <- Static; + _set_velocities dev (left, right) velocities accelerations duration + | Static -> + let static = { velocity = 0; acceleration = 0; direction = `Forward } in + _set_velocities dev (static, static) velocities accelerations duration + + OL_method StopMotors : Types.stop_mode -> unit + OL_method SetVelocities : int * int -> int * int -> float -> unit (* +---------------------------------------------------------------+ | Motors inhbition | @@ -405,11 +427,13 @@ struct let until = Unix.gettimeofday () +. delay in dev.inhibit_forward_until <- until; ignore (inhibited_forward_changed dev until); - match dev.move_state with - | Ms_moving (`Forward | `Goto) -> - stop_motors dev `Both `Abrupt - | Ms_static when dev.velocity_left > 0 || dev.velocity_right > 0 -> - stop_motors dev `Both `Abrupt + match dev.state with + | Trajectory{ trajectory = (`Forward | `Goto) } -> + stop_motors dev `Abrupt + | Manual(_, settings_l, settings_r) + when (settings_l.direction = `Forward && settings_l.velocity > 0) + || (settings_r.direction = `Forward && settings_r.velocity > 0) -> + stop_motors dev `Abrupt | _ -> return () @@ -418,11 +442,13 @@ struct let until = Unix.gettimeofday () +. delay in dev.inhibit_backward_until <- until; ignore (inhibited_backward_changed dev until); - match dev.move_state with - | Ms_moving (`Backward | `Goto) -> - stop_motors dev `Both `Abrupt - | Ms_static when dev.velocity_left < 0 || dev.velocity_right < 0 -> - stop_motors dev `Both `Abrupt + match dev.state with + | Trajectory{ trajectory = `Backward } -> + stop_motors dev `Abrupt + | Manual(_, settings_l, settings_r) + when (settings_l.direction = `Backward && settings_l.velocity > 0) + || (settings_r.direction = `Backward && settings_r.velocity > 0) -> + stop_motors dev `Abrupt | _ -> return () @@ -431,16 +457,10 @@ struct let dev = { obus = OBus_object.make path; card = card; - acceleration = 0; inhibit_forward_until = 0.0; inhibit_backward_until = 0.0; - move_state = Ms_static; - commands = commands; + state = Static; traj_completed = React.E.filter ((=) PcInterface.traj_completed) commands; - velocity_left = 0; - velocity_right = 0; - stop_rthread = return (); - stop_lthread = return (); } in return dev end diff --git a/PC_Mainboard/lib_krobot/krobot.ml b/PC_Mainboard/lib_krobot/krobot.ml index 9785216..df76ee4 100644 --- a/PC_Mainboard/lib_krobot/krobot.ml +++ b/PC_Mainboard/lib_krobot/krobot.ml @@ -180,9 +180,8 @@ include MakeDevice(struct let name = "Motors" end) OP_method Turn : angle : int -> velocity : int -> acceleration : int -> Types.move_result OP_method Move : distance : int -> velocity : int -> acceleration : int -> Types.move_result OP_method Goto : x : int -> y : int -> velocity : int -> acceleration : int -> mode : Types.goto_mode -> bypass_distance : int -> Types.move_result -OP_method StopMotors : motor : Types.motor -> mode : Types.stop_mode -> unit -OP_method SetVelocity : motor : Types.motor -> velocity : int -> acceleration : int -> unit -OP_method SetVelocities : velocities : int * int -> accelerations : int * int -> unit +OP_method StopMotors : mode : Types.stop_mode -> unit +OP_method SetVelocities : velocities : int * int -> accelerations : int * int -> duration : float -> unit OP_method InhibitForward : float -> unit OP_method InhibitBackward : float -> unit diff --git a/PC_Mainboard/lib_krobot/krobot.mli b/PC_Mainboard/lib_krobot/krobot.mli index 14a06ba..b926f60 100644 --- a/PC_Mainboard/lib_krobot/krobot.mli +++ b/PC_Mainboard/lib_krobot/krobot.mli @@ -73,16 +73,17 @@ val goto : t -> mode : Types.goto_mode -> bypass_distance : int -> Types.move_result Lwt.t -val stop_motors : t -> motor : Types.motor -> mode : Types.stop_mode -> unit Lwt.t - (** [stop_motorw t motor mode] stop the given motor(s). *) - -val set_velocity : t -> motor : Types.motor -> velocity : int -> acceleration : int -> unit Lwt.t - (** [set_velocity krobot ~motor ~velocity ~acc] set the velocity and - acceleration for the specified motors. *) - -val set_velocities : t -> velocities : int * int -> accelerations : int * int -> unit Lwt.t - (** [set_velocities krobot ~velocities ~accelerations] sets both - velocities at the same time. *) +val stop_motors : t -> mode : Types.stop_mode -> unit Lwt.t + (** [stop_motorw t mode] stop the two motors. *) + +val set_velocities : t -> + velocities : int * int -> + accelerations : int * int -> + duration : float -> unit Lwt.t + (** [set_velocities krobot ~velocities ~accelerations ~duration] set + the velocities of each motors, then wait for [duration] seconds + and stop the motors, unless [set_velocities] is called again + before. *) val inhibit_forward : t -> float -> unit Lwt.t (** [inhibit_forward krobot delay] forbid forward moves during diff --git a/PC_Mainboard/tests/stop_and_restart.ml b/PC_Mainboard/tests/stop_and_restart.ml index ab193a0..f04a368 100644 --- a/PC_Mainboard/tests/stop_and_restart.ml +++ b/PC_Mainboard/tests/stop_and_restart.ml @@ -15,7 +15,7 @@ lwt () = let t = Krobot.move krobot ~distance:1000 ~velocity:100 ~acceleration:200 in lwt () = Lwt_unix.sleep 2.0 in print_endline "stopping motors"; - lwt () = Krobot.stop_motors krobot `Both `Smooth in + lwt () = Krobot.stop_motors krobot `Smooth in print_endline "waiting for trajectory to terminates"; lwt _ = t in print_endline "mobing backward"; hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-23 12:50: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 c07439dbd3a468aa4347ee5c03fa9905637426d1 (commit) from c0d1d60462dfc4bf44bdc73eb14937bc048a6afc (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 c07439dbd3a468aa4347ee5c03fa9905637426d1 Author: Jérémie Dimino <je...@di...> Date: Tue Feb 23 13:50:09 2010 +0100 Allow to set both motor velocites at the same time ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/init_position.ml b/PC_Mainboard/clients/init_position.ml index 94073a3..0a4e6d9 100644 --- a/PC_Mainboard/clients/init_position.ml +++ b/PC_Mainboard/clients/init_position.ml @@ -15,7 +15,7 @@ open Lwt let move_backward_slowly krobot = lwt () = Log.notice "moving backward" in - Krobot.move krobot ~dist:(-1000) ~speed:100 ~acc:100 >>= function + Krobot.move krobot ~distance:(-1000) ~velocity:100 ~acceleration:100 >>= function | `OK -> lwt () = Log.error "where am i ???" in exit 1 @@ -28,16 +28,16 @@ lwt () = lwt () = move_backward_slowly krobot in lwt () = Log.notice "going to initial position on first axis" in - lwt _ = Krobot.move krobot ~dist:Config.initial_position ~speed:400 ~acc:800 in + lwt _ = Krobot.move krobot ~distance:Config.initial_position ~velocity:400 ~acceleration:800 in lwt () = Log.notice "turning" in - lwt _ = Krobot.turn krobot ~angle:(-90) ~speed:400 ~acc:800 in + lwt _ = Krobot.turn krobot ~angle:(-90) ~velocity:400 ~acceleration:800 in lwt () = move_backward_slowly krobot in lwt () = Log.notice "going to initial position on second axis" in - lwt _ = Krobot.move krobot ~dist:Config.initial_position ~speed:400 ~acc:800 in + lwt _ = Krobot.move krobot ~distance:Config.initial_position ~velocity:400 ~acceleration:800 in lwt () = Log.notice "turning" in - lwt _ = Krobot.turn krobot ~angle:45 ~speed:400 ~acc:800 in + lwt _ = Krobot.turn krobot ~angle:45 ~velocity:400 ~acceleration:800 in return () diff --git a/PC_Mainboard/clients/joy_control.ml b/PC_Mainboard/clients/joy_control.ml index 7c84d21..45bd28f 100644 --- a/PC_Mainboard/clients/joy_control.ml +++ b/PC_Mainboard/clients/joy_control.ml @@ -128,7 +128,7 @@ let child_loop pipe joy = let axis_coef = 6 let axis_coef_turn = 4 -let acceleration = 800 +let accelerations = (800, 800) let try_call action f = try_lwt @@ -137,38 +137,32 @@ let try_call action f = lwt () = Log.error_f "action %s failed with: %s" action msg in return () -let rec set_speed action krobot motor speed abort_waiter = - lwt () = choose [abort_waiter; try_call action (fun () -> Krobot.set_speed krobot ~motor ~speed ~acc:acceleration)] in - if speed = 0 then +let rec set_velocities krobot velocities = + lwt () = + try_call "set-velocities" + (fun () -> + Krobot.set_velocities krobot ~velocities ~accelerations) + in + if velocities = (0, 0) then return () else begin - lwt () = select [abort_waiter; Lwt_unix.sleep (Config.stop_motors_delay /. 2.)] in - set_speed action krobot motor speed abort_waiter + lwt () = Lwt_unix.sleep (Config.stop_motors_delay /. 2.) in + set_velocities krobot velocities end let parent_loop krobot pipe = - let rstop = ref false and lstop = ref false in - let rthread = ref (return ()) and lthread = ref (return ()) in - let rabort_wakener = ref None and labort_wakener = ref None in + let stop = ref false in + let thread = ref (return ()) in let raxis_h = ref 0 and raxis_v = ref 0 and laxis_h = ref 0 and laxis_v = ref 0 in - let set_speeds () = - begin match !labort_wakener with - | None -> () - | Some w -> wakeup_exn w Exit - end; - begin match !rabort_wakener with - | None -> () - | Some w -> wakeup_exn w Exit - end; - let waiter, wakener = Lwt.wait () in - labort_wakener := Some wakener; - lthread := set_speed "set-speed-left" krobot `Left (!laxis_v * axis_coef - !raxis_h * axis_coef_turn) waiter; - let waiter, wakener = Lwt.wait () in - rabort_wakener := Some wakener; - rthread := set_speed "set-speed-right" krobot `Right (!laxis_v * axis_coef + !raxis_h * axis_coef_turn) waiter + let set_velocities () = + if not !stop then + thread := + set_velocities krobot + (!laxis_v * axis_coef - !raxis_h * axis_coef_turn, + !laxis_v * axis_coef + !raxis_h * axis_coef_turn) in let rec loop () = Lwt_io.read_value pipe >>= function @@ -176,35 +170,27 @@ let parent_loop krobot pipe = return () | JoyLAxisV n -> laxis_v := n; - set_speeds (); + set_velocities (); loop () | JoyLAxisH n -> laxis_h := n; - set_speeds (); + set_velocities (); loop () | JoyRAxisV n -> raxis_v := n; - set_speeds (); + set_velocities (); loop () | JoyRAxisH n -> raxis_h := n; - set_speeds (); - loop () - | JoyButtonPressed ButtonL2 -> - lstop := true; - cancel !lthread; - lwt () = try_call "stop-left-motor" (fun () -> Krobot.stop_motors krobot ~motor:`Left ~mode:`Abrupt) in - ignore (lwt () = Lwt_unix.sleep 1.0 in lstop := false; return ()); + set_velocities (); loop () - | JoyButtonPressed ButtonR2 -> - rstop := true; - cancel !rthread; - lwt () = try_call "stop-right-motor" (fun () -> Krobot.stop_motors krobot ~motor:`Right ~mode:`Abrupt) in - ignore (lwt () = Lwt_unix.sleep 1.0 in rstop := false; return ()); + | JoyButtonPressed ButtonSquare -> + stop := true; + cancel !thread; + lwt () = try_call "stop-motors" (fun () -> Krobot.stop_motors krobot ~motor:`Both ~mode:`Abrupt) in loop () - | JoyButtonReleased ButtonCircle -> - rstop := false; - lstop := false; + | JoyButtonReleased ButtonSquare -> + stop := false; loop () | _ -> loop () @@ -234,6 +220,6 @@ let () = Unix.close fd_w; Lwt_main.run begin lwt krobot = Krobot.create () in - lwt() = Log.notice "ready to process event" in + lwt () = Log.notice "ready to process event" in parent_loop krobot (Lwt_io.of_unix_fd ~mode:Lwt_io.input fd_r) end diff --git a/PC_Mainboard/clients/script.ml b/PC_Mainboard/clients/script.ml index 7918b02..3c08ab6 100644 --- a/PC_Mainboard/clients/script.ml +++ b/PC_Mainboard/clients/script.ml @@ -159,10 +159,10 @@ let () = | Movement | +---------------------------------------------------------------+ *) - let dist = int ~default:100 "dist" + let distance = int ~default:100 "distance" and angle = int ~default:90 "angle" - and speed = int ~default:400 "speed" - and acc = int ~default:800 "acc" in + and velocity = int ~default:400 "velocity" + and acceleration = int ~default:800 "acceleration" in let move_result logger = function | `OK -> @@ -171,26 +171,26 @@ let () = logger [fg lyellow; text "move stopped"] in - register "forward" (f3 dist speed acc) - (fun logger krobot dist speed acc -> - Krobot.move krobot dist speed acc >>= move_result logger); - register "backward" (f3 dist speed acc) - (fun logger krobot dist speed acc -> - Krobot.move krobot (-dist) speed acc >>= move_result logger); - register "left" (f3 angle speed acc) - (fun logger krobot angle speed acc -> - Krobot.turn krobot angle speed acc >>= move_result logger); - register "right" (f3 angle speed acc) - (fun logger krobot angle speed acc -> - Krobot.turn krobot (-angle) speed acc >>= move_result logger); + register "forward" (f3 distance velocity acceleration) + (fun logger krobot distance velocity acceleration -> + Krobot.move krobot distance velocity acceleration >>= move_result logger); + register "backward" (f3 distance velocity acceleration) + (fun logger krobot distance velocity acceleration -> + Krobot.move krobot (-distance) velocity acceleration >>= move_result logger); + register "left" (f3 angle velocity acceleration) + (fun logger krobot angle velocity acceleration -> + Krobot.turn krobot angle velocity acceleration >>= move_result logger); + register "right" (f3 angle velocity acceleration) + (fun logger krobot angle velocity acceleration -> + Krobot.turn krobot (-angle) velocity acceleration >>= move_result logger); register "goto" (f6 - (int ~default:0 "x") (int ~default:0 "y") speed acc + (int ~default:0 "x") (int ~default:0 "y") velocity acceleration (keyword ~default:`Straight "mode" [("straight", `Straight); ("curve-left", `Curve_left); ("curve-right", `Curve_right)]) - (int ~default:0 "bypass-dist")) - (fun logger krobot x y speed acc mode bypass -> - Krobot.goto krobot x y speed acc mode bypass >>= move_result logger); + (int ~default:0 "bypass-distance")) + (fun logger krobot x y velocity acceleration mode bypass -> + Krobot.goto krobot x y velocity acceleration mode bypass >>= move_result logger); (* +---------------------------------------------------------------+ | Motors low-level conrol | @@ -199,12 +199,17 @@ let () = let motor = keyword ~default:`Both "motor" [("left", `Left); ("right", `Right); ("both", `Both)] and stop_mode = keyword ~default:`Smooth "stop-mode" - [("off", `Off); ("abrupt", `Abrupt); ("smooth", `Smooth)] in + [("off", `Off); ("abrupt", `Abrupt); ("smooth", `Smooth)] + and velocity motor = int ~default:400 ("velocity" ^ motor) + and acceleration motor = int ~default:800 ("acceleration" ^ motor) in register "stop-motors" (f2 motor stop_mode) (fun logger krobot motor mode -> Krobot.stop_motors krobot ~motor ~mode); - register "set-speed" (f3 motor speed acc) - (fun logger krobot motor speed acc -> Krobot.set_speed krobot ~motor ~speed ~acc); + register "set-velocity" (f3 motor (velocity "") (acceleration "")) + (fun logger krobot motor velocity acceleration -> Krobot.set_velocity krobot ~motor ~velocity ~acceleration); + register "set-velocities" (f4 (velocity "-left") (velocity "-right") (acceleration "-left") (acceleration "-right")) + (fun logger krobot velocity_left velocity_right acceleration_left acceleration_right -> + Krobot.set_velocities krobot ~velocities:(velocity_left, velocity_right) ~accelerations:(acceleration_left, acceleration_right)); (* +---------------------------------------------------------------+ | Cards control | @@ -254,27 +259,27 @@ let () = +---------------------------------------------------------------+ *) let id = int "id" - and pos = int "pos" - and speed = int ~default:50 "speed" + and position = int "position" + and velocity = int ~default:50 "velocity" and timeout = int ~default:100 "timeout" - and now = keyword ~default:`Now "mode" [("now", `Now); ("action", `Action)] in + and goto_mode = keyword ~default:`Now "mode" [("now", `Now); ("action", `Action)] in - register ~path:["ax12"] "goto" (f4 id pos speed now) - (fun logger krobot id pos speed now -> - Krobot_unsafe.AX12.goto krobot id pos speed now); + register ~path:["ax12"] "goto" (f4 id position velocity goto_mode) + (fun logger krobot id position velocity goto_mode -> + Krobot_unsafe.AX12.goto krobot id position velocity goto_mode); register ~path:["ax12"] "ping" (f2 id timeout) (fun logger krobot id timeout -> Krobot_unsafe.AX12.ping krobot id timeout >>= function | 0 -> logger [textf "ping[%d] reply: " id; fg lred; text "timeout"] | _ -> logger [textf "ping[%d] reply: " id; fg lgreen; text "success"]); - register ~path:["ax12"] "get-pos" (f2 id timeout) + register ~path:["ax12"] "get-position" (f2 id timeout) (fun logger krobot id timeout -> lwt x = Krobot_unsafe.AX12.get_position krobot id timeout in - logger [textf "position[%d]: %d" id x]); - register ~path:["ax12"] "get-speed" (f2 id timeout) + logger [textf "positionition[%d]: %d" id x]); + register ~path:["ax12"] "get-velocity" (f2 id timeout) (fun logger krobot id timeout -> lwt x = Krobot_unsafe.AX12.get_velocity krobot id timeout in - logger [textf "speed[%d]: %d" id x]); + logger [textf "velocity[%d]: %d" id x]); register ~path:["ax12"] "get-load" (f2 id timeout) (fun logger krobot id timeout -> lwt x = Krobot_unsafe.AX12.get_load krobot id timeout in diff --git a/PC_Mainboard/driver/driver.ml b/PC_Mainboard/driver/driver.ml index 2a23af1..96d491f 100644 --- a/PC_Mainboard/driver/driver.ml +++ b/PC_Mainboard/driver/driver.ml @@ -222,13 +222,13 @@ struct (* Event which occurs each time a TRAJ_COMPLETED command is received *) - mutable speed_left : int; - mutable speed_right : int; - (* Speed when manually controlled (by the joystick for example) *) + mutable velocity_left : int; + mutable velocity_right : int; + (* Velocity when manually controlled (by the joystick for example) *) mutable stop_rthread : unit Lwt.t; mutable stop_lthread : unit Lwt.t; - (* When manually setting speed with [set_speed], these threads stop + (* When manually setting velocity with [set_velocity], these threads stop motors after a small delay, unless a new command is received. *) } @@ -253,12 +253,12 @@ struct | _ -> () - let reset_speed dev = - dev.speed_left <- 0; - dev.speed_right <- 0 + let reset_velocity dev = + dev.velocity_left <- 0; + dev.velocity_right <- 0 - let move dev dist speed acc = - lwt () = Log.info_f "motor: move(dist=%d, speed=%d, acc=%d)" dist speed acc in + let move dev dist velocity acc = + lwt () = Log.info_f "motor: move(dist=%d, velocity=%d, acc=%d)" dist velocity acc in match dev.move_state with | Ms_moving _ | Ms_stopping -> fail (Failure "already moving") @@ -267,13 +267,13 @@ struct if (dist > 0 && date < dev.inhibit_forward_until) || (dist < 0 && date < dev.inhibit_backward_until) then fail (Failure "inhibited move") else begin - reset_speed dev; + reset_velocity dev; dev.move_state <- Ms_moving(if dist > 0 then `Forward else `Backward); lwt () = if dist > 0 then - USB_commands.Motor.forward dev.card dist speed acc + USB_commands.Motor.forward dev.card dist velocity acc else - USB_commands.Motor.backward dev.card (-dist) speed acc + USB_commands.Motor.backward dev.card (-dist) velocity acc and _ = Lwt_event.next dev.traj_completed in let result = match dev.move_state with | Ms_stopping -> @@ -285,19 +285,19 @@ struct return result end - let turn dev angle speed acc = - lwt () = Log.info_f "motor: turn(angle=%d, speed=%d, acc=%d)" angle speed acc in + let turn dev angle velocity acc = + lwt () = Log.info_f "motor: turn(angle=%d, velocity=%d, acc=%d)" angle velocity acc in match dev.move_state with | Ms_moving _ | Ms_stopping -> fail (Failure "already moving") | Ms_static -> - reset_speed dev; + reset_velocity dev; dev.move_state <- Ms_moving `Turn; lwt () = if angle > 0 then - USB_commands.Motor.right dev.card angle speed acc + USB_commands.Motor.right dev.card angle velocity acc else - USB_commands.Motor.left dev.card (-angle) speed acc + USB_commands.Motor.left dev.card (-angle) velocity acc and _ = Lwt_event.next dev.traj_completed in let result = match dev.move_state with | Ms_stopping -> @@ -308,14 +308,14 @@ struct dev.move_state <- Ms_static; return result - let goto dev x y speed acc mode bypass_distance = + let goto dev x y velocity acc mode bypass_distance = match dev.move_state with | Ms_moving _ | Ms_stopping -> fail (Failure "already moving") | Ms_static -> - reset_speed dev; + reset_velocity dev; dev.move_state <- Ms_moving `Goto; - lwt () = USB_commands.Motor.goto dev.card ~x ~y ~velocity:speed ~acceleration:acc ~mode ~bypass_distance and _ = Lwt_event.next dev.traj_completed in + lwt () = USB_commands.Motor.goto dev.card ~x ~y ~velocity:velocity ~acceleration:acc ~mode ~bypass_distance and _ = Lwt_event.next dev.traj_completed in let result = match dev.move_state with | Ms_stopping -> `Stopped @@ -330,7 +330,7 @@ struct OL_method Goto : int -> int -> int -> int -> Types.goto_mode -> int -> Types.move_result (* +---------------------------------------------------------------+ - | Low-level control of speed and acceleration of each motor | + | Low-level control of velocity and acceleration of each motor | +---------------------------------------------------------------+ *) let string_of_motor = function @@ -348,36 +348,36 @@ struct stop_move dev; USB_commands.Motor.traj_stop dev.card motor mode - let set_speed dev motor speed acc = - lwt () = Log.info_f "motor: set_speed(motor=%s, speed=%d, acc=%d)" (string_of_motor motor) speed acc in + let set_velocity dev motor velocity acc = + lwt () = Log.info_f "motor: set_velocity(motor=%s, velocity=%d, acc=%d)" (string_of_motor motor) velocity acc in stop_move dev; - let dir, abs_speed = if speed < 0 then (`Backward, -speed) else (`Forward, speed) in + let dir, abs_velocity = if velocity < 0 then (`Backward, -velocity) else (`Forward, velocity) in let date = Unix.gettimeofday () in if (dir = `Forward && date < dev.inhibit_forward_until) || (dir = `Backward && date < dev.inhibit_backward_until) then fail (Failure "inhibited move") else begin if motor = `Both || motor = `Left then - dev.speed_left <- speed; + dev.velocity_left <- velocity; if motor = `Both || motor = `Right then - dev.speed_right <- speed; + dev.velocity_right <- velocity; lwt () = if acc <> dev.acceleration then begin dev.acceleration <- acc; - USB_commands.Motor.traj_new_velocity dev.card motor abs_speed acc dir + USB_commands.Motor.traj_new_velocity dev.card motor abs_velocity acc dir end else - USB_commands.Motor.traj_change_velocity dev.card motor abs_speed dir + USB_commands.Motor.traj_change_velocity dev.card motor abs_velocity dir in lwt () = USB_commands.Motor.traj_start dev.card motor in (* Stop motors after a small delay *) if motor = `Both || motor = `Left then begin cancel dev.stop_lthread; - if speed <> 0 then + if velocity <> 0 then dev.stop_lthread <- (lwt () = Lwt_unix.sleep Config.stop_motors_delay in stop_motors dev `Left `Smooth) end; if motor = `Both || motor = `Right then begin cancel dev.stop_rthread; - if speed <> 0 then + if velocity <> 0 then dev.stop_rthread <- (lwt () = Lwt_unix.sleep Config.stop_motors_delay in stop_motors dev `Right `Smooth) end; @@ -385,7 +385,7 @@ struct end OL_method StopMotors : Types.motor -> Types.stop_mode -> unit - OL_method SetSpeed : Types.motor -> int -> int -> unit + OL_method SetVelocity : Types.motor -> int -> int -> unit (* +---------------------------------------------------------------+ | Motors inhbition | @@ -408,7 +408,7 @@ struct match dev.move_state with | Ms_moving (`Forward | `Goto) -> stop_motors dev `Both `Abrupt - | Ms_static when dev.speed_left > 0 || dev.speed_right > 0 -> + | Ms_static when dev.velocity_left > 0 || dev.velocity_right > 0 -> stop_motors dev `Both `Abrupt | _ -> return () @@ -421,7 +421,7 @@ struct match dev.move_state with | Ms_moving (`Backward | `Goto) -> stop_motors dev `Both `Abrupt - | Ms_static when dev.speed_left < 0 || dev.speed_right < 0 -> + | Ms_static when dev.velocity_left < 0 || dev.velocity_right < 0 -> stop_motors dev `Both `Abrupt | _ -> return () @@ -437,8 +437,8 @@ struct move_state = Ms_static; commands = commands; traj_completed = React.E.filter ((=) PcInterface.traj_completed) commands; - speed_left = 0; - speed_right = 0; + velocity_left = 0; + velocity_right = 0; stop_rthread = return (); stop_lthread = return (); } in diff --git a/PC_Mainboard/lib_krobot/krobot.ml b/PC_Mainboard/lib_krobot/krobot.ml index 7660c91..9785216 100644 --- a/PC_Mainboard/lib_krobot/krobot.ml +++ b/PC_Mainboard/lib_krobot/krobot.ml @@ -177,11 +177,12 @@ OP_method CalibrationContinue : unit include MakeDevice(struct let name = "Motors" end) -OP_method Turn : angle : int -> speed : int -> acc : int -> Types.move_result -OP_method Move : dist : int -> speed : int -> acc : int -> Types.move_result -OP_method Goto : x : int -> y : int -> speed : int -> acc : int -> mode : Types.goto_mode -> bypass_dist : int -> Types.move_result +OP_method Turn : angle : int -> velocity : int -> acceleration : int -> Types.move_result +OP_method Move : distance : int -> velocity : int -> acceleration : int -> Types.move_result +OP_method Goto : x : int -> y : int -> velocity : int -> acceleration : int -> mode : Types.goto_mode -> bypass_distance : int -> Types.move_result OP_method StopMotors : motor : Types.motor -> mode : Types.stop_mode -> unit -OP_method SetSpeed : motor : Types.motor -> speed : int -> acc : int -> unit +OP_method SetVelocity : motor : Types.motor -> velocity : int -> acceleration : int -> unit +OP_method SetVelocities : velocities : int * int -> accelerations : int * int -> unit OP_method InhibitForward : float -> unit OP_method InhibitBackward : float -> unit diff --git a/PC_Mainboard/lib_krobot/krobot.mli b/PC_Mainboard/lib_krobot/krobot.mli index 4410602..14a06ba 100644 --- a/PC_Mainboard/lib_krobot/krobot.mli +++ b/PC_Mainboard/lib_krobot/krobot.mli @@ -64,17 +64,26 @@ val calibration_stop : t -> unit Lwt.t (** {6 Motors} *) -val turn : t -> angle : int -> speed : int -> acc : int -> Types.move_result Lwt.t -val move : t -> dist : int -> speed : int -> acc : int -> Types.move_result Lwt.t -val goto : t -> x : int -> y : int -> speed : int -> acc : int -> mode : Types.goto_mode -> bypass_dist : int -> Types.move_result Lwt.t +val turn : t -> angle : int -> velocity : int -> acceleration : int -> Types.move_result Lwt.t +val move : t -> distance : int -> velocity : int -> acceleration : int -> Types.move_result Lwt.t +val goto : t -> + x : int -> y : int -> + velocity : int -> + acceleration : int -> + mode : Types.goto_mode -> + bypass_distance : int -> Types.move_result Lwt.t val stop_motors : t -> motor : Types.motor -> mode : Types.stop_mode -> unit Lwt.t (** [stop_motorw t motor mode] stop the given motor(s). *) -val set_speed : t -> motor : Types.motor -> speed : int -> acc : int -> unit Lwt.t - (** [set_speed krobot ~motor ~speed ~acc] set the speed and +val set_velocity : t -> motor : Types.motor -> velocity : int -> acceleration : int -> unit Lwt.t + (** [set_velocity krobot ~motor ~velocity ~acc] set the velocity and acceleration for the specified motors. *) +val set_velocities : t -> velocities : int * int -> accelerations : int * int -> unit Lwt.t + (** [set_velocities krobot ~velocities ~accelerations] sets both + velocities at the same time. *) + val inhibit_forward : t -> float -> unit Lwt.t (** [inhibit_forward krobot delay] forbid forward moves during [delay] seconds *) diff --git a/PC_Mainboard/tests/double_move.ml b/PC_Mainboard/tests/double_move.ml index b0758b4..005147c 100644 --- a/PC_Mainboard/tests/double_move.ml +++ b/PC_Mainboard/tests/double_move.ml @@ -16,10 +16,10 @@ let print_result = function lwt () = lwt krobot = Krobot.create () in print_endline "first move"; - lwt result = Krobot.move krobot ~dist:(-500) ~speed:100 ~acc:200 in + lwt result = Krobot.move krobot ~distance:(-500) ~velocity:100 ~acceleration:200 in print_result result; print_endline "second move"; - lwt result = Krobot.move krobot ~dist:200 ~speed:100 ~acc:200 in + lwt result = Krobot.move krobot ~distance:200 ~velocity:100 ~acceleration:200 in print_result result; print_endline "done"; return () diff --git a/PC_Mainboard/tests/stop_and_restart.ml b/PC_Mainboard/tests/stop_and_restart.ml index 8632258..ab193a0 100644 --- a/PC_Mainboard/tests/stop_and_restart.ml +++ b/PC_Mainboard/tests/stop_and_restart.ml @@ -12,12 +12,12 @@ open Lwt lwt () = lwt krobot = Krobot.create () in print_endline "moving forward"; - let t = Krobot.move krobot ~dist:1000 ~speed:100 ~acc:200 in + let t = Krobot.move krobot ~distance:1000 ~velocity:100 ~acceleration:200 in lwt () = Lwt_unix.sleep 2.0 in print_endline "stopping motors"; lwt () = Krobot.stop_motors krobot `Both `Smooth in print_endline "waiting for trajectory to terminates"; lwt _ = t in print_endline "mobing backward"; - lwt _ = Krobot.move krobot ~dist:(-200) ~speed:100 ~acc:200 in + lwt _ = Krobot.move krobot ~distance:(-200) ~velocity:100 ~acceleration:200 in return () hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-23 12:09:28
|
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 c0d1d60462dfc4bf44bdc73eb14937bc048a6afc (commit) from 6abe826b5278a9447436ef4209a6db4e8804799d (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 c0d1d60462dfc4bf44bdc73eb14937bc048a6afc Author: Jérémie Dimino <je...@di...> Date: Tue Feb 23 13:08:44 2010 +0100 Generate code for common requests/commands ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/driver/driver.ml b/PC_Mainboard/driver/driver.ml index 6e1170c..2a23af1 100644 --- a/PC_Mainboard/driver/driver.ml +++ b/PC_Mainboard/driver/driver.ml @@ -243,14 +243,6 @@ struct include OBus.MakeInterface(struct let name = "fr.krobot.Device.Motors" end) (* +---------------------------------------------------------------+ - | Dispatching | - +---------------------------------------------------------------+ *) - - (* The dispatcher *) -(* let *) - - - (* +---------------------------------------------------------------+ | High-level movement | +---------------------------------------------------------------+ *) @@ -578,7 +570,7 @@ end let rec monitor_card ~name ~vendor_id ~product_id ~set on_up on_down = match try `Handle(USB.open_device_with ~vendor_id ~product_id) with exn -> `Error exn with | `Error exn -> - lwt () = Log.exn_f exn "failed to open %s card" name in + lwt () = Log.info_f "failed to open %s card: %s" name (Printexc.to_string exn) in restart_card ~name ~vendor_id ~product_id ~set on_up on_down | `Handle handle -> lwt () = Log.info_f "%s card opened" name in @@ -601,7 +593,7 @@ let rec monitor_card ~name ~vendor_id ~product_id ~set on_up on_down = | `Closed -> return () | `Error exn -> - Log.exn_f exn "%s card crashed with" name + Log.info_f "%s card crashed: %s" name (Printexc.to_string exn) in restart_card ~name ~vendor_id ~product_id ~set on_up on_down | `Error exn -> diff --git a/PC_Mainboard/generators/gen_dbus_imports.ml b/PC_Mainboard/generators/gen_dbus_imports.ml index 6db0ef4..9fe5e5f 100644 --- a/PC_Mainboard/generators/gen_dbus_imports.ml +++ b/PC_Mainboard/generators/gen_dbus_imports.ml @@ -16,7 +16,7 @@ let rec print indent = function List.iter (function | Arg(name, typ) -> - printf "%s -> " typ.caml_type + printf "%s : %s -> " (Name.lid name) typ.caml_type | Cst _ -> ()) req.req_args; @@ -48,6 +48,19 @@ let rec print indent = function cmd.cmd_args; printf "unit\n"; + | Module("common", items) -> + printf "%smodule Common = struct\n" indent; + printf "%s let proxy krobot (card : Krobot.Card.card) =\n" indent; + printf "%s OBus_proxy.make (Krobot.peer krobot)\n" indent; + printf "%s [\"fr\"; \"krobot\"; \"Cards\"; (match card with\n" indent; + printf "%s | `Interface -> \"Interface\"\n" indent; + printf "%s | `Sensor -> \"Sensor\"\n" indent; + printf "%s | `Motor -> \"Motor\")]\n" indent; + printf "%s let op_method_call member typ krobot card =\n" indent; + printf "%s OBus_proxy.method_call (proxy krobot card) ~interface:\"fr.krobot.Card.Unsafe\" ~member typ\n" indent; + List.iter (print (indent ^ " ")) items; + printf "%send\n" indent + | Module(name, items) -> printf "%smodule %s = struct\n" indent (Name.uid name); printf "%s include MakeDevice(struct let name = \"%s\" end)\n" indent (Name.caml_case name); @@ -70,7 +83,7 @@ module MakeDevice(Name : sig val name : string end) = let get krobot = OBus_proxy.make (Krobot.peer krobot) [\"fr\"; \"krobot\"; \"Devices\"; Name.name] end) (struct - let name = \"fr.krobot.Device.\" ^ Name.name + let name = \"fr.krobot.Device.\" ^ Name.name ^ \".Unsafe\" end) "; List.iter (print "") interface diff --git a/PC_Mainboard/generators/gen_script_commands.ml b/PC_Mainboard/generators/gen_script_commands.ml index 68cbc35..42e21a4 100644 --- a/PC_Mainboard/generators/gen_script_commands.ml +++ b/PC_Mainboard/generators/gen_script_commands.ml @@ -56,6 +56,19 @@ let rec print path caml_path = function | Record _ -> () | Module(name, items) -> + let items = + if name = "common" then begin + printf "let __type_card name = keyword name [(\"interface\", `Interface); (\"sensor\", `Sensor); (\"motor\", `Motor)] in\n"; + let card = typ "card" in + List.map + (function + | Request req -> Request{ req with req_args = Arg("card", card) :: req.req_args } + | Command cmd -> Command{ cmd with cmd_args = Arg("card", card) :: cmd.cmd_args } + | item -> item) + items + end else + items + in List.iter (print (sprintf "%s; \"%s\"" path (String.lowercase name)) (caml_path ^ Name.uid name ^ ".")) items let () = diff --git a/PC_Mainboard/lib_krobot/krobot.ml b/PC_Mainboard/lib_krobot/krobot.ml index 6657a67..7660c91 100644 --- a/PC_Mainboard/lib_krobot/krobot.ml +++ b/PC_Mainboard/lib_krobot/krobot.ml @@ -203,14 +203,6 @@ struct | `Sensor -> krobot.sensor.card_state | `Motor -> krobot.motor.card_state - include OBus_interface.Make(struct let name = "fr.krobot.Card" end) - - OP_method GetFirmwareBuild : string - OP_method GetBoardInfo : string - OP_method Bootloader : unit - OP_method Reset : unit - OP_method Test : unit - let proxy krobot card = OBus_proxy.make krobot.peer ["fr"; "krobot"; "Cards"; (match card with @@ -218,9 +210,12 @@ struct | `Sensor -> "Sensor" | `Motor -> "Motor")] - 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) - let reset krobot card = reset (proxy krobot card) - let test krobot card = test (proxy krobot card) + let op_method_call member typ krobot card = + OBus_proxy.method_call (proxy krobot card) ~interface:"fr.krobot.Card" ~member typ + + OP_method GetFirmwareBuild : string + OP_method GetBoardInfo : string + OP_method Bootloader : unit + OP_method Reset : unit + OP_method Test : unit end hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-23 09:31: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 6abe826b5278a9447436ef4209a6db4e8804799d (commit) from 00d6bb9fa4015d784fa097f489b8621d392078f6 (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 6abe826b5278a9447436ef4209a6db4e8804799d Author: Jérémie Dimino <je...@di...> Date: Tue Feb 23 10:30:54 2010 +0100 [controller] reorganise commands into a tree ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/controller.ml b/PC_Mainboard/clients/controller.ml index 1d45d75..c455713 100644 --- a/PC_Mainboard/clients/controller.ml +++ b/PC_Mainboard/clients/controller.ml @@ -116,13 +116,14 @@ let rec loop krobot history = let line = Text.strip (Engine.all_input (React.S.value engine_state)) in if line = "exit" then save_history history - else begin + else if line <> "" then begin let history = Lwt_read_line.add_entry line history in set_engine_state (Engine.init history); lwt () = Log.notice line in ignore (Script.exec ~krobot ~logger:(fun line -> log_add_line line; return ()) ~command:line); loop krobot history - end + end else + loop krobot history | Command.Complete -> let engine_state = Engine.reset (React.S.value engine_state) in let before, after = Engine.edition_state engine_state in diff --git a/PC_Mainboard/clients/script.ml b/PC_Mainboard/clients/script.ml index c376e68..7918b02 100644 --- a/PC_Mainboard/clients/script.ml +++ b/PC_Mainboard/clients/script.ml @@ -19,22 +19,76 @@ let set_of_list l = List.fold_left (fun set x -> TextSet.add x set) TextSet.empt | Completion | +-----------------------------------------------------------------+ *) -let rec args_of_command command = function - | { c_name = name; c_args = args } :: _ when name = command -> - Some args - | _ :: rest -> - args_of_command command rest - | [] -> - None +let decompose name = + match Text.rev_split ~sep:"." ~max:2 name with + | [] -> + ([], "") + | [name] -> + ([], name) + | [path; name] -> + (Text.split ~sep:"." path, name) + | _ -> + assert false + +let args_of_command name = + let path, name = decompose name in + let rec loop = function + | cmd :: _ when cmd.c_path = path && cmd.c_name = name -> + Some cmd.c_args + | _ :: rest -> + loop rest + | [] -> + None + in + loop !commands + +let rec after_prefix prefix path = + match prefix, path with + | [], p -> Some p + | e1 :: p1, e2 :: p2 when e1 = e2 -> after_prefix p1 p2 + | _ -> None let complete ~before ~after = try match Script_lexer.partial_command (Lexing.from_string before) with - | `Command(before, name) -> - Lwt_read_line.complete ~suffix:" " before name after - (set_of_list (List.map (fun command -> command.c_name) !commands)) + | `Command(before, name) -> begin + let full_path, path, name = + match Text.rev_split ~sep:"." ~max:2 name with + | [] -> + ("", [], "") + | [name] -> + ("", [], name) + | [path; name] -> + (path ^ ".", Text.split ~sep:"." path, name) + | _ -> + assert false + in + let paths, names = + (List.fold_left + (fun (paths, names) command -> + match after_prefix path command.c_path with + | None -> + (paths, names) + | Some [] -> + (paths, TextSet.add command.c_name names) + | Some (name :: rest) -> + (TextSet.add name paths, names)) + (TextSet.empty, TextSet.empty) !commands) + in + let prefix, words = Lwt_read_line.lookup name names in + match TextSet.cardinal words with + | 0 -> + Lwt_read_line.complete ~suffix:"." (before ^ full_path) name after paths + | 1 -> + { Lwt_read_line.comp_state = (before ^ full_path ^ prefix ^ " ", after); + Lwt_read_line.comp_words = words } + | _ -> + { Lwt_read_line.comp_state = (before ^ full_path ^ prefix, after); + Lwt_read_line.comp_words = words } + end + | `Arg(before, name, args, `Key key) -> begin - match args_of_command name !commands with + match args_of_command name with | None -> raise Exit | Some args' -> @@ -44,7 +98,7 @@ let complete ~before ~after = 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 + match args_of_command name with | None -> raise Exit | Some args' -> @@ -74,11 +128,12 @@ let exec ~krobot ~logger ~command = | `Fail exn -> logger [fg lred; textf "parse failure: %s" (Printexc.to_string exn)] | `OK(name, args) -> + let path, name = decompose name in try let rec search = function | [] -> logger [fg lred; textf "unknown command '%s'" name] - | cmd :: rest when cmd.c_name <> name -> + | cmd :: rest when cmd.c_path <> path || cmd.c_name <> name -> search rest | cmd :: _ -> cmd.c_exec args logger krobot @@ -204,27 +259,27 @@ let () = and timeout = int ~default:100 "timeout" and now = keyword ~default:`Now "mode" [("now", `Now); ("action", `Action)] in - register "ax12-goto" (f4 id pos speed now) + register ~path:["ax12"] "goto" (f4 id pos speed now) (fun logger krobot id pos speed now -> Krobot_unsafe.AX12.goto krobot id pos speed now); - register "ax12-ping" (f2 id timeout) + register ~path:["ax12"] "ping" (f2 id timeout) (fun logger krobot id timeout -> Krobot_unsafe.AX12.ping krobot id timeout >>= function - | 0 -> logger [textf "ax12-ping[%d] reply: " id; fg lred; text "timeout"] - | _ -> logger [textf "ax12-ping[%d] reply: " id; fg lgreen; text "success"]); - register "ax12-get-pos" (f2 id timeout) + | 0 -> logger [textf "ping[%d] reply: " id; fg lred; text "timeout"] + | _ -> logger [textf "ping[%d] reply: " id; fg lgreen; text "success"]); + register ~path:["ax12"] "get-pos" (f2 id timeout) (fun logger krobot id timeout -> lwt x = Krobot_unsafe.AX12.get_position krobot id timeout in - logger [textf "ax12-position[%d]: %d" id x]); - register "ax12-get-speed" (f2 id timeout) + logger [textf "position[%d]: %d" id x]); + register ~path:["ax12"] "get-speed" (f2 id timeout) (fun logger krobot id timeout -> lwt x = Krobot_unsafe.AX12.get_velocity krobot id timeout in - logger [textf "ax12-speed[%d]: %d" id x]); - register "ax12-get-load" (f2 id timeout) + logger [textf "speed[%d]: %d" id x]); + register ~path:["ax12"] "get-load" (f2 id timeout) (fun logger krobot id timeout -> lwt x = Krobot_unsafe.AX12.get_load krobot id timeout in - logger [textf "ax12-load[%d]: %d" id x]); - register "ax12-stats" (f2 id timeout) + logger [textf "load[%d]: %d" id x]); + register ~path:["ax12"] "stats" (f2 id timeout) (fun logger krobot id timeout -> lwt stats = Krobot_unsafe.AX12.get_stats krobot id timeout in lwt () = logger [textf "ax12[%d] position = %d" id stats.Types.ax12_position] in @@ -235,7 +290,7 @@ let () = lwt () = logger [textf "ax12[%d] cw-angle-limit = %d" id stats.Types.ax12_cw_angle_limit] in lwt () = logger [textf "ax12[%d] ccw-angle-limit = %d" id stats.Types.ax12_ccw_angle_limit] in return ()); - register "ax12-action" (f1 (int ~default:254 "id")) + register ~path:["ax12"] "action" (f1 (int ~default:254 "id")) (fun logger krobot id -> Krobot_unsafe.AX12.action krobot id) diff --git a/PC_Mainboard/clients/script_commands.ml b/PC_Mainboard/clients/script_commands.ml index a86a01d..9cddb97 100644 --- a/PC_Mainboard/clients/script_commands.ml +++ b/PC_Mainboard/clients/script_commands.ml @@ -23,6 +23,9 @@ type command = { c_name : string; (* The command name *) + c_path : string list; + (* The path of the command *) + c_exec : (string * string) list -> logger -> Krobot.t -> unit Lwt.t; (* The command implementation. It takes as argument the list of parameters. *) @@ -52,9 +55,10 @@ type 'a func = { let commands = ref [] (* Register a command *) -let register name func f = +let register ?(path=[]) name func f = let command = { c_name = name; + c_path = path; c_exec = (fun args logger krobot -> func.f_func args (f logger krobot)); c_args = func.f_args; } in diff --git a/PC_Mainboard/clients/script_lexer.mll b/PC_Mainboard/clients/script_lexer.mll index 46d64fc..fa5a9a9 100644 --- a/PC_Mainboard/clients/script_lexer.mll +++ b/PC_Mainboard/clients/script_lexer.mll @@ -26,7 +26,7 @@ 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 identbody = [ 'A'-'Z' 'a'-'z' '_' '-' '\'' '0' - '9' '.' ] let ident = identstart identbody* let maybe_ident = "" | ident diff --git a/PC_Mainboard/generators/gen_script_commands.ml b/PC_Mainboard/generators/gen_script_commands.ml index 036f42f..68cbc35 100644 --- a/PC_Mainboard/generators/gen_script_commands.ml +++ b/PC_Mainboard/generators/gen_script_commands.ml @@ -10,8 +10,9 @@ open Printf open Interface -let print_common prefix path name args = - printf " register \"unsafe-%s%s\" (f%d" prefix name +let print_common path caml_path name args = + printf " register ~path:[%s] \"%s\" (f%d" + path name (List.fold_left (fun n arg -> match arg with | Arg _ -> n + 1 | Cst _ -> n) 0 args); @@ -32,7 +33,7 @@ let print_common prefix path name args = | Cst _ -> ()) args; printf " ->\n"; - printf " lwt _ = Krobot_unsafe.%s%s krobot" path (Name.lid name); + printf " lwt _ = Krobot_unsafe.%s%s krobot" caml_path (Name.lid name); List.iter (function | Arg(name, typ) -> printf " %s" (Name.lid name) @@ -41,11 +42,11 @@ let print_common prefix path name args = printf " in\n"; printf " Lwt.return ());\n" -let rec print prefix path = function +let rec print path caml_path = function | Request req -> - print_common prefix path req.req_name req.req_args + print_common path caml_path req.req_name req.req_args | Command cmd -> - print_common prefix path cmd.cmd_name cmd.cmd_args + print_common path caml_path cmd.cmd_name cmd.cmd_args | Enum enum -> printf " let __type_%s name = keyword name [" (Name.lid enum.enum_name); List.iter (fun (name, code) -> @@ -55,10 +56,10 @@ let rec print prefix path = function | Record _ -> () | Module(name, items) -> - List.iter (print (prefix ^ String.lowercase name ^ "-") (path ^ Name.uid name ^ ".")) items + List.iter (print (sprintf "%s; \"%s\"" path (String.lowercase name)) (caml_path ^ Name.uid name ^ ".")) items let () = printf "open Script_commands\n"; printf "let register () =\n"; - List.iter (print "" "") (List.filter (function Module _ -> true | _ -> false) interface); + List.iter (print "\"unsafe\"" "") (List.filter (function Module _ -> true | _ -> false) interface); printf " ()" hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-23 00:40: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 00d6bb9fa4015d784fa097f489b8621d392078f6 (commit) via 6957a1aa373af9614710b18c193c3d062d61d14e (commit) via 57ed3996de596341ae3996edf376de366d39eb2f (commit) from 6945591b460b0b5106b07685b69b78d6407cacf1 (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 00d6bb9fa4015d784fa097f489b8621d392078f6 Author: Jérémie Dimino <je...@di...> Date: Tue Feb 23 01:34:29 2010 +0100 typo commit 6957a1aa373af9614710b18c193c3d062d61d14e Author: Jérémie Dimino <je...@di...> Date: Tue Feb 23 01:15:05 2010 +0100 remove lowlevel ax12 commands form safe commands commit 57ed3996de596341ae3996edf376de366d39eb2f Author: Jérémie Dimino <je...@di...> Date: Tue Feb 23 01:11:00 2010 +0100 renaming ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/script.ml b/PC_Mainboard/clients/script.ml index e6d4844..c376e68 100644 --- a/PC_Mainboard/clients/script.ml +++ b/PC_Mainboard/clients/script.ml @@ -202,8 +202,6 @@ let () = and pos = int "pos" and speed = int ~default:50 "speed" and timeout = int ~default:100 "timeout" - and reg = int "reg" - and value = int "value" and now = keyword ~default:`Now "mode" [("now", `Now); ("action", `Action)] in register "ax12-goto" (f4 id pos speed now) @@ -214,20 +212,6 @@ let () = Krobot_unsafe.AX12.ping krobot id timeout >>= function | 0 -> logger [textf "ax12-ping[%d] reply: " id; fg lred; text "timeout"] | _ -> logger [textf "ax12-ping[%d] reply: " id; fg lgreen; text "success"]); - register "ax12-read8" (f3 id reg timeout) - (fun logger krobot id reg timeout -> - lwt x = Krobot_unsafe.AX12.read8 krobot id reg timeout in - logger [textf "ax12-read8[%d] reply: %d" id x]); - register "ax12-read16" (f3 id reg timeout) - (fun logger krobot id reg timeout -> - lwt x = Krobot_unsafe.AX12.read16 krobot id reg timeout in - logger [textf "ax12-read16[%d] reply: %d" id x]); - register "ax12-write8" (f3 id reg value) - (fun logger krobot id reg value -> - Krobot_unsafe.AX12.write8 krobot id reg value); - register "ax12-write16" (f3 id reg value) - (fun logger krobot id reg value -> - Krobot_unsafe.AX12.write16 krobot id reg value); register "ax12-get-pos" (f2 id timeout) (fun logger krobot id timeout -> lwt x = Krobot_unsafe.AX12.get_position krobot id timeout in @@ -251,12 +235,6 @@ let () = lwt () = logger [textf "ax12[%d] cw-angle-limit = %d" id stats.Types.ax12_cw_angle_limit] in lwt () = logger [textf "ax12[%d] ccw-angle-limit = %d" id stats.Types.ax12_ccw_angle_limit] in return ()); - register "ax12-write-reg8" (f3 id reg value) - (fun logger krobot id reg value -> - Krobot_unsafe.AX12.write_register8 krobot id reg value); - register "ax12-write-reg16" (f3 id reg value) - (fun logger krobot id reg value -> - Krobot_unsafe.AX12.write_register16 krobot id reg value); register "ax12-action" (f1 (int ~default:254 "id")) (fun logger krobot id -> Krobot_unsafe.AX12.action krobot id) diff --git a/PC_Mainboard/driver/driver.ml b/PC_Mainboard/driver/driver.ml index 06ef21d..6e1170c 100644 --- a/PC_Mainboard/driver/driver.ml +++ b/PC_Mainboard/driver/driver.ml @@ -39,7 +39,7 @@ struct OL_method Get : int = fun dev -> return dev.data let rec loop dev = - lwt data = Commands.Compass.get dev.card in + lwt data = USB_commands.Compass.get dev.card in if data <> dev.data then begin dev.data <- data; lwt () = value dev data in @@ -50,7 +50,7 @@ struct loop dev let make card path = - lwt data = Commands.Compass.get card in + lwt data = USB_commands.Compass.get card in let dev = { obus = OBus_object.make path; card = card; @@ -112,7 +112,7 @@ struct OL_method Get : bool array = fun dev -> return dev.data let rec loop dev = - lwt data = Commands.Logic_sensors.get_state dev.card in + lwt data = USB_commands.Logic_sensors.get_state dev.card in if data <> dev.data then begin dev.data <- data; lwt () = value dev data in @@ -156,17 +156,17 @@ struct OL_signal Value : int array OL_method Get : int array = fun dev -> return dev.data OL_method GetCalibration : int -> int array = fun dev num -> - Commands.Range_finders.get_calibration dev.card num + USB_commands.Range_finders.get_calibration dev.card num OL_method CalibrationStart : int -> bool -> unit = fun dev num skip_meas -> - Commands.Range_finders.calibration_start dev.card num skip_meas + USB_commands.Range_finders.calibration_start dev.card num skip_meas OL_method CalibrationStop : unit = fun dev -> - Commands.Range_finders.calibration_stop dev.card + USB_commands.Range_finders.calibration_stop dev.card OL_method CalibrationContinue : unit = fun dev -> - Commands.Range_finders.calibration_continue dev.card + USB_commands.Range_finders.calibration_continue dev.card let rec loop dev = - lwt data = Commands.Range_finders.get_state dev.card in + lwt data = USB_commands.Range_finders.get_state dev.card in if data <> dev.data then begin dev.data <- data; lwt () = value dev data in @@ -279,9 +279,9 @@ struct dev.move_state <- Ms_moving(if dist > 0 then `Forward else `Backward); lwt () = if dist > 0 then - Commands.Motor.forward dev.card dist speed acc + USB_commands.Motor.forward dev.card dist speed acc else - Commands.Motor.backward dev.card (-dist) speed acc + USB_commands.Motor.backward dev.card (-dist) speed acc and _ = Lwt_event.next dev.traj_completed in let result = match dev.move_state with | Ms_stopping -> @@ -303,9 +303,9 @@ struct dev.move_state <- Ms_moving `Turn; lwt () = if angle > 0 then - Commands.Motor.right dev.card angle speed acc + USB_commands.Motor.right dev.card angle speed acc else - Commands.Motor.left dev.card (-angle) speed acc + USB_commands.Motor.left dev.card (-angle) speed acc and _ = Lwt_event.next dev.traj_completed in let result = match dev.move_state with | Ms_stopping -> @@ -323,7 +323,7 @@ struct | Ms_static -> reset_speed dev; dev.move_state <- Ms_moving `Goto; - lwt () = Commands.Motor.goto dev.card ~x ~y ~velocity:speed ~acceleration:acc ~mode ~bypass_distance and _ = Lwt_event.next dev.traj_completed in + lwt () = USB_commands.Motor.goto dev.card ~x ~y ~velocity:speed ~acceleration:acc ~mode ~bypass_distance and _ = Lwt_event.next dev.traj_completed in let result = match dev.move_state with | Ms_stopping -> `Stopped @@ -354,7 +354,7 @@ struct let stop_motors dev motor mode = lwt () = Log.info_f "motor: stopping(motor=%s, mode=%s)" (string_of_motor motor) (string_of_stop_mode mode) in stop_move dev; - Commands.Motor.traj_stop dev.card motor mode + USB_commands.Motor.traj_stop dev.card motor mode let set_speed dev motor speed acc = lwt () = Log.info_f "motor: set_speed(motor=%s, speed=%d, acc=%d)" (string_of_motor motor) speed acc in @@ -371,11 +371,11 @@ struct lwt () = if acc <> dev.acceleration then begin dev.acceleration <- acc; - Commands.Motor.traj_new_velocity dev.card motor abs_speed acc dir + USB_commands.Motor.traj_new_velocity dev.card motor abs_speed acc dir end else - Commands.Motor.traj_change_velocity dev.card motor abs_speed dir + USB_commands.Motor.traj_change_velocity dev.card motor abs_speed dir in - lwt () = Commands.Motor.traj_start dev.card motor in + lwt () = USB_commands.Motor.traj_start dev.card motor in (* Stop motors after a small delay *) if motor = `Both || motor = `Left then begin cancel dev.stop_lthread; @@ -539,19 +539,19 @@ struct return `Present OL_method GetFirmwareBuild : string = fun dev -> - Commands.get_firmware_build (get_card dev) + USB_commands.Common.get_firmware_build (get_card dev) OL_method GetBoardInfo : string = fun dev -> - Commands.get_board_info (get_card dev) + USB_commands.Common.get_board_info (get_card dev) OL_method Bootloader : unit = fun dev -> - Commands.bootloader (get_card dev) + USB_commands.Common.bootloader (get_card dev) OL_method Reset : unit = fun dev -> - Commands.reset (get_card dev) + USB_commands.Common.reset (get_card dev) OL_method Test : unit = fun dev -> - Commands.test (get_card dev) + USB_commands.Common.test (get_card dev) OL_signal StateChanged : Types.card_state @@ -671,7 +671,7 @@ lwt () = ignore begin monitor_card ~name:"interace" ~vendor_id:PcInterface.usb_vid ~product_id:PcInterface.usb_pid_robot_interface ~set:set_card_interface (fun card -> - lwt () = Commands.Motor.enable card `Both in + lwt () = USB_commands.Motor.enable card `Both in lwt () = Compass.OBus.export bus =|< Compass.make card ["fr"; "krobot"; "Devices"; "Compass"] and () = AX12.OBus.export bus =|< AX12.make card ["fr"; "krobot"; "Devices"; "AX12"] in return ()) @@ -696,7 +696,7 @@ lwt () = ignore begin monitor_card ~name:"motor" ~vendor_id:PcInterface.usb_vid ~product_id:PcInterface.usb_pid_motor_controller ~set:set_card_motor (fun card -> - lwt () = Commands.Motor.enable card `Both and () = Commands.Motor.traj_init card in + lwt () = USB_commands.Motor.enable card `Both and () = USB_commands.Motor.traj_init card in lwt () = Motors.OBus.export bus =|< Motors.make card ["fr"; "krobot"; "Devices"; "Motors"] in return ()) (fun () -> diff --git a/PC_Mainboard/generators/gen_dbus_exports.ml b/PC_Mainboard/generators/gen_dbus_exports.ml new file mode 100644 index 0000000..f3b0531 --- /dev/null +++ b/PC_Mainboard/generators/gen_dbus_exports.ml @@ -0,0 +1,87 @@ +(* + * gen_dbus_exports.ml + * ------------------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Printf +open Interface + +let rec print_apply cmd args = + printf "(fun dev "; + List.iter + (function + | Arg(name, typ) -> + printf "%s " (Name.lid name) + | Cst _ -> + ()) + args; + printf "-> %s" cmd; + List.iter + (function + | Arg(name, typ) -> + printf " %s" (Name.lid name) + | Cst _ -> + ()) + args; + printf ")\n" + +let rec print path indent = function + | Request req -> + printf "%sOL_method %s : " indent (Name.caml_case req.req_name); + List.iter + (function + | Arg(name, typ) -> + printf "%s -> " typ.caml_type + | Cst _ -> + ()) + req.req_args; + let repl = + List.map + (function + | Arg(name, typ) -> (name, typ) + | Cst _ -> failwith "constants are not allowed in replies") + req.req_repl + in + let () = + match repl with + | [] -> + printf "unit" + | (name, typ) :: rest -> + printf "%s" typ.caml_type; + List.iter (fun (name, typ) -> printf " * %s" typ.caml_type) rest + in + printf " = "; + print_apply (sprintf "USB_commands.%s%s (Get.get dev)" path (Name.lid req.req_name)) req.req_args + + | Command cmd -> + printf "%sOL_method %s : " indent (Name.caml_case cmd.cmd_name); + List.iter + (function + | Arg(name, typ) -> + printf "%s -> " typ.caml_type + | Cst _ -> + ()) + cmd.cmd_args; + printf "unit = "; + print_apply (sprintf "USB_commands.%s%s (Get.get dev)" path (Name.lid cmd.cmd_name)) cmd.cmd_args + + | Module(name, items) -> + printf "%smodule %s(M : Object.S)(Get : sig val get : M.t -> Card.t end)(Name : OBus_interface.Name) = struct\n" + indent (Name.uid name); + printf "%s include M.MakeInterface(Name)\n" indent; + List.iter (print (path ^ Name.uid name ^ ".") (indent ^ " ")) items; + printf "%send\n" indent + + | Enum enum -> + printf "%stype %s = Types.%s with obus\n" indent (Name.lid enum.enum_name) (Name.lid enum.enum_name) + + | Record record -> + printf "%stype %s = Types.%s with obus\n" indent (Name.lid record.rec_name) (Name.lid record.rec_name) + +let () = + printf "open OBus_pervasives\n"; + List.iter (print "" "") interface diff --git a/PC_Mainboard/generators/gen_dbus_imports.ml b/PC_Mainboard/generators/gen_dbus_imports.ml new file mode 100644 index 0000000..6db0ef4 --- /dev/null +++ b/PC_Mainboard/generators/gen_dbus_imports.ml @@ -0,0 +1,76 @@ +(* + * gen_dbus_imports.ml + * ------------------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Printf +open Interface + +let rec print indent = function + | Request req -> + printf "%sOP_method %s : " indent (Name.caml_case req.req_name); + List.iter + (function + | Arg(name, typ) -> + printf "%s -> " typ.caml_type + | Cst _ -> + ()) + req.req_args; + let repl = + List.map + (function + | Arg(name, typ) -> (name, typ) + | Cst _ -> failwith "constants are not allowed in replies") + req.req_repl + in + let () = + match repl with + | [] -> + printf "unit" + | (name, typ) :: rest -> + printf "%s" typ.caml_type; + List.iter (fun (name, typ) -> printf " * %s" typ.caml_type) rest + in + printf "\n" + + | Command cmd -> + printf "%sOP_method %s : " indent (Name.caml_case cmd.cmd_name); + List.iter + (function + | Arg(name, typ) -> + printf "%s -> " typ.caml_type + | Cst _ -> + ()) + cmd.cmd_args; + printf "unit\n"; + + | Module(name, items) -> + printf "%smodule %s = struct\n" indent (Name.uid name); + printf "%s include MakeDevice(struct let name = \"%s\" end)\n" indent (Name.caml_case name); + List.iter (print (indent ^ " ")) items; + printf "%send\n" indent + + | Enum enum -> + printf "%stype %s = Types.%s with obus\n" indent (Name.lid enum.enum_name) (Name.lid enum.enum_name) + + | Record record -> + printf "%stype %s = Types.%s with obus\n" indent (Name.lid record.rec_name) (Name.lid record.rec_name) + +let () = + print_string "\ +open OBus_pervasives +module MakeDevice(Name : sig val name : string end) = + OBus_interface.MakeCustom + (struct + type proxy = Krobot.t + let get krobot = OBus_proxy.make (Krobot.peer krobot) [\"fr\"; \"krobot\"; \"Devices\"; Name.name] + end) + (struct + let name = \"fr.krobot.Device.\" ^ Name.name + end) +"; + List.iter (print "") interface diff --git a/PC_Mainboard/generators/gen_script_commands.ml b/PC_Mainboard/generators/gen_script_commands.ml new file mode 100644 index 0000000..036f42f --- /dev/null +++ b/PC_Mainboard/generators/gen_script_commands.ml @@ -0,0 +1,64 @@ +(* + * gen_script_commands.ml + * ---------------------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Printf +open Interface + +let print_common prefix path name args = + printf " register \"unsafe-%s%s\" (f%d" prefix name + (List.fold_left (fun n arg -> match arg with + | Arg _ -> n + 1 + | Cst _ -> n) 0 args); + List.iter (function + | Arg(name, { caml_type = "int" }) -> + printf " (int \"%s\")" name + | Arg(name, { caml_type = "bool" }) -> + printf " (keyword \"%s\" [(\"false\", false); (\"true\", true)])" name + | Arg(name, { caml_type = caml_type }) -> + printf " (__type_%s \"%s\")" caml_type name + | Cst _ -> + ()) args; + printf ")\n"; + printf " (fun logger krobot"; + List.iter (function + | Arg(name, typ) -> + printf " %s" (Name.lid name) + | Cst _ -> + ()) args; + printf " ->\n"; + printf " lwt _ = Krobot_unsafe.%s%s krobot" path (Name.lid name); + List.iter (function + | Arg(name, typ) -> + printf " %s" (Name.lid name) + | Cst _ -> + ()) args; + printf " in\n"; + printf " Lwt.return ());\n" + +let rec print prefix path = function + | Request req -> + print_common prefix path req.req_name req.req_args + | Command cmd -> + print_common prefix path cmd.cmd_name cmd.cmd_args + | Enum enum -> + printf " let __type_%s name = keyword name [" (Name.lid enum.enum_name); + List.iter (fun (name, code) -> + printf "(\"%s\", `%s);" name (Name.uid name)) + enum.enum_keys; + printf "] in\n" + | Record _ -> + () + | Module(name, items) -> + List.iter (print (prefix ^ String.lowercase name ^ "-") (path ^ Name.uid name ^ ".")) items + +let () = + printf "open Script_commands\n"; + printf "let register () =\n"; + List.iter (print "" "") (List.filter (function Module _ -> true | _ -> false) interface); + printf " ()" diff --git a/PC_Mainboard/generators/gen_usb_commands.ml b/PC_Mainboard/generators/gen_usb_commands.ml new file mode 100644 index 0000000..af190a9 --- /dev/null +++ b/PC_Mainboard/generators/gen_usb_commands.ml @@ -0,0 +1,105 @@ +(* + * gen_usb_commands.ml + * ------------------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(* Generate implementation for all USB commands used by the driver *) + +open Printf +open Interface + +let print_common indent name args = + printf "%slet %s card" indent (Name.lid name); + List.iter (function + | Arg(name, typ) -> + printf " ~%s" (Name.lid name) + | Cst _ -> + ()) args; + printf " =\n"; + printf "%s let data = Card.make_buffer () in\n" indent; + if args <> [] then begin + printf "%s let writer = RW.writer data in\n" indent; + List.iter + (function + | Arg(name, typ) -> + printf "%s %s;\n" indent (typ.writer (Name.lid name)) + | Cst(typ, value) -> + printf "%s %s;\n" indent (typ.writer (string_of_int value))) + args + end + +let rec print indent = function + | Request req -> + print_common indent req.req_name req.req_args; + printf "%s lwt data = Card.send_request card %d data in\n" indent req.req_code; + if req.req_repl <> [] then begin + printf "%s let reader = RW.reader data in\n" indent; + let repl = + List.map + (function + | Arg(name, typ) -> + (Name.lid name, typ) + | Cst _ -> + failwith "constant are not allowed in replies") + req.req_repl + in + List.iter + (fun (name, typ) -> + printf "%s let %s = %s in\n" indent name typ.reader) + repl; + printf "%s return (%s)\n" indent (String.concat ", " (List.map fst repl)) + end else + printf "%s return ()\n" indent + | Command cmd -> + print_common indent cmd.cmd_name cmd.cmd_args; + printf "%s Card.send_command card %d data\n" indent cmd.cmd_code + | Enum enum -> + printf "%slet put_%s writer value =\n" indent (Name.lid enum.enum_name); + printf "%s let code = match value with\n" indent; + List.iter + (fun (name, code) -> + printf "%s | `%s -> %d\n" indent (Name.uid name) code) + enum.enum_keys; + printf "%s in\n" indent; + printf "%s %s\n" indent (enum.enum_type.writer "code"); + + printf "%slet get_%s reader =\n" indent (Name.lid enum.enum_name); + printf "%s match %s with\n" indent enum.enum_type.reader; + List.iter + (fun (name, code) -> + printf "%s | %d -> `%s\n" indent code (Name.uid name)) + enum.enum_keys; + printf "%s | n -> Printf.ksprintf failwith \"invalid value for '%s': %%d\" n\n" indent enum.enum_name + | Record record -> + printf "%slet put_%s writer value =\n" indent (Name.lid record.rec_name); + List.iter + (fun (name, typ) -> + printf "%s %s;\n" indent (typ.writer ("value.Types." ^ record.rec_prefix ^ Name.lid name))) + record.rec_args; + printf "%s ()\n" indent; + + printf "%slet get_%s reader =\n" indent (Name.lid record.rec_name); + List.iter + (fun (name, typ) -> + printf "%s let %s = %s in\n" indent (Name.lid name) typ.reader) + record.rec_args; + printf "%s { %s }\n" indent + (String.concat "; " + (List.map + (fun (name, typ) -> + let name = Name.lid name in + sprintf "Types.%s%s = %s" record.rec_prefix (Name.lid name) name) + record.rec_args)) + | Module(name, items) -> + printf "%smodule %s = struct\n" indent (Name.uid name); + List.iter (print (indent ^ " ")) items; + printf "%send\n" indent + +let () = + printf "open Lwt\n"; + printf "open RW\n"; + List.iter (print "") interface diff --git a/PC_Mainboard/interface/gen_dbus_exports.ml b/PC_Mainboard/interface/gen_dbus_exports.ml deleted file mode 100644 index a4e192b..0000000 --- a/PC_Mainboard/interface/gen_dbus_exports.ml +++ /dev/null @@ -1,99 +0,0 @@ -(* - * gen_dbus_exports.ml - * ------------------- - * Copyright : (c) 2010, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -open Printf -open Interface - -let rec print_apply cmd args = - printf "(fun dev "; - List.iter - (function - | Arg(name, typ) -> - printf "%s " (Utils.caml_lid name) - | Cst _ -> - ()) - args; - printf "-> %s" cmd; - List.iter - (function - | Arg(name, typ) -> - printf " %s" (Utils.caml_lid name) - | Cst _ -> - ()) - args; - printf ")\n" - -let rec print path indent = function - | Request req -> - printf "%sOL_method %s : " indent (Utils.caml_case req.req_name); - List.iter - (function - | Arg(name, typ) -> - printf "%s -> " typ.caml_type - | Cst _ -> - ()) - req.req_args; - let repl = - List.map - (function - | Arg(name, typ) -> (name, typ) - | Cst _ -> failwith "constants are not allowed in replies") - req.req_repl - in - let () = - match repl with - | [] -> - printf "unit" - | (name, typ) :: rest -> - printf "%s" typ.caml_type; - List.iter (fun (name, typ) -> printf " * %s" typ.caml_type) rest - in - printf " = "; - print_apply (sprintf "Commands.%s%s (Get.get dev)" path (Utils.caml_lid req.req_name)) req.req_args - - | Command cmd -> - printf "%sOL_method %s : " indent (Utils.caml_case cmd.cmd_name); - List.iter - (function - | Arg(name, typ) -> - printf "%s -> " typ.caml_type - | Cst _ -> - ()) - cmd.cmd_args; - printf "unit = "; - print_apply (sprintf "Commands.%s%s (Get.get dev)" path (Utils.caml_lid cmd.cmd_name)) cmd.cmd_args - - | Module(name, items) -> - printf "%smodule %s(M : Object.S)(Get : sig val get : M.t -> Card.t end)(Name : OBus_interface.Name) = struct\n" - indent (Utils.caml_uid name); - printf "%s include M.MakeInterface(Name)\n" indent; - List.iter (print (path ^ Utils.caml_uid name ^ ".") (indent ^ " ")) items; - printf "%send\n" indent - - | _ -> - () - -let rec split_top = function - | [] -> - ([], []) - | Module _ as item :: items -> - let modules, items = split_top items in - (item :: modules, items) - | item :: items -> - let modules, items = split_top items in - (modules, item :: items) - -let () = - let modules, items = split_top interface in - printf "open OBus_pervasives\n"; - printf "module Common(M : Object.S)(Get : sig val get : M.t -> Card.t end)(Name : OBus_interface.Name) = struct\n"; - printf " include M.MakeInterface(Name)\n"; - List.iter (print "" " ") items; - printf "end\n"; - List.iter (print "" "") modules diff --git a/PC_Mainboard/interface/gen_dbus_imports.ml b/PC_Mainboard/interface/gen_dbus_imports.ml deleted file mode 100644 index 098e686..0000000 --- a/PC_Mainboard/interface/gen_dbus_imports.ml +++ /dev/null @@ -1,73 +0,0 @@ -(* - * gen_dbus_imports.ml - * ------------------- - * Copyright : (c) 2010, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -open Printf -open Interface - -let rec print indent = function - | Request req -> - printf "%sOP_method %s : " indent (Utils.caml_case req.req_name); - List.iter - (function - | Arg(name, typ) -> - printf "%s -> " typ.caml_type - | Cst _ -> - ()) - req.req_args; - let repl = - List.map - (function - | Arg(name, typ) -> (name, typ) - | Cst _ -> failwith "constants are not allowed in replies") - req.req_repl - in - let () = - match repl with - | [] -> - printf "unit" - | (name, typ) :: rest -> - printf "%s" typ.caml_type; - List.iter (fun (name, typ) -> printf " * %s" typ.caml_type) rest - in - printf "\n" - - | Command cmd -> - printf "%sOP_method %s : " indent (Utils.caml_case cmd.cmd_name); - List.iter - (function - | Arg(name, typ) -> - printf "%s -> " typ.caml_type - | Cst _ -> - ()) - cmd.cmd_args; - printf "unit\n"; - - | Module(name, items) -> - printf "%smodule %s = struct\n" indent (Utils.caml_uid name); - printf "%s include MakeDevice(struct let name = \"%s\" end)\n" indent (Utils.caml_case name); - List.iter (print (indent ^ " ")) items; - printf "%send\n" indent - - | _ -> - () - -let () = - print_string "\ -open OBus_pervasives -module MakeDevice(Name : sig val name : string end) = - OBus_interface.MakeCustom - (struct - type proxy = Krobot.t - let get krobot = OBus_proxy.make (Krobot.peer krobot) [\"fr\"; \"krobot\"; \"Devices\"; Name.name] - end) - (struct - let name = \"fr.krobot.Device.\" ^ Name.name - end) -"; - List.iter (print "") (List.filter (function Module _ -> true | _ -> false) interface) diff --git a/PC_Mainboard/interface/gen_script_commands.ml b/PC_Mainboard/interface/gen_script_commands.ml deleted file mode 100644 index c78c853..0000000 --- a/PC_Mainboard/interface/gen_script_commands.ml +++ /dev/null @@ -1,67 +0,0 @@ -(* - * gen_script_commands.ml - * ---------------------- - * Copyright : (c) 2010, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -open Printf -open Interface - -let print_common prefix path name args = - printf " register \"unsafe-%s%s\" (f%d" prefix name - (List.fold_left (fun n arg -> match arg with - | Arg _ -> n + 1 - | Cst _ -> n) 0 args); - List.iter (function - | Arg(name, { caml_type = "int" }) -> - printf " (int \"%s\")" name - | Arg(name, { caml_type = "bool" }) -> - printf " (keyword \"%s\" [(\"false\", false); (\"true\", true)])" name - | Arg(name, { caml_type = caml_type }) -> - if try String.sub caml_type 0 6 = "Types." with _ -> false then - printf " (__type_%s \"%s\")" (String.sub caml_type 6 (String.length caml_type - 6)) name - else - printf " (prout \"caca\")" - | Cst _ -> - ()) args; - printf ")\n"; - printf " (fun logger krobot"; - List.iter (function - | Arg(name, typ) -> - printf " %s" (Utils.caml_lid name) - | Cst _ -> - ()) args; - printf " ->\n"; - printf " lwt _ = Krobot_unsafe.%s%s krobot" path (Utils.caml_lid name); - List.iter (function - | Arg(name, typ) -> - printf " %s" (Utils.caml_lid name) - | Cst _ -> - ()) args; - printf " in\n"; - printf " Lwt.return ());\n" - -let rec print prefix path = function - | Request req -> - print_common prefix path req.req_name req.req_args - | Command cmd -> - print_common prefix path cmd.cmd_name cmd.cmd_args - | Enum enum -> - printf " let __type_%s name = keyword name [" (Utils.caml_lid enum.enm_name); - List.iter (fun (name, code) -> - printf "(\"%s\", `%s);" name (Utils.caml_uid name)) - enum.enm_keys; - printf "] in\n" - | Record _ -> - () - | Module(name, items) -> - List.iter (print (prefix ^ String.lowercase name ^ "-") (path ^ Utils.caml_uid name ^ ".")) items - -let () = - printf "open Script_commands\n"; - printf "let register () =\n"; - List.iter (print "" "") (List.filter (function Module _ -> true | _ -> false) interface); - printf " ()" diff --git a/PC_Mainboard/interface/gen_usb_commands_impl.ml b/PC_Mainboard/interface/gen_usb_commands_impl.ml deleted file mode 100644 index 97ef956..0000000 --- a/PC_Mainboard/interface/gen_usb_commands_impl.ml +++ /dev/null @@ -1,120 +0,0 @@ -(* - * gen_usb_commands_impl.ml - * ------------------------ - * Copyright : (c) 2010, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -(* Generate implementation for all USB commands used by the driver *) - -open Printf -open Interface - -let print_common indent name args = - printf "%slet %s card" indent (Utils.caml_lid name); - List.iter (function - | Arg(name, typ) -> - printf " ~%s" (Utils.caml_lid name) - | Cst _ -> - ()) args; - printf " =\n"; - printf "%s let data = Card.make_buffer () in\n" indent; - if args <> [] then begin - printf "%s let writer = RW.writer data in\n" indent; - List.iter - (function - | Arg(name, typ) -> - printf "%s %s;\n" indent (typ.writer (Utils.caml_lid name)) - | Cst(typ, value) -> - printf "%s %s;\n" indent (typ.writer (string_of_int value))) - args - end - -let rec print indent = function - | Request req -> - print_common indent req.req_name req.req_args; - printf "%s lwt data = Card.send_request card %d data in\n" indent req.req_code; - if req.req_repl <> [] then begin - printf "%s let reader = RW.reader data in\n" indent; - let repl = - List.map - (function - | Arg(name, typ) -> - (Utils.caml_lid name, typ) - | Cst _ -> - failwith "constant are not allowed in replies") - req.req_repl - in - List.iter - (fun (name, typ) -> - printf "%s let %s = %s in\n" indent name typ.reader) - repl; - printf "%s return (%s)\n" indent (String.concat ", " (List.map fst repl)) - end else - printf "return ()\n" - | Command cmd -> - print_common indent cmd.cmd_name cmd.cmd_args; - printf "%s Card.send_command card %d data\n" indent cmd.cmd_code - | Enum enum -> - if not enum.enm_extern then - printf "%stype %s = [ %s ]\n" - indent (Utils.caml_lid enum.enm_name) - (String.concat " | " - (List.map - (fun (name, code) -> "`" ^ Utils.caml_uid name) - enum.enm_keys)); - - printf "%slet put_%s writer value =\n" indent (Utils.caml_lid enum.enm_name); - printf "%s let code = match value with\n" indent; - List.iter - (fun (name, code) -> - printf "%s | `%s -> %d\n" indent (Utils.caml_uid name) code) - enum.enm_keys; - printf "%s in\n" indent; - printf "%s %s\n" indent (enum.enm_ctyp.writer "code"); - - printf "%slet get_%s reader =\n" indent (Utils.caml_lid enum.enm_name); - printf "%s match %s with\n" indent enum.enm_ctyp.reader; - List.iter - (fun (name, code) -> - printf "%s | %d -> `%s\n" indent code (Utils.caml_uid name)) - enum.enm_keys; - printf "%s | n -> Printf.ksprintf failwith \"invalid value for '%s': %%d\" n\n" indent enum.enm_name - | Record record -> - if not record.rec_extern then - printf "%stype %s = { %s }\n" - indent (Utils.caml_lid record.rec_name) - (String.concat "; " - (List.map - (fun (name, typ) -> sprintf "%s : %s" (Utils.caml_lid name) typ.caml_type) - record.rec_args)); - - printf "%slet put_%s writer value =\n" indent (Utils.caml_lid record.rec_name); - List.iter - (fun (name, typ) -> - printf "%s %s;\n" indent (typ.writer ("value." ^ record.rec_prefix ^ Utils.caml_lid name))) - record.rec_args; - printf "%s ()\n" indent; - - printf "%slet get_%s reader =\n" indent (Utils.caml_lid record.rec_name); - List.iter - (fun (name, typ) -> - printf "%s let %s = %s in\n" indent (Utils.caml_lid name) typ.reader) - record.rec_args; - printf "%s { %s }\n" indent - (String.concat "; " - (List.map - (fun (name, typ) -> - let name = Utils.caml_lid name in - sprintf "%s = %s" (record.rec_prefix ^ name) name) - record.rec_args)) - | Module(name, items) -> - printf "%smodule %s = struct\n" indent (Utils.caml_uid name); - List.iter (print (indent ^ " ")) items; - printf "%send\n" indent - -let () = - printf "open Lwt\n"; - List.iter (print "") interface diff --git a/PC_Mainboard/interface/gen_usb_commands_intf.ml b/PC_Mainboard/interface/gen_usb_commands_intf.ml deleted file mode 100644 index 972402a..0000000 --- a/PC_Mainboard/interface/gen_usb_commands_intf.ml +++ /dev/null @@ -1,70 +0,0 @@ -(* - * gen_usb_commands_intf.ml - * ------------------------ - * Copyright : (c) 2010, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -(* Generate interface for all USB commands used by the driver *) - -open Printf -open Interface - -let print_common indent name args = - printf "%sval %s : Card.t -> " indent (Utils.caml_lid name); - List.iter (function - | Arg(name, typ) -> - printf "%s : %s -> " (Utils.caml_lid name) typ.caml_type - | Cst _ -> - ()) args - -let print_repl = function - | Arg(name, typ) -> - printf "%s" typ.caml_type - | Cst _ -> - failwith "constant are not allowed in replies" - -let rec print indent = function - | Request req -> - print_common indent req.req_name req.req_args; - begin - match req.req_repl with - | [] -> - printf "unit Lwt.t\n" - | [arg] -> - print_repl arg; - printf " Lwt.t\n" - | arg :: args -> - printf "("; - print_repl arg; - List.iter (fun arg -> printf " * "; print_repl arg) args; - printf ") Lwt.t\n" - end - | Command cmd -> - print_common indent cmd.cmd_name cmd.cmd_args; - printf "unit Lwt.t\n"; - | Enum enum -> - if not enum.enm_extern then - printf "%stype %s = [ %s ]\n" - indent (Utils.caml_lid enum.enm_name) - (String.concat " | " - (List.map - (fun (name, code) -> "`" ^ Utils.caml_uid name) - enum.enm_keys)); - | Record record -> - if not record.rec_extern then - printf "%stype %s = { %s }\n" - indent (Utils.caml_lid record.rec_name) - (String.concat "; " - (List.map - (fun (name, typ) -> sprintf "%s : %s" (Utils.caml_lid name) typ.caml_type) - record.rec_args)) - | Module(name, items) -> - printf "%smodule %s : sig\n" indent (Utils.caml_uid name); - List.iter (print (indent ^ " ")) items; - printf "%send\n" indent - -let () = - List.iter (print "") interface diff --git a/PC_Mainboard/interface/interface.ml b/PC_Mainboard/interface/interface.ml index a0bd652..9bf3bd3 100644 --- a/PC_Mainboard/interface/interface.ml +++ b/PC_Mainboard/interface/interface.ml @@ -7,27 +7,34 @@ * This file is a part of [kro]bot. *) -(* USB commands description *) - open Printf (* +-----------------------------------------------------------------+ - | Types | + | Ast | +-----------------------------------------------------------------+ *) (* Description of a type *) -type ctyp = { +type typ = { caml_type : string; + (* The caml type used *) + writer : string -> string; + (* [writer expr] represents an expression writing [expr], using the + current writer, named "writer". *) reader : string; + (* [reader] represents an expression reading a value of the give + type, using the reader "reader" *) } +(* An argument *) type arg = - | Arg of string * ctyp - (* [Arg(name, type)] *) - | Cst of ctyp * int - (* [Cst(type, value)] *) + | Arg of string * typ + (* [Arg(name, typ)] is a normal argument, with name [name] and + type [typ] *) + | Cst of typ * int + (* [Cst(typ, value)] is an integer constant. *) +(* A request, which expect a reply: *) type request = { req_name : string; (* The request name, which will be used for function naming *) @@ -42,6 +49,7 @@ type request = { (* Returned values *) } +(* A command, which does not expect a reply *) type command = { cmd_name : string; cmd_code : int; @@ -49,16 +57,14 @@ type command = { } type enum = { - enm_name : string; - enm_ctyp : ctyp; - enm_keys : (string * int) list; - enm_extern : bool; + enum_name : string; + enum_type : typ; + enum_keys : (string * int) list; } type record = { rec_name : string; - rec_args : (string * ctyp) list; - rec_extern : bool; + rec_args : (string * typ) list; rec_prefix : string; } @@ -88,19 +94,17 @@ let command ~name ~code ?(args=[]) () = cmd_args = args; } -let enum ~name ~ctyp ~keys ?(extern=false) () = +let enum ~name ~typ ~keys () = Enum{ - enm_name = name; - enm_ctyp = ctyp; - enm_keys = keys; - enm_extern = extern; + enum_name = name; + enum_type = typ; + enum_keys = keys; } -let record ~name ~args ?(extern=false) ?(prefix="") () = +let record ~name ~args ?(prefix="") () = Record{ rec_name = name; rec_args = args; - rec_extern = extern; rec_prefix = prefix; } @@ -110,50 +114,50 @@ let record ~name ~args ?(extern=false) ?(prefix="") () = let bool = { caml_type = "bool"; - writer = sprintf "RW.put_uint8 writer (if %s then 1 else 0)"; - reader = "RW.get_uint8 reader <> 0"; + writer = sprintf "put_uint8 writer (if %s then 1 else 0)"; + reader = "get_uint8 reader <> 0"; } let uint8 = { caml_type = "int"; - writer = sprintf "RW.put_uint8 writer %s"; - reader = "RW.get_uint8 reader"; + writer = sprintf "put_uint8 writer %s"; + reader = "get_uint8 reader"; } let sint8 = { caml_type = "int"; - writer = sprintf "RW.put_sint8 writer %s"; - reader = "RW.get_sint8 reader"; + writer = sprintf "put_sint8 writer %s"; + reader = "get_sint8 reader"; } let uint16 = { caml_type = "int"; - writer = sprintf "RW.put_uint16 writer %s"; - reader = "RW.get_uint16 reader"; + writer = sprintf "put_uint16 writer %s"; + reader = "get_uint16 reader"; } let sint16 = { caml_type = "int"; - writer = sprintf "RW.put_sint16 writer %s"; - reader = "RW.get_sint16 reader"; + writer = sprintf "put_sint16 writer %s"; + reader = "get_sint16 reader"; } let uint32 = { caml_type = "int"; - writer = sprintf "RW.put_uint32 writer %s"; - reader = "RW.get_uint32 reader"; + writer = sprintf "put_uint32 writer %s"; + reader = "get_uint32 reader"; } let sint32 = { caml_type = "int"; - writer = sprintf "RW.put_sint32 writer %s"; - reader = "RW.get_sint32 reader"; + writer = sprintf "put_sint32 writer %s"; + reader = "get_sint32 reader"; } let string = { caml_type = "string"; - writer = sprintf "RW.put_string writer %s"; - reader = "RW.get_string reader"; + writer = sprintf "put_string writer %s"; + reader = "get_string reader"; } let array size typ = { @@ -168,16 +172,8 @@ let bool_array size typ = { reader = sprintf "let _x = %s in Array.init %d (fun i -> _x land (1 lsl i) <> 0)" typ.reader size; } -let extern name = - let name = Utils.caml_lid name in - { - caml_type = "Types." ^ name; - writer = sprintf "put_%s writer %s" name; - reader = sprintf "get_%s reader" name; - } - -let local name = - let name = Utils.caml_lid name in +let typ name = + let name = Name.lid name in { caml_type = name; writer = sprintf "put_%s writer %s" name; @@ -189,28 +185,30 @@ let local name = +-----------------------------------------------------------------+ *) let interface = [ - request - ~name:"get-firmware-build" - ~code:PcInterface.get_firmware_build - ~repl:[Arg("date", string)] - (); - request - ~name:"get-board-info" - ~code:PcInterface.get_board_info - ~repl:[Arg("info", string)] - (); - command - ~name:"bootloader" - ~code:PcInterface.cmd_bootloader - (); - command - ~name:"reset" - ~code:PcInterface.cmd_reset - (); - command - ~name:"test" - ~code:PcInterface.cmd_test - (); + Module("common", [ + request + ~name:"get-firmware-build" + ~code:PcInterface.get_firmware_build + ~repl:[Arg("date", string)] + (); + request + ~name:"get-board-info" + ~code:PcInterface.get_board_info + ~repl:[Arg("info", string)] + (); + command + ~name:"bootloader" + ~code:PcInterface.cmd_bootloader + (); + command + ~name:"reset" + ~code:PcInterface.cmd_reset + (); + command + ~name:"test" + ~code:PcInterface.cmd_test + (); + ]); Module("compass", [ request @@ -223,15 +221,13 @@ let interface = [ Module("AX12", [ enum ~name:"exec-mode" - ~extern:true - ~ctyp:uint8 + ~typ:uint8 ~keys:[("now", PcInterface.ax12_exec_now); ("action", PcInterface.ax12_exec_action)] (); record ~name:"ax12-stats" - ~extern:true - ~prefix:"Types.ax12_" + ~prefix:"ax12_" ~args:[("position", uint16); ("velocity", uint16); ("torque", uint16); @@ -247,7 +243,7 @@ let interface = [ Arg("id", uint8); Arg("position", uint16); Arg("velocity", uint16); - Arg("mode", extern "exec-mode")] + Arg("mode", typ "exec-mode")] (); request ~name:"ping" @@ -343,7 +339,7 @@ let interface = [ ~args:[Cst(uint8, PcInterface.ax12_get_load); Arg("id", uint8); Arg("timeout", uint8)] - ~repl:[Arg("stats", extern "ax12-stats")] + ~repl:[Arg("stats", typ "ax12-stats")] (); request ~name:"action" @@ -398,24 +394,21 @@ let interface = [ Module("motor", [ enum ~name:"motor" - ~ctyp:uint8 - ~extern:true + ~typ:uint8 ~keys:[("left", PcInterface.motor_left); ("both", PcInterface.motor_both); ("right", PcInterface.motor_right)] (); enum ~name:"stop-mode" - ~ctyp:uint16 - ~extern:true + ~typ:uint16 ~keys:[("off", PcInterface.traj_stop_motor_off); ("abrupt", PcInterface.traj_stop_abrupt); ("smooth", PcInterface.traj_stop_smooth)] (); enum ~name:"direction" - ~ctyp:sint8 - ~extern:true + ~typ:sint8 ~keys:[("forward", 1); ("backward", -1)] (); @@ -453,8 +446,7 @@ let interface = [ (); enum ~name:"goto-mode" - ~ctyp:uint8 - ~extern:true + ~typ:uint8 ~keys:[("straight", 0); ("curve-right", 1); ("curve-left", 2)] @@ -467,31 +459,31 @@ let interface = [ Arg("y", sint16); Arg("velocity", sint16); Arg("acceleration", sint16); - Arg("mode", extern "goto-mode"); + Arg("mode", typ "goto-mode"); Arg("bypass-distance", sint16)] (); command ~name:"traj-new-velocity" ~code:PcInterface.cmd_traj ~args:[Cst(uint8, PcInterface.traj_new_velocity); - Arg("motor", extern "motor"); + Arg("motor", typ "motor"); Arg("velocity", sint16); Arg("acceleration", sint16); - Arg("direction", extern "direction")] + Arg("direction", typ "direction")] (); command ~name:"traj-change-velocity" ~code:PcInterface.cmd_traj ~args:[Cst(uint8, PcInterface.traj_change_velocity); - Arg("motor", extern "motor"); + Arg("motor", typ "motor"); Arg("velocity", sint16); - Arg("direction", extern "direction")] + Arg("direction", typ "direction")] (); command ~name:"traj-start" ~code:PcInterface.cmd_traj ~args:[Cst(uint8, PcInterface.traj_start); - Arg("motor", extern "motor")] + Arg("motor", typ "motor")] (); command ~name:"traj-init" @@ -502,20 +494,20 @@ let interface = [ ~name:"traj-stop" ~code:PcInterface.cmd_traj ~args:[Cst(uint8, PcInterface.traj_init); - Arg("motor", extern "motor"); - Arg("mode", extern "stop-mode")] + Arg("motor", typ "motor"); + Arg("mode", typ "stop-mode")] (); command ~name:"enable" ~code:PcInterface.cmd_motor ~args:[Cst(uint8, PcInterface.motor_enable); - Arg("motor", extern "motor")] + Arg("motor", typ "motor")] (); command ~name:"disable" ~code:PcInterface.cmd_motor ~args:[Cst(uint8, PcInterface.motor_disable); - Arg("motor", extern "motor")] + Arg("motor", typ "motor")] (); ]); ] diff --git a/PC_Mainboard/interface/name.ml b/PC_Mainboard/interface/name.ml new file mode 100644 index 0000000..a058784 --- /dev/null +++ b/PC_Mainboard/interface/name.ml @@ -0,0 +1,47 @@ +(* + * name.ml + * ------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +let lid str = + let str = String.copy str in + str.[0] <- Char.lowercase str.[0]; + for i = 0 to String.length str - 1 do + if str.[i] = '-' then str.[i] <- '_' + done; + str + +let uid str = + let str = String.copy str in + str.[0] <- Char.uppercase str.[0]; + for i = 0 to String.length str - 1 do + if str.[i] = '-' then str.[i] <- '_' + done; + str + +let caml_case str = + let len = String.length str in + let buf = Buffer.create len in + let rec loop i = + if i = len then + Buffer.contents buf + else + if str.[i] = '-' || str.[i] = '_' then + capitalize (i + 1) + else begin + Buffer.add_char buf str.[i]; + loop (i + 1) + end + and capitalize i = + if i = len then + Buffer.contents buf + else begin + Buffer.add_char buf (Char.uppercase str.[i]); + loop (i + 1) + end + in + capitalize 0 diff --git a/PC_Mainboard/interface/name.mli b/PC_Mainboard/interface/name.mli new file mode 100644 index 0000000..0d6aa1c --- /dev/null +++ b/PC_Mainboard/interface/name.mli @@ -0,0 +1,28 @@ +(* + * name.mli + * -------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(** Name conversion *) + +val lid : string -> string + (** Convert a string into a valid caml lower identifier. + + exmaple: [caml_lid "get-board-info" = "get_board_info"] + *) + +val uid : string -> string + (** Convert a string into a valid caml upper identifier. + + exmaple: [caml_uid "get-board-info" = "Get_board_info"] + *) + +val caml_case : string -> string + (** Returns the caml-case version of the given string: + + example: [caml_case "get-board-info" = "GetBoardInfo"] + *) diff --git a/PC_Mainboard/interface/utils.ml b/PC_Mainboard/interface/utils.ml deleted file mode 100644 index 5975e8e..0000000 --- a/PC_Mainboard/interface/utils.ml +++ /dev/null @@ -1,47 +0,0 @@ -(* - * utils.ml - * -------- - * Copyright : (c) 2010, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -let caml_lid str = - let str = String.copy str in - str.[0] <- Char.lowercase str.[0]; - for i = 0 to String.length str - 1 do - if str.[i] = '-' then str.[i] <- '_' - done; - str - -let caml_uid str = - let str = String.copy str in - str.[0] <- Char.uppercase str.[0]; - for i = 0 to String.length str - 1 do - if str.[i] = '-' then str.[i] <- '_' - done; - str - -let caml_case str = - let len = String.length str in - let buf = Buffer.create len in - let rec loop i = - if i = len then - Buffer.contents buf - else - if str.[i] = '-' || str.[i] = '_' then - capitalize (i + 1) - else begin - Buffer.add_char buf str.[i]; - loop (i + 1) - end - and capitalize i = - if i = len then - Buffer.contents buf - else begin - Buffer.add_char buf (Char.uppercase str.[i]); - loop (i + 1) - end - in - capitalize 0 diff --git a/PC_Mainboard/interface/utils.mli b/PC_Mainboard/interface/utils.mli deleted file mode 100644 index 023f8df..0000000 --- a/PC_Mainboard/interface/utils.mli +++ /dev/null @@ -1,26 +0,0 @@ -(* - * utils.mli - * --------- - * Copyright : (c) 2010, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -val caml_lid : string -> string - (** Convert a string into a valid caml lower identifier. - - exmaple: [caml_lid "get-board-info" = "get_board_info"] - *) - -val caml_uid : string -> string - (** Convert a string into a valid caml upper identifier. - - exmaple: [caml_uid "get-board-info" = "Get_board_info"] - *) - -val caml_case : string -> string - (** Returns the caml-case version of the given string: - - example: [caml_case "get-board-info" = "GetBoardInfo"] - *) diff --git a/PC_Mainboard/myocamlbuild.ml b/PC_Mainboard/myocamlbuild.ml index 87f09e9..3cedd3f 100644 --- a/PC_Mainboard/myocamlbuild.ml +++ b/PC_Mainboard/myocamlbuild.ml @@ -147,33 +147,33 @@ let _ = Options.ocamldoc := S[A"ocamlfind"; A"ocamldoc"; A"-hide-warnings"] | After_rules -> + (* +---------------------------------------------------------+ | Autogenerated files | +---------------------------------------------------------+ *) + (* Geenrate the caml implementation file PcInteface.ml from + PcInterface.h. It replace all [#define] by let-bindings. *) rule "krobot's protocol" ~dep:"common/PcInterface.h" ~prod:"common/PcInterface.ml" (fun _ _ -> Cmd(Sh"awk '$1 == \"#define\" && $3 != \"\" { print \"let \" tolower($2) \" = \" $3 }' common/PcInterface.h > common/PcInterface.ml")); - rule "USB commands, impl" ~dep:"interface/gen_usb_commands_impl.best" ~prod:"driver/commands.ml" - (fun _ _ -> - Cmd(Sh"./interface/gen_usb_commands_impl.best > driver/commands.ml")); + Pathname.define_context "generators" ["interface"]; - rule "USB commands, intf" ~dep:"interface/gen_usb_commands_intf.best" ~prod:"driver/commands.mli" - (fun _ _ -> - Cmd(Sh"./interface/gen_usb_commands_intf.best > driver/commands.mli")); - - rule "DBus exports" ~dep:"interface/gen_dbus_exports.best" ~prod:"driver/dBus_exports.ml" - (fun _ _ -> - Cmd(Sh"./interface/gen_dbus_exports.best > driver/dBus_exports.ml")); + (* Pairs of [(generator, production)]: *) + let generated_files = [ + ("gen_usb_commands", "driver/USB_commands.ml"); + ("gen_dbus_exports", "driver/DBus_exports.ml"); + ("gen_dbus_imports", "lib_krobot/krobot_unsafe.ml"); + ("gen_script_commands", "clients/script_unsafe.ml"); + ] in - rule "DBus imports" ~dep:"interface/gen_dbus_imports.best" ~prod:"lib_krobot/krobot_unsafe.ml" - (fun _ _ -> - Cmd(Sh"./interface/gen_dbus_imports.best > lib_krobot/krobot_unsafe.ml")); - - rule "Script commands" ~dep:"interface/gen_script_commands.best" ~prod:"clients/script_unsafe.ml" - (fun _ _ -> - Cmd(Sh"./interface/gen_script_commands.best > clients/script_unsafe.ml")); + List.iter + (fun (generator, production) -> + let generator = sprintf "generators/%s.best" generator in + rule (sprintf "generation of '%s'" production) ~dep:generator ~prod:production + (fun _ _ -> Cmd(Sh(sprintf "./%s > %s" generator production)))) + generated_files; (* +---------------------------------------------------------+ | Virtual targets | hooks/post-receive -- krobot |
From: Xavier L. <Ba...@us...> - 2010-02-22 21:01: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, motor-nurbs has been created at 821b31d67ca783924aa55eba5cf94d0b3a7f6247 (commit) - Log ----------------------------------------------------------------- commit 821b31d67ca783924aa55eba5cf94d0b3a7f6247 Author: Xavier Lagorce <Xav...@cr...> Date: Mon Feb 22 21:56:03 2010 +0100 First test of a cubic Bezier curve trajectory added a framework to follow trajectories in the motor interrupt (motor.c) and the lm629.c file. added a goToBezier function to initiate the trajectory added a call to this function in the CMD_TEST USB call. ----------------------------------------------------------------------- hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-22 20:52:01
|
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 6945591b460b0b5106b07685b69b78d6407cacf1 (commit) from d2fd20b4edbeb4c752610066e22224da6de64380 (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 6945591b460b0b5106b07685b69b78d6407cacf1 Author: Jérémie Dimino <je...@di...> Date: Mon Feb 22 21:51:10 2010 +0100 autogeneration of various part of the code ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/card_tools/bootloader.ml b/PC_Mainboard/card_tools/bootloader.ml index 28044cc..35b407e 100644 --- a/PC_Mainboard/card_tools/bootloader.ml +++ b/PC_Mainboard/card_tools/bootloader.ml @@ -54,8 +54,8 @@ let close k = let open_card () = let handle = USB.open_device_with - ~vendor_id:Protocol.usb_vid - ~product_id:Protocol.usb_pid_bootloader + ~vendor_id:PcInterface.usb_vid + ~product_id:PcInterface.usb_pid_bootloader in let kernel_active = USB.kernel_driver_active handle 0 in if kernel_active then USB.detach_kernel_driver handle 0; @@ -109,7 +109,7 @@ let get_flash k ~address ~length = 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 ""; + put_message send_buffer PcInterface.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 @@ -132,10 +132,10 @@ let erase_flash k ~address ~length = return () else begin let address = address+offset in - put_message send_buffer Protocol.erase_flash 1 address ""; + put_message send_buffer PcInterface.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))) + if int_of_char receive_buffer.[0] <> PcInterface.erase_flash then + failwith (UnexpectedReply (receive_buffer, String.make 1 (char_of_int PcInterface.erase_flash))) else loop (offset+increment) (total_length-increment); end @@ -162,10 +162,10 @@ let write_flash k ~address data offset length = 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; + put_message send_buffer PcInterface.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))) + if int_of_char receive_buffer.[0] <> PcInterface.write_flash then + failwith (UnexpectedReply (receive_buffer, String.make 1 (char_of_int PcInterface.erase_flash))) else begin lwt written = get_flash k ~address ~length:increment in if written <> packet then @@ -179,6 +179,6 @@ let write_flash k ~address data 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; + send_buffer.[0] <- char_of_int PcInterface.reset; lwt () = send_receive_packet k send_buffer 1 receive_buffer 64 5. 5. in return () diff --git a/PC_Mainboard/clients/script.ml b/PC_Mainboard/clients/script.ml index 2d6a19b..e6d4844 100644 --- a/PC_Mainboard/clients/script.ml +++ b/PC_Mainboard/clients/script.ml @@ -9,114 +9,13 @@ open Lwt open Lwt_term +open Script_commands module TextSet = Set.Make(Text) let set_of_list l = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty l (* +-----------------------------------------------------------------+ - | Commands | - +-----------------------------------------------------------------+ *) - -type logger = Lwt_term.styled_text -> unit Lwt.t - -(* Type of an argument *) -type arg_type = - | Int - | Keyword of string list - -type command = { - c_name : string; - (* The command name *) - - c_exec : (string * string) list -> logger -> Krobot.t -> unit Lwt.t; - (* The command implementation. It takes as argument the list of - parameters. *) - - c_args : (string * arg_type) list; - (* Argument description, used for completion. *) -} - -(* An argument description *) -type 'a arg = { - a_type : arg_type; - a_name : string; - a_cast : string -> 'a; - a_default : 'a option; -} - -(* A function description *) -type 'a func = { - f_args : (string * arg_type) list; - (* Arguments of the function, for completion *) - - f_func : (string * string) list -> 'a -> unit Lwt.t; - (* [f_func args f] parses arguments [args] and apply them to [f] *) -} - -(* All registred commands *) -let commands = ref [] - -(* Register a command *) -let register name func f = - let command = { - c_name = name; - c_exec = (fun args logger krobot -> func.f_func args (f logger krobot)); - c_args = func.f_args; - } in - commands := command :: !commands - -exception Argument_error of string - (* Exception raised when there is a problem with an argument *) - -let arg_error msg = raise (Argument_error msg) - -(* Returns the value associated to [key] if any, and the list without - the first occurence of [key] *) -let rec assoc_remove key = function - | [] -> - (None, []) - | (key', value) :: rest when key = key' -> - (Some value, rest) - | pair :: rest -> - let result, l = assoc_remove key rest in - (result, pair :: l) - -let ( --> ) arg func = { - f_args = (arg.a_name, arg.a_type) :: func.f_args; - f_func = - fun args f -> - let result, args = assoc_remove arg.a_name args in - match result with - | Some str -> - func.f_func args (f (arg.a_cast str)) - | None -> - match arg.a_default with - | Some value -> - func.f_func args (f value) - | None -> - Printf.ksprintf arg_error "argument '%s' is mandatory" arg.a_name -} - -let f0 = { - f_args = []; - f_func = - fun args f -> - match args with - | [] -> - f - | (key, _) :: _ -> - Printf.ksprintf arg_error "unused argument '%s'" key -} - -let f1 arg0 = arg0 --> f0 -let f2 arg0 arg1 = arg0 --> (f1 arg1) -let f3 arg0 arg1 arg2 = arg0 --> (f2 arg1 arg2) -let f4 arg0 arg1 arg2 arg3 = arg0 --> (f3 arg1 arg2 arg3) -let f5 arg0 arg1 arg2 arg3 arg4 = arg0 --> (f4 arg1 arg2 arg3 arg4) -let f6 arg0 arg1 arg2 arg3 arg4 arg5 = arg0 --> (f5 arg1 arg2 arg3 arg4 arg5) - -(* +-----------------------------------------------------------------+ | Completion | +-----------------------------------------------------------------+ *) @@ -194,32 +93,6 @@ let exec ~krobot ~logger ~command = logger [fg lred; textf "command '%s' failed with: %s" name (Printexc.to_string exn)] (* +-----------------------------------------------------------------+ - | Arguments | - +-----------------------------------------------------------------+ *) - -let int ?default name = { - a_name = name; - a_type = Int; - a_cast = (fun str -> - try - int_of_string str - with Failure _ -> - Printf.ksprintf arg_error "invalid value for argument '%s': an integer was expected" name); - a_default = default; -} - -let keyword ?default name keywords = { - a_name = name; - a_type = Keyword(List.map fst keywords); - a_cast = (fun key -> - try - List.assoc key keywords - with Not_found -> - Printf.ksprintf arg_error "invalid value for '%s'" name); - a_default = default; -} - -(* +-----------------------------------------------------------------+ | All commands | +-----------------------------------------------------------------+ *) @@ -331,47 +204,47 @@ let () = and timeout = int ~default:100 "timeout" and reg = int "reg" and value = int "value" - and now = keyword ~default:true "now" [("true", true); ("false", false)] in + and now = keyword ~default:`Now "mode" [("now", `Now); ("action", `Action)] in register "ax12-goto" (f4 id pos speed now) (fun logger krobot id pos speed now -> - Krobot.AX12.goto krobot id pos speed now); + Krobot_unsafe.AX12.goto krobot id pos speed now); register "ax12-ping" (f2 id timeout) (fun logger krobot id timeout -> - Krobot.AX12.ping krobot id timeout >>= function + Krobot_unsafe.AX12.ping krobot id timeout >>= function | 0 -> logger [textf "ax12-ping[%d] reply: " id; fg lred; text "timeout"] | _ -> logger [textf "ax12-ping[%d] reply: " id; fg lgreen; text "success"]); register "ax12-read8" (f3 id reg timeout) (fun logger krobot id reg timeout -> - lwt x = Krobot.AX12.read8 krobot id reg timeout in + lwt x = Krobot_unsafe.AX12.read8 krobot id reg timeout in logger [textf "ax12-read8[%d] reply: %d" id x]); register "ax12-read16" (f3 id reg timeout) (fun logger krobot id reg timeout -> - lwt x = Krobot.AX12.read16 krobot id reg timeout in + lwt x = Krobot_unsafe.AX12.read16 krobot id reg timeout in logger [textf "ax12-read16[%d] reply: %d" id x]); register "ax12-write8" (f3 id reg value) (fun logger krobot id reg value -> - Krobot.AX12.write8 krobot id reg value); + Krobot_unsafe.AX12.write8 krobot id reg value); register "ax12-write16" (f3 id reg value) (fun logger krobot id reg value -> - Krobot.AX12.write16 krobot id reg value); + Krobot_unsafe.AX12.write16 krobot id reg value); register "ax12-get-pos" (f2 id timeout) (fun logger krobot id timeout -> - lwt x = Krobot.AX12.get_pos krobot id timeout in + lwt x = Krobot_unsafe.AX12.get_position krobot id timeout in logger [textf "ax12-position[%d]: %d" id x]); register "ax12-get-speed" (f2 id timeout) (fun logger krobot id timeout -> - lwt x = Krobot.AX12.get_speed krobot id timeout in + lwt x = Krobot_unsafe.AX12.get_velocity krobot id timeout in logger [textf "ax12-speed[%d]: %d" id x]); register "ax12-get-load" (f2 id timeout) (fun logger krobot id timeout -> - lwt x = Krobot.AX12.get_load krobot id timeout in + lwt x = Krobot_unsafe.AX12.get_load krobot id timeout in logger [textf "ax12-load[%d]: %d" id x]); register "ax12-stats" (f2 id timeout) (fun logger krobot id timeout -> - lwt stats = Krobot.AX12.stats krobot id timeout in + lwt stats = Krobot_unsafe.AX12.get_stats krobot id timeout in lwt () = logger [textf "ax12[%d] position = %d" id stats.Types.ax12_position] in - lwt () = logger [textf "ax12[%d] speed = %d" id stats.Types.ax12_speed] in + lwt () = logger [textf "ax12[%d] velocity = %d" id stats.Types.ax12_velocity] in lwt () = logger [textf "ax12[%d] torque = %d" id stats.Types.ax12_torque] in lwt () = logger [textf "ax12[%d] voltage = %d" id stats.Types.ax12_voltage] in lwt () = logger [textf "ax12[%d] temperature = %d" id stats.Types.ax12_temperature] in @@ -380,10 +253,12 @@ let () = return ()); register "ax12-write-reg8" (f3 id reg value) (fun logger krobot id reg value -> - Krobot.AX12.write_reg8 krobot id reg value); + Krobot_unsafe.AX12.write_register8 krobot id reg value); register "ax12-write-reg16" (f3 id reg value) (fun logger krobot id reg value -> - Krobot.AX12.write_reg16 krobot id reg value); + Krobot_unsafe.AX12.write_register16 krobot id reg value); register "ax12-action" (f1 (int ~default:254 "id")) (fun logger krobot id -> - Krobot.AX12.action krobot id) + Krobot_unsafe.AX12.action krobot id) + +let () = Script_unsafe.register () diff --git a/PC_Mainboard/clients/script_commands.ml b/PC_Mainboard/clients/script_commands.ml new file mode 100644 index 0000000..a86a01d --- /dev/null +++ b/PC_Mainboard/clients/script_commands.ml @@ -0,0 +1,137 @@ +(* + * script_commands.ml + * ------------------ + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + + +(* +-----------------------------------------------------------------+ + | Types | + +-----------------------------------------------------------------+ *) + +type logger = Lwt_term.styled_text -> unit Lwt.t + +(* Type of an argument *) +type arg_type = + | Int + | Keyword of string list + +type command = { + c_name : string; + (* The command name *) + + c_exec : (string * string) list -> logger -> Krobot.t -> unit Lwt.t; + (* The command implementation. It takes as argument the list of + parameters. *) + + c_args : (string * arg_type) list; + (* Argument description, used for completion. *) +} + +(* An argument description *) +type 'a arg = { + a_type : arg_type; + a_name : string; + a_cast : string -> 'a; + a_default : 'a option; +} + +(* A function description *) +type 'a func = { + f_args : (string * arg_type) list; + (* Arguments of the function, for completion *) + + f_func : (string * string) list -> 'a -> unit Lwt.t; + (* [f_func args f] parses arguments [args] and apply them to [f] *) +} + +(* All registred commands *) +let commands = ref [] + +(* Register a command *) +let register name func f = + let command = { + c_name = name; + c_exec = (fun args logger krobot -> func.f_func args (f logger krobot)); + c_args = func.f_args; + } in + commands := command :: !commands + +exception Argument_error of string + (* Exception raised when there is a problem with an argument *) + +let arg_error msg = raise (Argument_error msg) + +(* Returns the value associated to [key] if any, and the list without + the first occurence of [key] *) +let rec assoc_remove key = function + | [] -> + (None, []) + | (key', value) :: rest when key = key' -> + (Some value, rest) + | pair :: rest -> + let result, l = assoc_remove key rest in + (result, pair :: l) + +let ( --> ) arg func = { + f_args = (arg.a_name, arg.a_type) :: func.f_args; + f_func = + fun args f -> + let result, args = assoc_remove arg.a_name args in + match result with + | Some str -> + func.f_func args (f (arg.a_cast str)) + | None -> + match arg.a_default with + | Some value -> + func.f_func args (f value) + | None -> + Printf.ksprintf arg_error "argument '%s' is mandatory" arg.a_name +} + +let f0 = { + f_args = []; + f_func = + fun args f -> + match args with + | [] -> + f + | (key, _) :: _ -> + Printf.ksprintf arg_error "unused argument '%s'" key +} + +let f1 arg0 = arg0 --> f0 +let f2 arg0 arg1 = arg0 --> (f1 arg1) +let f3 arg0 arg1 arg2 = arg0 --> (f2 arg1 arg2) +let f4 arg0 arg1 arg2 arg3 = arg0 --> (f3 arg1 arg2 arg3) +let f5 arg0 arg1 arg2 arg3 arg4 = arg0 --> (f4 arg1 arg2 arg3 arg4) +let f6 arg0 arg1 arg2 arg3 arg4 arg5 = arg0 --> (f5 arg1 arg2 arg3 arg4 arg5) + +(* +-----------------------------------------------------------------+ + | Arguments | + +-----------------------------------------------------------------+ *) + +let int ?default name = { + a_name = name; + a_type = Int; + a_cast = (fun str -> + try + int_of_string str + with Failure _ -> + Printf.ksprintf arg_error "invalid value for argument '%s': an integer was expected" name); + a_default = default; +} + +let keyword ?default name keywords = { + a_name = name; + a_type = Keyword(List.map fst keywords); + a_cast = (fun key -> + try + List.assoc key keywords + with Not_found -> + Printf.ksprintf arg_error "invalid value for '%s'" name); + a_default = default; +} diff --git a/PC_Mainboard/common/types.ml b/PC_Mainboard/common/types.ml index 60ab4ce..07199cb 100644 --- a/PC_Mainboard/common/types.ml +++ b/PC_Mainboard/common/types.ml @@ -43,10 +43,21 @@ let obus_goto_mode = OBus_type.mapping obus_int type ax12_stats = { ax12_position : int; - ax12_speed : int; + ax12_velocity : int; ax12_torque : int; ax12_voltage : int; ax12_temperature : int; ax12_cw_angle_limit : int; ax12_ccw_angle_limit : int; } with obus + +type exec_mode = [ `Now | `Action ] + +let obus_exec_mode = OBus_type.mapping obus_int + [(`Now, 0); (`Action, 1)] + +type direction = [ `Forward | `Backward ] + +let obus_direction = OBus_type.mapping obus_int + [(`Forward, 0); (`Backward, 1)] + diff --git a/PC_Mainboard/common/types.mli b/PC_Mainboard/common/types.mli index 164f85a..ec1598d 100644 --- a/PC_Mainboard/common/types.mli +++ b/PC_Mainboard/common/types.mli @@ -25,15 +25,20 @@ type motor = [ `Left | `Right | `Both ] with obus(basic) type stop_mode = [ `Off | `Abrupt | `Smooth ] with obus(basic) (** Mode for stopping motors *) +type direction = [ `Forward | `Backward ] with obus(basic) + type card_state = [ `Present | `Absent ] with obus(basic) (** State of a card *) type goto_mode = [ `Straight | `Curve_right | `Curve_left ] with obus(basic) (** Form of the trajectory for the goto command *) +type exec_mode = [ `Now | `Action ] with obus(basic) + (** Mode of execution of the goto command for ax12 *) + type ax12_stats = { ax12_position : int; - ax12_speed : int; + ax12_velocity : int; ax12_torque : int; ax12_voltage : int; ax12_temperature : int; diff --git a/PC_Mainboard/driver/RW.ml b/PC_Mainboard/driver/RW.ml index f7c417a..4406039 100644 --- a/PC_Mainboard/driver/RW.ml +++ b/PC_Mainboard/driver/RW.ml @@ -7,31 +7,75 @@ * This file is a part of [kro]bot. *) -let get_uint8 data ofs = Char.code data.[ofs] -let set_uint8 data ofs v = data.[ofs] <- Char.unsafe_chr v -let get_int8 = get_uint8 -let set_int8 = set_uint8 - -let get_int16 data ofs = - (get_uint8 data ofs lsl 8) - lor (get_uint8 data (ofs + 1)) -let get_uint16 = get_int16 - -let set_int16 data ofs v = - set_uint8 data ofs ((v lsr 8) land 0xff); - set_uint8 data (ofs + 1) (v land 0xff) -let set_uint16 = set_int16 - -let get_int32 data ofs = - (get_uint8 data ofs lsl 24) - lor (get_uint8 data (ofs + 1) lsl 16) - lor (get_uint8 data (ofs + 2) lsl 8) - lor (get_uint8 data (ofs + 3)) -let get_uint32 = get_int32 - -let set_int32 data ofs v = - set_uint8 data ofs ((v lsr 24) land 0xff); - set_uint8 data (ofs + 1) ((v lsr 16) land 0xff); - set_uint8 data (ofs + 2) ((v lsr 8) land 0xff); - set_uint8 data (ofs + 3) (v land 0xff) -let set_uint32 = set_int32 +type pointer = { + mutable offset : int; + buffer : string; +} + +type writer = pointer +type reader = pointer + +let writer buffer = { buffer = buffer; offset = 0 } +let reader buffer = { buffer = buffer; offset = 0 } + +let get_uint8 pointer = + let offset = pointer.offset in + pointer.offset <- offset + 1; + int_of_char pointer.buffer.[offset] +let put_uint8 pointer value = + let offset = pointer.offset in + pointer.offset <- offset + 1; + pointer.buffer.[offset] <- char_of_int value +let get_sint8 = get_uint8 +let put_sint8 = put_uint8 + +let get_sint16 pointer = + let v0 = get_uint8 pointer in + let v1 = get_uint8 pointer in + (v0 lsl 8) lor v1 +let get_uint16 = get_sint16 + +let put_sint16 pointer value = + put_uint8 pointer ((value lsr 8) land 0xff); + put_uint8 pointer (value land 0xff) +let put_uint16 = put_sint16 + +let get_sint32 pointer = + let v0 = get_uint8 pointer in + let v1 = get_uint8 pointer in + let v2 = get_uint8 pointer in + let v3 = get_uint8 pointer in + (v0 lsl 24) lor (v1 lsl 16) lor (v2 lsl 8) lor v3 +let get_uint32 = get_sint32 + +let put_sint32 pointer value = + put_uint8 pointer ((value lsr 24) land 0xff); + put_uint8 pointer ((value lsr 16) land 0xff); + put_uint8 pointer ((value lsr 8) land 0xff); + put_uint8 pointer (value land 0xff) +let put_uint32 = put_sint32 + +let get_string pointer = + let index = + try + String.index_from pointer.buffer pointer.offset '\000' + with Not_found -> + String.length pointer.buffer + in + let offset = pointer.offset in + pointer.offset <- index + 1; + String.sub pointer.buffer offset (index - offset) + +let put_string pointer value = + let len = String.length value in + if len > String.length pointer.buffer - pointer.offset then + invalid_arg "RW.put_string: string too long" + else begin + String.blit value 0 pointer.buffer pointer.offset len; + let offset = pointer.offset + len in + if offset < String.length pointer.buffer then begin + pointer.buffer.[offset] <- '\x00'; + pointer.offset <- offset + 1 + end else + pointer.offset <- offset + end diff --git a/PC_Mainboard/driver/RW.mli b/PC_Mainboard/driver/RW.mli index 4fe39fa..92948c0 100644 --- a/PC_Mainboard/driver/RW.mli +++ b/PC_Mainboard/driver/RW.mli @@ -7,20 +7,38 @@ * This file is a part of [kro]bot. *) -val get_int8 : string -> int -> int -val set_int8 : string -> int -> int -> unit +(** Serialisation/deserialisation *) -val get_int16 : string -> int -> int -val set_int16 : string -> int -> int -> unit +(** {6 Writing} *) -val get_int32 : string -> int -> int -val set_int32 : string -> int -> int -> unit +type writer -val get_uint8 : string -> int -> int -val set_uint8 : string -> int -> int -> unit +val writer : string -> writer + (** [writer buffer] creates a writer which writes into [buffer] *) -val get_uint16 : string -> int -> int -val set_uint16 : string -> int -> int -> unit +val put_sint8 : writer -> int -> unit +val put_sint16 : writer -> int -> unit +val put_sint32 : writer -> int -> unit -val get_uint32 : string -> int -> int -val set_uint32 : string -> int -> int -> unit +val put_uint8 : writer -> int -> unit +val put_uint16 : writer -> int -> unit +val put_uint32 : writer -> int -> unit + +val put_string : writer -> string -> unit + +(** {6 Reading} *) + +type reader + +val reader : string -> reader + (** [reader buffer] creates a reader which reads from [buffer] *) + +val get_sint8 : reader -> int +val get_sint16 : reader -> int +val get_sint32 : reader -> int + +val get_uint8 : reader -> int +val get_uint16 : reader -> int +val get_uint32 : reader -> int + +val get_string : reader -> string diff --git a/PC_Mainboard/driver/card.ml b/PC_Mainboard/driver/card.ml index 5ecf347..4956a72 100644 --- a/PC_Mainboard/driver/card.ml +++ b/PC_Mainboard/driver/card.ml @@ -44,24 +44,24 @@ let make_buffer () = String.make data_length '\000' (* Parse un message depuis un buffer brut: *) let parse_message buf = { - host_serial = Char.code buf.[Protocol.up_hseq]; - device_serial = Char.code buf.[Protocol.up_dseq]; - command = Char.code buf.[Protocol.up_cmd]; - error = Char.code buf.[Protocol.up_err]; - data = String.sub buf Protocol.up_data 52; + host_serial = Char.code buf.[PcInterface.up_hseq]; + device_serial = Char.code buf.[PcInterface.up_dseq]; + command = Char.code buf.[PcInterface.up_cmd]; + error = Char.code buf.[PcInterface.up_err]; + data = String.sub buf PcInterface.up_data 52; } (* Créé un buffer brut depuis un message: *) let forge_message msg = let buf = String.make 64 '\000' in - buf.[Protocol.up_hseq] <- Char.chr msg.host_serial; - buf.[Protocol.up_dseq] <- Char.chr msg.device_serial; - buf.[Protocol.up_cmd] <- Char.chr msg.command; - buf.[Protocol.up_err] <- Char.chr msg.error; + buf.[PcInterface.up_hseq] <- Char.chr msg.host_serial; + buf.[PcInterface.up_dseq] <- Char.chr msg.device_serial; + buf.[PcInterface.up_cmd] <- Char.chr msg.command; + buf.[PcInterface.up_err] <- Char.chr msg.error; if String.length msg.data > 52 then Printf.ksprintf invalid_arg "message body too big: %d > 52" (String.length msg.data) else begin - String.blit msg.data 0 buf Protocol.up_data (String.length msg.data); + String.blit msg.data 0 buf PcInterface.up_data (String.length msg.data); buf end @@ -190,7 +190,7 @@ let rec dispatch card = return () end else begin let msg = parse_message buffer in - if msg.command = Protocol.cmd_respond then begin + if msg.command = PcInterface.cmd_respond then begin match try Some(Int_map.find msg.host_serial card.reply_waiters) with Not_found -> None with | Some wakener -> card.reply_waiters <- Int_map.remove msg.host_serial card.reply_waiters; diff --git a/PC_Mainboard/driver/commands.ml b/PC_Mainboard/driver/commands.ml deleted file mode 100644 index 49b7eb2..0000000 --- a/PC_Mainboard/driver/commands.ml +++ /dev/null @@ -1,315 +0,0 @@ -(* - * commands.ml - * ----------- - * Copyright : (c) 2010, Jeremie Dimino <je...@di...> - * Licence : BSD3 - * - * This file is a part of [kro]bot. - *) - -open Lwt -open Types - -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 "" - -let reset card = - Card.send_command card Protocol.cmd_reset "" - -let test card = - Card.send_command card Protocol.cmd_test "" - -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 now = - 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; - RW.set_uint8 data 6 (if now then - Protocol.ax12_exec_now - else - Protocol.ax12_exec_action); - lwt _ = Card.send_request card Protocol.cmd_ax12 data in - return () - - let ping card id timeout = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.ax12_ping; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 timeout; - lwt data = Card.send_request card Protocol.cmd_ax12 data in - return (RW.get_uint8 data 0) - - let read8 card id reg timeout = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.ax12_read; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 Protocol.ax12_value8; - RW.set_uint8 data 4 timeout; - lwt data = Card.send_request card Protocol.cmd_ax12 data in - return (RW.get_uint8 data 0) - - let read16 card id reg timeout = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.ax12_read; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 Protocol.ax12_value16; - RW.set_uint8 data 4 timeout; - lwt data = Card.send_request card Protocol.cmd_ax12 data in - return (RW.get_uint16 data 0) - - let write8 card id reg value = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.ax12_write; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 Protocol.ax12_value8; - RW.set_uint8 data 4 value; - lwt data = Card.send_request card Protocol.cmd_ax12 data in - return () - - let write16 card id reg value = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.ax12_write; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 Protocol.ax12_value16; - RW.set_uint16 data 4 value; - lwt data = Card.send_request card Protocol.cmd_ax12 data in - return () - - let get_pos card id timeout = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.ax12_get_pos; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 timeout; - lwt data = Card.send_request card Protocol.cmd_ax12 data in - return (RW.get_uint16 data 0) - - let get_speed card id timeout = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.ax12_get_speed; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 timeout; - lwt data = Card.send_request card Protocol.cmd_ax12 data in - return (RW.get_uint16 data 0) - - let get_load card id timeout = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.ax12_get_load; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 timeout; - lwt data = Card.send_request card Protocol.cmd_ax12 data in - return (RW.get_uint16 data 0) - - let stats card id timeout = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.ax12_get_stats; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 timeout; - lwt data = Card.send_request card Protocol.cmd_ax12 data in - return { ax12_position = RW.get_int16 data 0; - ax12_speed = RW.get_int16 data 2; - ax12_torque = RW.get_int16 data 4; - ax12_voltage = RW.get_uint8 data 6; - ax12_temperature = RW.get_uint8 data 7; - ax12_cw_angle_limit = RW.get_int16 data 8; - ax12_ccw_angle_limit = RW.get_int16 data 10 } - - let write_reg8 card id reg value = - let data = String.create 5 in - RW.set_uint8 data 0 Protocol.ax12_write_reg; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 Protocol.ax12_value8; - RW.set_uint8 data 4 value; - lwt _ = Card.send_request card Protocol.cmd_ax12 data in - return () - - let write_reg16 card id reg value = - let data = String.create 6 in - RW.set_uint8 data 0 Protocol.ax12_write_reg; - RW.set_uint8 data 1 id; - RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 Protocol.ax12_value16; - RW.set_int16 data 4 value; - lwt _ = Card.send_request card Protocol.cmd_ax12 data in - return () - - let action card id = - let data = String.create 2 in - RW.set_uint8 data 0 Protocol.ax12_action; - RW.set_uint8 data 1 id; - 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))) - - let get_calibration card num = - if num < 0 || num > 7 then invalid_arg "Commands.Range_finders.get_calibration"; - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.get_rangefinder_calibration; - RW.set_uint8 data 1 num; - lwt data = Card.send_request card Protocol.cmd_get data in - return (Array.init 8 (fun i -> RW.get_uint8 data i)) - - let calibration_start card num skip_meas = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.cal_start; - RW.set_uint8 data 1 num; - RW.set_uint8 data 2 (if skip_meas then 1 else 0); - Card.send_command card Protocol.cmd_calibrate data - - let calibration_continue card = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.cal_continue; - Card.send_command card Protocol.cmd_calibrate data - - let calibration_stop card = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.cal_stop; - Card.send_command card Protocol.cmd_calibrate data -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_backward card (-dist) speed acc - else - backend Protocol.traj_forward card dist speed acc - - let turn card ~angle ~speed ~acc = - if angle < 0 then - backend Protocol.traj_tr card (-angle) speed acc - else - backend Protocol.traj_tl card angle speed acc - - let goto card ~x ~y ~speed ~acc ~mode ~bypass_dist = - let data = Card.make_buffer () in - RW.set_uint8 data 0 Protocol.traj_goto; - RW.set_int16 data 1 x; - RW.set_int16 data 3 y; - RW.set_int16 data 5 speed; - RW.set_int16 data 7 acc; - RW.set_uint8 data 9 (match mode with (* lm629.h:157 *) - | `Straight -> 0 - | `Curve_right -> 1 - | `Curve_left -> 2); - RW.set_int16 data 10 bypass_dist; - Card.send_command card Protocol.cmd_traj data - - (* Values comming from lm629.h *) - let int_of_direction motor dir = match motor, dir with - | `Right, `Forward -> -1 - | `Right, `Backward -> 1 - | _, `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 motor 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 motor 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/commands.mli b/PC_Mainboard/driver/commands.mli deleted file mode 100644 index 3832838..0000000 --- a/PC_Mainboard/driver/commands.mli +++ /dev/null @@ -1,72 +0,0 @@ -(* - * 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 -val reset : Card.t -> unit Lwt.t -val test : Card.t -> unit Lwt.t - -module Compass : sig - val get : Card.t -> int Lwt.t -end - -module AX12 : sig - val goto : Card.t -> int -> int -> int -> bool -> unit Lwt.t - val ping : Card.t -> int -> int -> int Lwt.t - val read8 : Card.t -> int -> int -> int -> int Lwt.t - val read16 : Card.t -> int -> int -> int -> int Lwt.t - val write8 : Card.t -> int -> int -> int -> unit Lwt.t - val write16 : Card.t -> int -> int -> int -> unit Lwt.t - val get_pos : Card.t -> int -> int -> int Lwt.t - val get_speed : Card.t -> int -> int -> int Lwt.t - val get_load : Card.t -> int -> int -> int Lwt.t - val stats : Card.t -> int -> int -> Types.ax12_stats Lwt.t - val write_reg8 : Card.t -> int -> int -> int -> unit Lwt.t - val write_reg16 : Card.t -> int -> int -> int -> unit Lwt.t - val action : Card.t -> 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 - val get_calibration : Card.t -> int -> int array Lwt.t - val calibration_start : Card.t -> int -> bool -> unit Lwt.t - val calibration_continue : Card.t -> unit Lwt.t - val calibration_stop : Card.t -> unit 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 - - val goto : Card.t -> x : int -> y : int -> speed : int -> acc : int -> mode : Types.goto_mode -> bypass_dist : 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/driver.ml b/PC_Mainboard/driver/driver.ml index 0003dcc..06ef21d 100644 --- a/PC_Mainboard/driver/driver.ml +++ b/PC_Mainboard/driver/driver.ml @@ -31,6 +31,8 @@ struct let get obj = obj.obus end) + include DBus_exports.Compass(OBus)(struct let get dev = dev.card end)(struct let name = "fr.krobot.Device.Compass.Unsafe" end) + include OBus.MakeInterface(struct let name = "fr.krobot.Device.Compass" end) OL_signal Value : int @@ -74,23 +76,9 @@ struct let get obj = obj.obus end) - include OBus.MakeInterface(struct let name = "fr.krobot.Device.AX12" end) + include DBus_exports.AX12(OBus)(struct let get dev = dev.card end)(struct let name = "fr.krobot.Device.AX12.Unsafe" end) - let wrap f dev = f dev.card - - OL_method Goto : int -> int -> int -> bool -> unit = wrap Commands.AX12.goto - OL_method Ping : int -> int -> int = wrap Commands.AX12.ping - OL_method Read8 : int -> int -> int -> int = wrap Commands.AX12.read8 - OL_method Read16 : int -> int -> int -> int = wrap Commands.AX12.read16 - OL_method Write8 : int -> int -> int -> unit = wrap Commands.AX12.write8 - OL_method Write16 : int -> int -> int -> unit = wrap Commands.AX12.write16 - OL_method GetPos : int -> int -> int = wrap Commands.AX12.get_pos - OL_method GetSpeed : int -> int -> int = wrap Commands.AX12.get_speed - OL_method GetLoad : int -> int -> int = wrap Commands.AX12.get_load - OL_method Stats : int -> int -> Types.ax12_stats = wrap Commands.AX12.stats - OL_method WriteReg8 : int -> int -> int -> unit = wrap Commands.AX12.write_reg8 - OL_method WriteReg16 : int -> int -> int -> unit = wrap Commands.AX12.write_reg16 - OL_method Action : int -> unit = wrap Commands.AX12.action + include OBus.MakeInterface(struct let name = "fr.krobot.Device.AX12" end) let make card path = return { @@ -116,13 +104,15 @@ struct let get obj = obj.obus end) + include DBus_exports.Logic_sensors(OBus)(struct let get dev = dev.card end)(struct let name = "fr.krobot.Device.LogicSensors.Unsafe" end) + include OBus.MakeInterface(struct let name = "fr.krobot.Device.LogicSensors" end) OL_signal Value : bool array OL_method Get : bool array = fun dev -> return dev.data let rec loop dev = - lwt data = Commands.Logic_sensors.get dev.card in + lwt data = Commands.Logic_sensors.get_state dev.card in if data <> dev.data then begin dev.data <- data; lwt () = value dev data in @@ -159,6 +149,8 @@ struct let get obj = obj.obus end) + include DBus_exports.Range_finders(OBus)(struct let get dev = dev.card end)(struct let name = "fr.krobot.Device.RangeFinders.Unsafe" end) + include OBus.MakeInterface(struct let name = "fr.krobot.Device.RangeFinders" end) OL_signal Value : int array @@ -174,7 +166,7 @@ struct Commands.Range_finders.calibration_continue dev.card let rec loop dev = - lwt data = Commands.Range_finders.get dev.card in + lwt data = Commands.Range_finders.get_state dev.card in if data <> dev.data then begin dev.data <- data; lwt () = value dev data in @@ -246,6 +238,8 @@ struct let get obj = obj.obus end) + include DBus_exports.Motor(OBus)(struct let get dev = dev.card end)(struct let name = "fr.krobot.Device.Motors.Unsafe" end) + include OBus.MakeInterface(struct let name = "fr.krobot.Device.Motors" end) (* +---------------------------------------------------------------+ @@ -283,7 +277,12 @@ struct else begin reset_speed dev; dev.move_state <- Ms_moving(if dist > 0 then `Forward else `Backward); - lwt () = Commands.Motor.move dev.card dist speed acc and _ = Lwt_event.next dev.traj_completed in + lwt () = + if dist > 0 then + Commands.Motor.forward dev.card dist speed acc + else + Commands.Motor.backward dev.card (-dist) speed acc + and _ = Lwt_event.next dev.traj_completed in let result = match dev.move_state with | Ms_stopping -> `Stopped @@ -302,7 +301,12 @@ struct | Ms_static -> reset_speed dev; dev.move_state <- Ms_moving `Turn; - lwt () = Commands.Motor.turn dev.card angle speed acc and _ = Lwt_event.next dev.traj_completed in + lwt () = + if angle > 0 then + Commands.Motor.right dev.card angle speed acc + else + Commands.Motor.left dev.card (-angle) speed acc + and _ = Lwt_event.next dev.traj_completed in let result = match dev.move_state with | Ms_stopping -> `Stopped @@ -312,14 +316,14 @@ struct dev.move_state <- Ms_static; return result - let goto dev x y speed acc mode bypass_dist = + let goto dev x y speed acc mode bypass_distance = match dev.move_state with | Ms_moving _ | Ms_stopping -> fail (Failure "already moving") | Ms_static -> reset_speed dev; dev.move_state <- Ms_moving `Goto; - lwt () = Commands.Motor.goto dev.card ~x ~y ~speed ~acc ~mode ~bypass_dist and _ = Lwt_event.next dev.traj_completed in + lwt () = Commands.Motor.goto dev.card ~x ~y ~velocity:speed ~acceleration:acc ~mode ~bypass_distance and _ = Lwt_event.next dev.traj_completed in let result = match dev.move_state with | Ms_stopping -> `Stopped @@ -350,7 +354,7 @@ struct let stop_motors dev motor mode = lwt () = Log.info_f "motor: stopping(motor=%s, mode=%s)" (string_of_motor motor) (string_of_stop_mode mode) in stop_move dev; - Commands.Motor.stop dev.card motor mode + Commands.Motor.traj_stop dev.card motor mode let set_speed dev motor speed acc = lwt () = Log.info_f "motor: set_speed(motor=%s, speed=%d, acc=%d)" (string_of_motor motor) speed acc in @@ -431,7 +435,7 @@ struct return () let make card path = - let commands = React.E.map (fun data -> Char.code data.[0]) (Card.connect card Protocol.cmd_traj)#event in + let commands = React.E.map (fun data -> Char.code data.[0]) (Card.connect card PcInterface.cmd_traj)#event in let dev = { obus = OBus_object.make path; card = card; @@ -440,7 +444,7 @@ struct inhibit_backward_until = 0.0; move_state = Ms_static; commands = commands; - traj_completed = React.E.filter ((=) Protocol.traj_completed) commands; + traj_completed = React.E.filter ((=) PcInterface.traj_completed) commands; speed_left = 0; speed_right = 0; stop_rthread = return (); @@ -514,14 +518,16 @@ struct let get obj = obj.obus end) - include OBus.MakeInterface(struct let name = "fr.krobot.Card" end) - let get_card dev = match React.S.value dev.card with | None -> Printf.ksprintf failwith "%s card is not available" dev.name | Some card -> card + include DBus_exports.Common(OBus)(struct let get = get_card end)(struct let name = "fr.krobot.Card.Unsafe" end) + + include OBus.MakeInterface(struct let name = "fr.krobot.Card" end) + OL_property_r Name : string = fun dev -> return (Card.name (get_card dev)) @@ -663,9 +669,9 @@ lwt () = in ignore begin - monitor_card ~name:"interace" ~vendor_id:Protocol.usb_vid ~product_id:Protocol.usb_pid_robot_interface ~set:set_card_interface + monitor_card ~name:"interace" ~vendor_id:PcInterface.usb_vid ~product_id:PcInterface.usb_pid_robot_interface ~set:set_card_interface (fun card -> - lwt () = Commands.Motor.enable card in + lwt () = Commands.Motor.enable card `Both in lwt () = Compass.OBus.export bus =|< Compass.make card ["fr"; "krobot"; "Devices"; "Compass"] and () = AX12.OBus.export bus =|< AX12.make card ["fr"; "krobot"; "Devices"; "AX12"] in return ()) @@ -676,7 +682,7 @@ lwt () = end; ignore begin - monitor_card ~name:"sensor" ~vendor_id:Protocol.usb_vid ~product_id:Protocol.usb_pid_proximity_sensor ~set:set_card_sensor + monitor_card ~name:"sensor" ~vendor_id:PcInterface.usb_vid ~product_id:PcInterface.usb_pid_proximity_sensor ~set:set_card_sensor (fun card -> lwt () = Logic_sensors.OBus.export bus =|< Logic_sensors.make card ["fr"; "krobot"; "Devices"; "LogicSensors"] and () = Range_finders.OBus.export bus =|< Range_finders.make card ["fr"; "krobot"; "Devices"; "RangeFinders"] in @@ -688,9 +694,9 @@ lwt () = end; ignore begin - monitor_card ~name:"motor" ~vendor_id:Protocol.usb_vid ~product_id:Protocol.usb_pid_motor_controller ~set:set_card_motor + monitor_card ~name:"motor" ~vendor_id:PcInterface.usb_vid ~product_id:PcInterface.usb_pid_motor_controller ~set:set_card_motor (fun card -> - lwt () = Commands.Motor.enable card and () = Commands.Motor.init_lm629 card in + lwt () = Commands.Motor.enable card `Both and () = Commands.Motor.traj_init card in lwt () = Motors.OBus.export bus =|< Motors.make card ["fr"; "krobot"; "Devices"; "Motors"] in return ()) (fun () -> diff --git a/PC_Mainboard/driver/object.ml b/PC_Mainboard/driver/object.ml new file mode 100644 index 0000000..e676ed1 --- /dev/null +++ b/PC_Mainboard/driver/object.ml @@ -0,0 +1,27 @@ +(* + * object.ml + * --------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +module type S = sig + type t + module MakeInterface(Name : OBus_interface.Name) : sig + val ol_interface : OBus_name.interface + val ol_method_call : OBus_name.member -> ('a, 'b Lwt.t, 'b) OBus_type.func -> (t -> 'a) -> unit + val ol_signal : OBus_name.member -> ('a, _) OBus_type.cl_sequence -> (t -> ?peer : OBus_peer.t -> 'a -> unit Lwt.t) + val ol_property_r : OBus_name.member -> + ('a, _) OBus_type.cl_single -> + (t -> 'a Lwt.t) -> unit + val ol_property_w : OBus_name.member -> + ('a, _) OBus_type.cl_single -> + (t -> 'a -> unit Lwt.t) -> unit + val ol_property_rw : OBus_name.member -> + ('a, _) OBus_type.cl_single -> + (t -> 'a Lwt.t) -> + (t -> 'a -> unit Lwt.t) -> unit + end +end diff --git a/PC_Mainboard/interface/gen_dbus_exports.ml b/PC_Mainboard/interface/gen_dbus_exports.ml new file mode 100644 index 0000000..a4e192b --- /dev/null +++ b/PC_Mainboard/interface/gen_dbus_exports.ml @@ -0,0 +1,99 @@ +(* + * gen_dbus_exports.ml + * ------------------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Printf +open Interface + +let rec print_apply cmd args = + printf "(fun dev "; + List.iter + (function + | Arg(name, typ) -> + printf "%s " (Utils.caml_lid name) + | Cst _ -> + ()) + args; + printf "-> %s" cmd; + List.iter + (function + | Arg(name, typ) -> + printf " %s" (Utils.caml_lid name) + | Cst _ -> + ()) + args; + printf ")\n" + +let rec print path indent = function + | Request req -> + printf "%sOL_method %s : " indent (Utils.caml_case req.req_name); + List.iter + (function + | Arg(name, typ) -> + printf "%s -> " typ.caml_type + | Cst _ -> + ()) + req.req_args; + let repl = + List.map + (function + | Arg(name, typ) -> (name, typ) + | Cst _ -> failwith "constants are not allowed in replies") + req.req_repl + in + let () = + match repl with + | [] -> + printf "unit" + | (name, typ) :: rest -> + printf "%s" typ.caml_type; + List.iter (fun (name, typ) -> printf " * %s" typ.caml_type) rest + in + printf " = "; + print_apply (sprintf "Commands.%s%s (Get.get dev)" path (Utils.caml_lid req.req_name)) req.req_args + + | Command cmd -> + printf "%sOL_method %s : " indent (Utils.caml_case cmd.cmd_name); + List.iter + (function + | Arg(name, typ) -> + printf "%s -> " typ.caml_type + | Cst _ -> + ()) + cmd.cmd_args; + printf "unit = "; + print_apply (sprintf "Commands.%s%s (Get.get dev)" path (Utils.caml_lid cmd.cmd_name)) cmd.cmd_args + + | Module(name, items) -> + printf "%smodule %s(M : Object.S)(Get : sig val get : M.t -> Card.t end)(Name : OBus_interface.Name) = struct\n" + indent (Utils.caml_uid name); + printf "%s include M.MakeInterface(Name)\n" indent; + List.iter (print (path ^ Utils.caml_uid name ^ ".") (indent ^ " ")) items; + printf "%send\n" indent + + | _ -> + () + +let rec split_top = function + | [] -> + ([], []) + | Module _ as item :: items -> + let modules, items = split_top items in + (item :: modules, items) + | item :: items -> + let modules, items = split_top items in + (modules, item :: items) + +let () = + let modules, items = split_top interface in + printf "open OBus_pervasives\n"; + printf "module Common(M : Object.S)(Get : sig val get : M.t -> Card.t end)(Name : OBus_interface.Name) = struct\n"; + printf " include M.MakeInterface(Name)\n"; + List.iter (print "" " ") items; + printf "end\n"; + List.iter (print "" "") modules diff --git a/PC_Mainboard/interface/gen_dbus_imports.ml b/PC_Mainboard/interface/gen_dbus_imports.ml new file mode 100644 index 0000000..098e686 --- /dev/null +++ b/PC_Mainboard/interface/gen_dbus_imports.ml @@ -0,0 +1,73 @@ +(* + * gen_dbus_imports.ml + * ------------------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Printf +open Interface + +let rec print indent = function + | Request req -> + printf "%sOP_method %s : " indent (Utils.caml_case req.req_name); + List.iter + (function + | Arg(name, typ) -> + printf "%s -> " typ.caml_type + | Cst _ -> + ()) + req.req_args; + let repl = + List.map + (function + | Arg(name, typ) -> (name, typ) + | Cst _ -> failwith "constants are not allowed in replies") + req.req_repl + in + let () = + match repl with + | [] -> + printf "unit" + | (name, typ) :: rest -> + printf "%s" typ.caml_type; + List.iter (fun (name, typ) -> printf " * %s" typ.caml_type) rest + in + printf "\n" + + | Command cmd -> + printf "%sOP_method %s : " indent (Utils.caml_case cmd.cmd_name); + List.iter + (function + | Arg(name, typ) -> + printf "%s -> " typ.caml_type + | Cst _ -> + ()) + cmd.cmd_args; + printf "unit\n"; + + | Module(name, items) -> + printf "%smodule %s = struct\n" indent (Utils.caml_uid name); + printf "%s include MakeDevice(struct let name = \"%s\" end)\n" indent (Utils.caml_case name); + List.iter (print (indent ^ " ")) items; + printf "%send\n" indent + + | _ -> + () + +let () = + print_string "\ +open OBus_pervasives +module MakeDevice(Name : sig val name : string end) = + OBus_interface.MakeCustom + (struct + type proxy = Krobot.t + let get krobot = OBus_proxy.make (Krobot.peer krobot) [\"fr\"; \"krobot\"; \"Devices\"; Name.name] + end) + (struct + let name = \"fr.krobot.Device.\" ^ Name.name + end) +"; + List.iter (print "") (List.filter (function Module _ -> true | _ -> false) interface) diff --git a/PC_Mainboard/interface/gen_script_commands.ml b/PC_Mainboard/interface/gen_script_commands.ml new file mode 100644 index 0000000..c78c853 --- /dev/null +++ b/PC_Mainboard/interface/gen_script_commands.ml @@ -0,0 +1,67 @@ +(* + * gen_script_commands.ml + * ---------------------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +open Printf +open Interface + +let print_common prefix path name args = + printf " register \"unsafe-%s%s\" (f%d" prefix name + (List.fold_left (fun n arg -> match arg with + | Arg _ -> n + 1 + | Cst _ -> n) 0 args); + List.iter (function + | Arg(name, { caml_type = "int" }) -> + printf " (int \"%s\")" name + | Arg(name, { caml_type = "bool" }) -> + printf " (keyword \"%s\" [(\"false\", false); (\"true\", true)])" name + | Arg(name, { caml_type = caml_type }) -> + if try String.sub caml_type 0 6 = "Types." with _ -> false then + printf " (__type_%s \"%s\")" (String.sub caml_type 6 (String.length caml_type - 6)) name + else + printf " (prout \"caca\")" + | Cst _ -> + ()) args; + printf ")\n"; + printf " (fun logger krobot"; + List.iter (function + | Arg(name, typ) -> + printf " %s" (Utils.caml_lid name) + | Cst _ -> + ()) args; + printf " ->\n"; + printf " lwt _ = Krobot_unsafe.%s%s krobot" path (Utils.caml_lid name); + List.iter (function + | Arg(name, typ) -> + printf " %s" (Utils.caml_lid name) + | Cst _ -> + ()) args; + printf " in\n"; + printf " Lwt.return ());\n" + +let rec print prefix path = function + | Request req -> + print_common prefix path req.req_name req.req_args + | Command cmd -> + print_common prefix path cmd.cmd_name cmd.cmd_args + | Enum enum -> + printf " let __type_%s name = keyword name [" (Utils.caml_lid enum.enm_name); + List.iter (fun (name, code) -> + printf "(\"%s\", `%s);" name (Utils.caml_uid name)) + enum.enm_keys; + printf "] in\n" + | Record _ -> + () + | Module(name, items) -> + List.iter (print (prefix ^ String.lowercase name ^ "-") (path ^ Utils.caml_uid name ^ ".")) items + +let () = + printf "open Script_commands\n"; + printf "let register () =\n"; + List.iter (print "" "") (List.filter (function Module _ -> true | _ -> false) interface); + printf " ()" diff --git a/PC_Mainboard/interface/gen_usb_commands_impl.ml b/PC_Mainboard/interface/gen_usb_commands_impl.ml new file mode 100644 index 0000000..97ef956 --- /dev/null +++ b/PC_Mainboard/interface/gen_usb_commands_impl.ml @@ -0,0 +1,120 @@ +(* + * gen_usb_commands_impl.ml + * ------------------------ + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(* Generate implementation for all USB commands used by the driver *) + +open Printf +open Interface + +let print_common indent name args = + printf "%slet %s card" indent (Utils.caml_lid name); + List.iter (function + | Arg(name, typ) -> + printf " ~%s" (Utils.caml_lid name) + | Cst _ -> + ()) args; + printf " =\n"; + printf "%s let data = Card.make_buffer () in\n" indent; + if args <> [] then begin + printf "%s let writer = RW.writer data in\n" indent; + List.iter + (function + | Arg(name, typ) -> + printf "%s %s;\n" indent (typ.writer (Utils.caml_lid name)) + | Cst(typ, value) -> + printf "%s %s;\n" indent (typ.writer (string_of_int value))) + args + end + +let rec print indent = function + | Request req -> + print_common indent req.req_name req.req_args; + printf "%s lwt data = Card.send_request card %d data in\n" indent req.req_code; + if req.req_repl <> [] then begin + printf "%s let reader = RW.reader data in\n" indent; + let repl = + List.map + (function + | Arg(name, typ) -> + (Utils.caml_lid name, typ) + | Cst _ -> + failwith "constant are not allowed in replies") + req.req_repl + in + List.iter + (fun (name, typ) -> + printf "%s let %s = %s in\n" indent name typ.reader) + repl; + printf "%s return (%s)\n" indent (String.concat ", " (List.map fst repl)) + end else + printf "return ()\n" + | Command cmd -> + print_common indent cmd.cmd_name cmd.cmd_args; + printf "%s Card.send_command card %d data\n" indent cmd.cmd_code + | Enum enum -> + if not enum.enm_extern then + printf "%stype %s = [ %s ]\n" + indent (Utils.caml_lid enum.enm_name) + (String.concat " | " + (List.map + (fun (name, code) -> "`" ^ Utils.caml_uid name) + enum.enm_keys)); + + printf "%slet put_%s writer value =\n" indent (Utils.caml_lid enum.enm_name); + printf "%s let code = match value with\n" indent; + List.iter + ... [truncated message content] |
From: Jérémie D. <Ba...@us...> - 2010-02-22 07:30: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 d2fd20b4edbeb4c752610066e22224da6de64380 (commit) from f34246281fe250c22859c6f4821e85f6f15632d0 (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 d2fd20b4edbeb4c752610066e22224da6de64380 Author: Jérémie Dimino <je...@di...> Date: Mon Feb 22 08:30:25 2010 +0100 installation stuff ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/Makefile b/PC_Mainboard/Makefile index 005dcbb..96a8d60 100644 --- a/PC_Mainboard/Makefile +++ b/PC_Mainboard/Makefile @@ -5,10 +5,10 @@ # # This file is a part of [kro]bot. -PREFIX=/usr/local +PREFIX := $(HOME) -OC = ocamlbuild -Is common,lib_krobot -OF = ocamlfind +OC := ocamlbuild -Is common,lib_krobot +OF := ocamlfind ifeq ($(TERM),dumb) OC += -classic-display @@ -22,6 +22,20 @@ all: clean: $(OC) -clean -.PHONY: send -send: - scp $(wildcard _build/**/*.best) ol...@mr...:bin +.PHONY: install +install: + install -m 0755 _build/card_tools/send_firmware.best $(PREFIX)/bin/krobot-send-firmware + install -m 0755 _build/card_tools/dump_memory.best $(PREFIX)/bin/krobot-dump-memory + install -m 0755 _build/tools/forward_dbus.best $(PREFIX)/bin/krobot-forward-dbus + install -m 0755 _build/clients/info.best $(PREFIX)/bin/krobot-info + install -m 0755 _build/clients/joy_control.best $(PREFIX)/bin/krobot-joystick + install -m 0755 _build/clients/controller.best $(PREFIX)/bin/krobot-controller + install -m 0755 _build/services/hard_stop.best $(PREFIX)/bin/krobot-hard-stop + install -m 0755 _build/driver/driver.best $(PREFIX)/bin/krobot-driver + +.PHONY: uninstall +uninstall: + rm -vf $(PREFIX)/bin/krobot-* + +.PHONY: reinstall +reinstall: uninstall install hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-21 22:41:10
|
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 f34246281fe250c22859c6f4821e85f6f15632d0 (commit) from 974806721a2e38d30612cafcbbd8f86f6812ba31 (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 f34246281fe250c22859c6f4821e85f6f15632d0 Author: Jérémie Dimino <je...@di...> Date: Sun Feb 21 23:40:53 2010 +0100 typos ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/script.ml b/PC_Mainboard/clients/script.ml index 93619ef..2d6a19b 100644 --- a/PC_Mainboard/clients/script.ml +++ b/PC_Mainboard/clients/script.ml @@ -261,8 +261,8 @@ let () = ("curve-left", `Curve_left); ("curve-right", `Curve_right)]) (int ~default:0 "bypass-dist")) - (fun logger krobot x y speed acc mode bypass now -> - Krobot.goto krobot x y speed acc mode bypass now >>= move_result logger); + (fun logger krobot x y speed acc mode bypass -> + Krobot.goto krobot x y speed acc mode bypass >>= move_result logger); (* +---------------------------------------------------------------+ | Motors low-level conrol | diff --git a/PC_Mainboard/driver/commands.ml b/PC_Mainboard/driver/commands.ml index a96f831..49b7eb2 100644 --- a/PC_Mainboard/driver/commands.ml +++ b/PC_Mainboard/driver/commands.ml @@ -53,7 +53,7 @@ struct RW.set_uint8 data 6 (if now then Protocol.ax12_exec_now else - Protocol.ax12_exec_prepare); + Protocol.ax12_exec_action); lwt _ = Card.send_request card Protocol.cmd_ax12 data in return () hooks/post-receive -- krobot |
From: Xavier L. <Ba...@us...> - 2010-02-21 22:34:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "krobot". The branch, master has been updated via 974806721a2e38d30612cafcbbd8f86f6812ba31 (commit) from ef68adf5d8a6209f7a0b8f9dbf2a487e9b04f242 (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 974806721a2e38d30612cafcbbd8f86f6812ba31 Author: Xavier Lagorce <Xav...@cr...> Date: Sun Feb 21 23:31:52 2010 +0100 Added a 'mode' argument to the AX12 goTo function to tell if the action should be executed immediately or after an ACTION command. Also modified the USB protocol to be able to transmit this argument ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/common/PcInterface.h b/PC_Mainboard/common/PcInterface.h index 6928d8e..8fd98e0 100644 --- a/PC_Mainboard/common/PcInterface.h +++ b/PC_Mainboard/common/PcInterface.h @@ -17,6 +17,22 @@ #define USB_PID_BOOTLOADER 0x000b ///< Product ID d'une carte en mode bootloader // Protocole USB +typedef struct _UP { + BYTE HSEQ; + BYTE DSEQ; + BYTE CMD; + BYTE ERR; + BYTE RES0; + BYTE RES1; + BYTE RES2; + BYTE RES3; + BYTE DATA[52]; + BYTE RES4; + BYTE RES5; + BYTE RES6; + BYTE RES7; +} UP; + #define UP_HSEQ 0 ///< Host sequence number #define UP_DSEQ 1 ///< Device sequence number #define UP_CMD 2 @@ -113,6 +129,12 @@ #define AX12_WRITE_REG 0x09 #define AX12_ACTION 0x10 +#define AX12_VALUE8 0x00 +#define AX12_VALUE16 0x01 + +#define AX12_EXEC_NOW 0x00 +#define AX12_EXEC_ACTION 0x01 + // CMD_TRAJ #define TRAJ_INIT 0x00 #define TRAJ_FORWARD 0x01 diff --git a/PC_Mainboard/python/dev/USB_Com_Layer/src/PcInterface.h b/PC_Mainboard/python/dev/USB_Com_Layer/src/PcInterface.h index 6928d8e..8fd98e0 100644 --- a/PC_Mainboard/python/dev/USB_Com_Layer/src/PcInterface.h +++ b/PC_Mainboard/python/dev/USB_Com_Layer/src/PcInterface.h @@ -17,6 +17,22 @@ #define USB_PID_BOOTLOADER 0x000b ///< Product ID d'une carte en mode bootloader // Protocole USB +typedef struct _UP { + BYTE HSEQ; + BYTE DSEQ; + BYTE CMD; + BYTE ERR; + BYTE RES0; + BYTE RES1; + BYTE RES2; + BYTE RES3; + BYTE DATA[52]; + BYTE RES4; + BYTE RES5; + BYTE RES6; + BYTE RES7; +} UP; + #define UP_HSEQ 0 ///< Host sequence number #define UP_DSEQ 1 ///< Device sequence number #define UP_CMD 2 @@ -113,6 +129,12 @@ #define AX12_WRITE_REG 0x09 #define AX12_ACTION 0x10 +#define AX12_VALUE8 0x00 +#define AX12_VALUE16 0x01 + +#define AX12_EXEC_NOW 0x00 +#define AX12_EXEC_ACTION 0x01 + // CMD_TRAJ #define TRAJ_INIT 0x00 #define TRAJ_FORWARD 0x01 diff --git a/PC_Mainboard/python/dev/User_Interface/PcInterface.h b/PC_Mainboard/python/dev/User_Interface/PcInterface.h index 6928d8e..8fd98e0 100644 --- a/PC_Mainboard/python/dev/User_Interface/PcInterface.h +++ b/PC_Mainboard/python/dev/User_Interface/PcInterface.h @@ -17,6 +17,22 @@ #define USB_PID_BOOTLOADER 0x000b ///< Product ID d'une carte en mode bootloader // Protocole USB +typedef struct _UP { + BYTE HSEQ; + BYTE DSEQ; + BYTE CMD; + BYTE ERR; + BYTE RES0; + BYTE RES1; + BYTE RES2; + BYTE RES3; + BYTE DATA[52]; + BYTE RES4; + BYTE RES5; + BYTE RES6; + BYTE RES7; +} UP; + #define UP_HSEQ 0 ///< Host sequence number #define UP_DSEQ 1 ///< Device sequence number #define UP_CMD 2 @@ -113,6 +129,12 @@ #define AX12_WRITE_REG 0x09 #define AX12_ACTION 0x10 +#define AX12_VALUE8 0x00 +#define AX12_VALUE16 0x01 + +#define AX12_EXEC_NOW 0x00 +#define AX12_EXEC_ACTION 0x01 + // CMD_TRAJ #define TRAJ_INIT 0x00 #define TRAJ_FORWARD 0x01 diff --git a/USB_Dev_Board/Firmware/PcInterface.h b/USB_Dev_Board/Firmware/PcInterface.h index 4310e8b..8fd98e0 100644 --- a/USB_Dev_Board/Firmware/PcInterface.h +++ b/USB_Dev_Board/Firmware/PcInterface.h @@ -129,6 +129,12 @@ typedef struct _UP { #define AX12_WRITE_REG 0x09 #define AX12_ACTION 0x10 +#define AX12_VALUE8 0x00 +#define AX12_VALUE16 0x01 + +#define AX12_EXEC_NOW 0x00 +#define AX12_EXEC_ACTION 0x01 + // CMD_TRAJ #define TRAJ_INIT 0x00 #define TRAJ_FORWARD 0x01 diff --git a/USB_Module/Battery_Monitoring/Firmware/PcInterface.h b/USB_Module/Battery_Monitoring/Firmware/PcInterface.h index 4310e8b..8fd98e0 100644 --- a/USB_Module/Battery_Monitoring/Firmware/PcInterface.h +++ b/USB_Module/Battery_Monitoring/Firmware/PcInterface.h @@ -129,6 +129,12 @@ typedef struct _UP { #define AX12_WRITE_REG 0x09 #define AX12_ACTION 0x10 +#define AX12_VALUE8 0x00 +#define AX12_VALUE16 0x01 + +#define AX12_EXEC_NOW 0x00 +#define AX12_EXEC_ACTION 0x01 + // CMD_TRAJ #define TRAJ_INIT 0x00 #define TRAJ_FORWARD 0x01 diff --git a/USB_Module/Motor_Controller/Firmware/PcInterface.h b/USB_Module/Motor_Controller/Firmware/PcInterface.h index 4310e8b..8fd98e0 100644 --- a/USB_Module/Motor_Controller/Firmware/PcInterface.h +++ b/USB_Module/Motor_Controller/Firmware/PcInterface.h @@ -129,6 +129,12 @@ typedef struct _UP { #define AX12_WRITE_REG 0x09 #define AX12_ACTION 0x10 +#define AX12_VALUE8 0x00 +#define AX12_VALUE16 0x01 + +#define AX12_EXEC_NOW 0x00 +#define AX12_EXEC_ACTION 0x01 + // CMD_TRAJ #define TRAJ_INIT 0x00 #define TRAJ_FORWARD 0x01 diff --git a/USB_Module/Proximity_Sensor/Firmware/PcInterface.h b/USB_Module/Proximity_Sensor/Firmware/PcInterface.h index 4310e8b..8fd98e0 100644 --- a/USB_Module/Proximity_Sensor/Firmware/PcInterface.h +++ b/USB_Module/Proximity_Sensor/Firmware/PcInterface.h @@ -129,6 +129,12 @@ typedef struct _UP { #define AX12_WRITE_REG 0x09 #define AX12_ACTION 0x10 +#define AX12_VALUE8 0x00 +#define AX12_VALUE16 0x01 + +#define AX12_EXEC_NOW 0x00 +#define AX12_EXEC_ACTION 0x01 + // CMD_TRAJ #define TRAJ_INIT 0x00 #define TRAJ_FORWARD 0x01 diff --git a/USB_Module/Robot_Interface/Firmware/PcInterface.h b/USB_Module/Robot_Interface/Firmware/PcInterface.h index 4310e8b..8fd98e0 100644 --- a/USB_Module/Robot_Interface/Firmware/PcInterface.h +++ b/USB_Module/Robot_Interface/Firmware/PcInterface.h @@ -129,6 +129,12 @@ typedef struct _UP { #define AX12_WRITE_REG 0x09 #define AX12_ACTION 0x10 +#define AX12_VALUE8 0x00 +#define AX12_VALUE16 0x01 + +#define AX12_EXEC_NOW 0x00 +#define AX12_EXEC_ACTION 0x01 + // CMD_TRAJ #define TRAJ_INIT 0x00 #define TRAJ_FORWARD 0x01 diff --git a/USB_Module/Robot_Interface/Firmware/Robot_Interface.mcs b/USB_Module/Robot_Interface/Firmware/Robot_Interface.mcs index 7ded22f..1396fab 100644 --- a/USB_Module/Robot_Interface/Firmware/Robot_Interface.mcs +++ b/USB_Module/Robot_Interface/Firmware/Robot_Interface.mcs @@ -2,7 +2,7 @@ MagicCookie={0b13fe8c-dfe0-40eb-8900-6712719559a7} Version=1.0 [File000] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\usb_descriptors.o +Location=Z:\USB_Module\Robot_Interface\Firmware\output\usb_descriptors.o Folder=Intermediary DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -15,7 +15,7 @@ ToolArgsString= TraceCmdString= DebugOptions= [File001] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\main.o +Location=Z:\USB_Module\Robot_Interface\Firmware\output\main.o Folder=Intermediary DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -28,7 +28,7 @@ ToolArgsString= TraceCmdString= DebugOptions= [File002] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\eeprom.o +Location=Z:\USB_Module\Robot_Interface\Firmware\output\eeprom.o Folder=Intermediary DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -41,7 +41,7 @@ ToolArgsString= TraceCmdString= DebugOptions= [File003] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\usb_device.o +Location=Z:\USB_Module\Robot_Interface\Firmware\output\usb_device.o Folder=Intermediary DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -54,7 +54,7 @@ ToolArgsString= TraceCmdString= DebugOptions= [File004] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\usb_function_hid.o +Location=Z:\USB_Module\Robot_Interface\Firmware\output\usb_function_hid.o Folder=Intermediary DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -67,7 +67,7 @@ ToolArgsString= TraceCmdString= DebugOptions= [File005] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\ax12.o +Location=Z:\USB_Module\Robot_Interface\Firmware\output\ax12.o Folder=Intermediary DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -80,7 +80,7 @@ ToolArgsString= TraceCmdString= DebugOptions= [File006] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\error.o +Location=Z:\USB_Module\Robot_Interface\Firmware\output\error.o Folder=Intermediary DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -93,7 +93,7 @@ ToolArgsString= TraceCmdString= DebugOptions= [File007] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\servo.o +Location=Z:\USB_Module\Robot_Interface\Firmware\output\servo.o Folder=Intermediary DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -106,7 +106,7 @@ ToolArgsString= TraceCmdString= DebugOptions= [File008] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\mcc.o +Location=Z:\USB_Module\Robot_Interface\Firmware\output\mcc.o Folder=Intermediary DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -119,7 +119,7 @@ ToolArgsString= TraceCmdString= DebugOptions= [File009] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\adjd-s371.o +Location=Z:\USB_Module\Robot_Interface\Firmware\output\adjd-s371.o Folder=Intermediary DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -132,7 +132,7 @@ ToolArgsString= TraceCmdString= DebugOptions= [File010] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\Robot_Interface.cof +Location=Z:\USB_Module\Robot_Interface\Firmware\output\Robot_Interface.cof Folder=Output DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -145,7 +145,7 @@ ToolArgsString=/m"$(BINDIR_)$(TARGETBASE).map" /w /o"$(BINDIR_)$(TARGETBASE).cof TraceCmdString= DebugOptions= [File011] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\Robot_Interface.hex +Location=Z:\USB_Module\Robot_Interface\Firmware\output\Robot_Interface.hex Folder=Output DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} @@ -158,7 +158,7 @@ ToolArgsString=/m"$(BINDIR_)$(TARGETBASE).map" /w /o"$(BINDIR_)$(TARGETBASE).cof TraceCmdString= DebugOptions= [File012] -Location=C:\krobot\USB_Module\Robot_Interface\Firmware\output\Robot_Interface.map +Location=Z:\USB_Module\Robot_Interface\Firmware\output\Robot_Interface.map Folder=Output DeviceName=PIC18F4550 LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} diff --git a/USB_Module/Robot_Interface/Firmware/Robot_Interface.mcw b/USB_Module/Robot_Interface/Firmware/Robot_Interface.mcw index 05f476b..78a3b91 100644 Binary files a/USB_Module/Robot_Interface/Firmware/Robot_Interface.mcw and b/USB_Module/Robot_Interface/Firmware/Robot_Interface.mcw differ diff --git a/USB_Module/Robot_Interface/Firmware/ax12.c b/USB_Module/Robot_Interface/Firmware/ax12.c index 8b07a3a..176b1dc 100644 --- a/USB_Module/Robot_Interface/Firmware/ax12.c +++ b/USB_Module/Robot_Interface/Firmware/ax12.c @@ -390,8 +390,12 @@ void actionAX12(BYTE id) { * @param position Position a atteindre * * @param speed Vitesse de deplacement max ( 0 = maximum possible) + * + * @param mode Mode d'envoi des donn 'AX12@n + * #AX12_EXEC_NOW# va executer l'action demandee de suite@n + * #AX12_EXEC_ACTION# n'executera l'action qu'une fois l'instruction ACTION envoyee */ -void goTo(BYTE id, WORD position, WORD speed) { +void goTo(BYTE id, WORD position, WORD speed, BYTE mode) { WORD_VAL word; setParam(0, P_GOAL_POSITION); @@ -403,7 +407,10 @@ void goTo(BYTE id, WORD position, WORD speed) { word.Val = speed; setParam(3, word.byte.LB); // octet de poids faible setParam(4, word.byte.HB); // octet de poids fort - sendInstPacket(id, INST_WRITE, 5); + if (mode == AX12_EXEC_NOW) + sendInstPacket(id, INST_WRITE, 5); + else + sendInstPacket(id, INST_REG_WRITE, 5); } /** diff --git a/USB_Module/Robot_Interface/Firmware/ax12.h b/USB_Module/Robot_Interface/Firmware/ax12.h index 5f83e9a..9098f17 100644 --- a/USB_Module/Robot_Interface/Firmware/ax12.h +++ b/USB_Module/Robot_Interface/Firmware/ax12.h @@ -133,7 +133,7 @@ void regWrite16(BYTE id, BYTE reg, WORD value); void actionAX12(BYTE id); // Helper -void goTo(BYTE id, WORD position, WORD speed); +void goTo(BYTE id, WORD position, WORD speed, BYTE mode); int getPosition(BYTE id, UINT timeOut); int getSpeed(BYTE id, UINT timeOut); diff --git a/USB_Module/Robot_Interface/Firmware/main.c b/USB_Module/Robot_Interface/Firmware/main.c index f220bdf..20531af 100644 --- a/USB_Module/Robot_Interface/Firmware/main.c +++ b/USB_Module/Robot_Interface/Firmware/main.c @@ -896,7 +896,7 @@ void ProcessIO(void) { break; case AX12_READ: - if (ReceivedDataBuffer.DATA[3]) { + if (ReceivedDataBuffer.DATA[3] == AX12_VALUE16) { word1.Val = readValue16(ReceivedDataBuffer.DATA[1], ReceivedDataBuffer.DATA[2], ReceivedDataBuffer.DATA[4]); ToSendDataBuffer.DATA[0] = word1.byte.HB; ToSendDataBuffer.DATA[1] = word1.byte.LB; @@ -906,7 +906,7 @@ void ProcessIO(void) { break; case AX12_WRITE: - if (ReceivedDataBuffer.DATA[3]) { + if (ReceivedDataBuffer.DATA[3] == AX12_VALUE16) { word1.byte.HB = ReceivedDataBuffer.DATA[4]; word1.byte.LB = ReceivedDataBuffer.DATA[5]; writeValue16(ReceivedDataBuffer.DATA[1], ReceivedDataBuffer.DATA[2], word1.Val); @@ -920,7 +920,7 @@ void ProcessIO(void) { word1.byte.LB = ReceivedDataBuffer.DATA[3]; word2.byte.HB = ReceivedDataBuffer.DATA[4]; word2.byte.LB = ReceivedDataBuffer.DATA[5]; - goTo(ReceivedDataBuffer.DATA[1], word1.Val, word2.Val); + goTo(ReceivedDataBuffer.DATA[1], word1.Val, word2.Val, ReceivedDataBuffer.DATA[6]); break; case AX12_GET_POS: @@ -969,7 +969,7 @@ void ProcessIO(void) { break; case AX12_WRITE_REG: - if (ReceivedDataBuffer.DATA[3]) { + if (ReceivedDataBuffer.DATA[3] == AX12_VALUE16) { word1.byte.HB = ReceivedDataBuffer.DATA[4]; word1.byte.LB = ReceivedDataBuffer.DATA[5]; regWrite16(ReceivedDataBuffer.DATA[1], ReceivedDataBuffer.DATA[2], word1.Val); diff --git a/USB_Module/Robot_Interface/Firmware/output/Robot_Interface.cof b/USB_Module/Robot_Interface/Firmware/output/Robot_Interface.cof index f70ac35..7c3e46c 100644 Binary files a/USB_Module/Robot_Interface/Firmware/output/Robot_Interface.cof and b/USB_Module/Robot_Interface/Firmware/output/Robot_Interface.cof differ diff --git a/USB_Module/Robot_Interface/Firmware/output/Robot_Interface.hex b/USB_Module/Robot_Interface/Firmware/output/Robot_Interface.hex index c7d0b9b..3608778 100644 --- a/USB_Module/Robot_Interface/Firmware/output/Robot_Interface.hex +++ b/USB_Module/Robot_Interface/Firmware/output/Robot_Interface.hex @@ -1,52 +1,52 @@ :020000040000FA -:06000000A1EF1EF012004A +:06000000AAEF1EF0120041 :0600080004EF04F01200F9 :060018000CEF04F01200E1 -:06080000A1EF1EF0120042 +:06080000AAEF1EF0120039 :0608080034EF04F01200C1 :0608180074EF04F0120071 -:06082A000500D83D0000AE -:100830008600000024000000B73D0000CB0000004F -:1008400021000000AF3D000013010000080000007F -:100850009F3D0000EC00000010000000963D0000ED +:06082A000500EA3D00009C +:100830008600000024000000C93D0000CB0000003D +:1008400021000000C13D000013010000080000006D +:10085000B13D0000EC00000010000000A83D0000C9 :080860000A010000090000007C -:08086800EFEC0BF000EE22F0B2 +:08086800F1EC0BF000EE22F0B0 :10087000140EE80403E3EECFE4FFFBD700EE00F034 -:10088000220EE80403E3EECFE4FFFBD717EC0CF0F5 -:10089000A1A203D0A3EC18F0A1929EAA03D0E9EC88 -:1008A00011F09E9A9EA003D05FEC17F09E9021EC71 +:10088000220EE80403E3EECFE4FFFBD719EC0CF0F3 +:10089000A1A203D0ACEC18F0A1929EAA03D0EBEC7D +:1008A00011F09E9A9EA003D068EC17F09E9023EC66 :1008B0000CF002E2E16AE552E16EE552E7CFD9FFC2 :1008C000E55200EE21F0220EE80403E3E5CFEDFF50 :1008D000FBD700EE35F0140EE80403E3E5CFEDFF9F -:1008E000FBD704EC0CF01100D8CFE4FFE0CFE4FF1D -:1008F000E46EEFEC0BF000EE22F0140EE80403E3DC +:1008E000FBD706EC0CF01100D8CFE4FFE0CFE4FF1B +:1008F000E46EF1EC0BF000EE22F0140EE80403E3DA :10090000EECFE4FFFBD700EE00F0220EE80403E395 -:10091000EECFE4FFFBD717EC0CF0F2A403D046ECCB -:1009200017F0F29421EC0CF002E2E16AE552E16E7C +:10091000EECFE4FFFBD719EC0CF0F2A403D04FECC0 +:1009200017F0F29423EC0CF002E2E16AE552E16E7A :10093000E552E7CFD9FFE55200EE21F0220EE804A0 :1009400003E3E5CFEDFFFBD700EE35F0140EE8042E -:1009500003E3E5CFEDFFFBD704EC0CF0E550E5CF6A -:10096000E0FFE5CFD8FF100004D86CEC0CF056D8AF -:10097000FCD70F0EC11202D836EF0CF031EC0CF0A0 -:10098000E652C6EC0BF00001FC6F070EFC5D10E1B7 -:10099000E66A37EC1CF0E552DF6E000EDF8029ECD2 -:1009A0000CF0E66A73EC1EF0E552DF7029EC0CF0F7 +:1009500003E3E5CFEDFFFBD706EC0CF0E550E5CF68 +:10096000E0FFE5CFD8FF100004D86EEC0CF056D8AD +:10097000FCD70F0EC11202D838EF0CF033EC0CF09C +:10098000E652C8EC0BF00001FC6F070EFC5D10E1B5 +:10099000E66A40EC1CF0E552DF6E000EDF802BECC7 +:1009A0000CF0E66A7CEC1EF0E552DF702BEC0CF0EC :1009B00093809382948C948ED08EF28EF28C770EEC :1009C000C86E3F0E8A1693160101136B146B156BDC -:1009D000166B010E176FDCEC11F0E30E9516929278 -:1009E0009492A082FD0EE66EFBEC1CF0E552000E28 -:1009F000E66EE66A9AEC1DF0E552E5528394839622 -:100A0000839880928292E66A08EC17F0E552BFEC78 +:1009D000166B010E176FDEEC11F0E30E9516929276 +:1009E0009492A082FD0EE66E04EC1DF0E552000E1E +:1009F000E66EE66AA3EC1DF0E552E5528394839619 +:100A0000839880928292E66A11EC17F0E552C8EC66 :100A100019F0E552E552E7CFD9FF1200D9CFE6FF32 :100A2000E1CFD9FF170EE126160EDB6A010117513F -:100A300002E00BEC0BF0200E0001605D03E36D5053 -:100A4000020B02E001EF0BF0160EDB5036E008EC73 +:100A300002E00DEC0BF0200E0001605D03E36D5051 +:100A4000020B02E003EF0BF0160EDB5036E011EC68 :100A500018F0000932E001011551161102E1000EF3 :100A600008D015C1E9FF16C1EAFFEF50800B01E085 :100A7000010E000922E10501406B01011851182BFC :100A80000501416F05010C0E426F0501436B400EDD :100A9000E66E400EE66E050EE66E010EE66E010E87 -:100AA000E66E87EC10F0006E050EE15E0050F3CFAD +:100AA000E66E89EC10F0006E050EE15E0050F3CFAB :100AB00015F1F4CF16F1160EDB6A0101155116116E :100AC00002E1000E08D015C1E9FF16C1EAFFEF50A0 :100AD000800B01E0010E000947E10001EB51EA6AD9 @@ -54,42 +54,42 @@ :100AF000406B01011851182B0501416F0501040ECF :100B0000426F0001EB51EA6ACB0FE96E000EEA2258 :100B1000EFCF43F5400EE66E400EE66E050EE66E34 -:100B2000010EE66E010EE66E87EC10F0006E050E0B +:100B2000010EE66E010EE66E89EC10F0006E050E09 :100B3000E15E0050F3CF15F1F4CF16F10001EB5157 :100B4000EA6ACB0FE96E000EEA22EF6A0001EB5170 :100B5000000803E20001EB0707D00001EA5100089A :100B600003E200011F0EEB6F01011351141102E1AA :100B7000000E08D013C1E9FF14C1EAFFEF50800B4B -:100B800001E0010E000902E001EF0BF00501025146 -:100B9000070A02E167EF0AF0020A02E139EF0AF000 -:100BA0000E0A02E1E0EF09F0020A01E10FD20F0A9A +:100B800001E0010E000902E003EF0BF00501025144 +:100B9000070A02E169EF0AF0020A02E13BEF0AF0FC +:100BA0000E0A02E1E2EF09F0020A01E10FD20F0A98 :100BB00001E164D1040A1AE0030A07E0010A02E035 -:100BC000C0EF0AF0FF0001EF0BF0E66A37EC1CF013 -:100BD000E552DF6E000EDB80DFCFE6FFE66A17EC42 -:100BE0001CF0E552E552FF0001EF0BF00101155139 +:100BC000C2EF0AF0FF0003EF0BF0E66A40EC1CF006 +:100BD000E552DF6E000EDB80DFCFE6FFE66A20EC39 +:100BE0001CF0E552E552FF0003EF0BF00101155137 :100BF000161102E1000E08D015C1E9FF16C1EAFF87 :100C0000EF50800B01E0010E000901E036D100C574 :100C100040F50501416B0501030E426F0501436B71 :100C2000050108510A0A01E17ED00E0A71E0070AA7 :100C300064E0010A20E0030A06E0010A01E0F3D0C3 -:100C4000FCC048F5F3D00501486B0F0E006E3B0E5B +:100C4000FCC048F5F3D00501486B210E006E3B0E49 :100C5000016E026A00C0E6FF01C0E6FF02C0E6FFC7 -:100C6000480EE66E050EE66EFBEC1BF0036E050EFD -:100C7000E15E0350DBD00501486B030E006E3B0EB6 +:100C6000480EE66E050EE66E04EC1CF0036E050EF3 +:100C7000E15E0350DBD00501486B150E006E3B0EA4 :100C8000016E026A00C0E6FF01C0E6FF02C0E6FF97 -:100C9000480EE66E050EE66EFBEC1BF0036E050ECD -:100CA000E15E0350010E006E3B0E016E026A00C051 +:100C9000480EE66E050EE66E04EC1CF0036E050EC3 +:100CA000E15E0350130E006E3B0E016E026A00C03F :100CB000E6FF01C0E6FF02C0E6FF480EE66E050E45 -:100CC000E66EFBEC1BF0036E050EE15E0350F80EC2 -:100CD000006E3A0E016E026A00C0E6FF01C0E6FF38 -:100CE00002C0E6FF480EE66E050EE66EFBEC1BF05A +:100CC000E66E04EC1CF0036E050EE15E03500A0EA6 +:100CD000006E3B0E016E026A00C0E6FF01C0E6FF37 +:100CE00002C0E6FF480EE66E050EE66E04EC1CF050 :100CF000036E050EE15E035099D092CF48F593CF75 :100D000049F594CF4AF595CF4BF596CF4CF58ED05B :100D100080CF48F581CF49F582CF4AF583CF4BF597 -:100D200084CF4CF583D0800EE66E080EE66E25EC7F -:100D30001EF0E552E552C580BAEC1EF0C00EE66E1C -:100D40005EEC1DF0E552E66A5EEC1DF0E552C582F0 -:100D5000BAEC1EF0C10EE66E5EEC1DF0E552010E1F +:100D200084CF4CF583D0800EE66E080EE66E2EEC76 +:100D30001EF0E552E552C580C3EC1EF0C00EE66E13 +:100D400067EC1DF0E552E66A67EC1DF0E552C582DE +:100D5000C3EC1EF0C10EE66E67EC1DF0E552010E0D :100D6000DB6A020EDB6A010EDBCF00F0020EDBCF86 :100D700001F0040E005C000E01584FE2010EF36E0C :100D8000150EF3CFDBFFC586130EDB6A140EDB6A8C @@ -98,16 +98,16 @@ :100DB000020EDBCFEAFF480EE926050EEA22C9CF74 :100DC000EFFF150EDB6A06D0130EDB2A140E01E3CB :100DD000DB2ADED7150EDB5008E00501080E436F55 -:100DE000C58AC588BAEC1EF018D0010EDBCF00F022 +:100DE000C58AC588C3EC1EF018D0010EDBCF00F019 :100DF000020EDBCF01F0030E005C000E015803E28F -:100E0000C59AC58802D0C58AC588BAEC1EF0010E05 -:100E1000DB2A020E01E3DB2AA6D7C584BAEC1EF05A -:100E2000C8EC1EF003D00501020E436F400EE66EC3 +:100E0000C59AC58802D0C58AC588C3EC1EF0010EFC +:100E1000DB2A020E01E3DB2AA6D7C584C3EC1EF051 +:100E2000D1EC1EF003D00501020E436F400EE66EBA :100E3000400EE66E050EE66E010EE66E010EE66EE3 -:100E400087EC10F0006E050EE15E0050F3CF15F157 +:100E400089EC10F0006E050EE15E0050F3CF15F155 :100E5000F4CF16F1400EE66E000EE66E050EE66E5D -:100E6000E66A010EE66E87EC10F0006E050EE15E9C -:100E70000050F3CF13F1F4CF14F1C3D3050108519F +:100E6000E66A010EE66E89EC10F0006E050EE15E9A +:100E70000050F3CF13F1F4CF14F1C5D3050108519D :100E8000050A54E0010A49E0070A37E0010A25E0B3 :100E9000030A13E0010A01E080D005010951921212 :100EA00005010A51931205010B51941205010C51D1 @@ -119,792 +119,791 @@ :100F000005010A518A1205010B518B1205010C5182 :100F10008C1205010D518D1245D0050109510101B9 :100F20000F1B05010A5101010F133CD0050109A156 -:100F300007D00AC5E6FFE66A3BEC19F0E552E55238 -:100F4000050109A308D00BC5E6FF010EE66E3BECD8 +:100F300007D00AC5E6FFE66A44EC19F0E552E5522F +:100F4000050109A308D00BC5E6FF010EE66E44ECCF :100F500019F0E552E552050109A508D00CC5E6FFD8 -:100F6000020EE66E3BEC19F0E552E552050109A7C9 -:100F700008D00DC5E6FF030EE66E3BEC19F0E55216 +:100F6000020EE66E44EC19F0E552E552050109A7C0 +:100F700008D00DC5E6FF030EE66E44EC19F0E5520D :100F8000E552050109A908D00EC5E6FF040EE66E7C -:100F90003BEC19F0E552E55205D0030EE66E40EC4D +:100F900044EC19F0E552E55205D0030EE66E49EC3B :100FA0001EF0E552400EE66E000EE66E050EE66E91 -:100FB000E66A010EE66E87EC10F0006E050EE15E4B -:100FC0000050F3CF13F1F4CF14F11BD301011551ED +:100FB000E66A010EE66E89EC10F0006E050EE15E49 +:100FC0000050F3CF13F1F4CF14F11DD301011551EB :100FD000161102E1000E08D015C1E9FF16C1EAFFA3 -:100FE000EF50800B01E0010E000901E0E8D100C5DF +:100FE000EF50800B01E0010E000901E0EAD100C5DD :100FF00040F50501416B0501030E426F0501436B8E -:1010000005010851100A01E1AAD1190A01E181D1B3 -:10101000010A01E1E1D00F0A01E1C3D0010A01E1B7 -:10102000A8D0030A01E18DD0010A6AE0070A42E074 -:10103000010A11E0030A01E098D105010A51E66EA8 -:10104000E66A09C5E6FFEAEC12F0E552E552E55220 -:101050000501486F8DD105010B511BE005010C51B5 -:10106000E66EE66A0AC5E6FF09C5E6FFA7EC13F0DF +:1010000005010851100A01E1ACD1190A01E183D1AF +:10101000010A01E1E3D00F0A01E1C5D0010A01E1B3 +:10102000AAD0030A01E18FD0010A6AE0070A42E070 +:10103000010A11E0030A01E09AD105010A51E66EA6 +:10104000E66A09C5E6FFECEC12F0E552E552E5521E +:101050000501486F8FD105010B051BE105010C51FE +:10106000E66EE66A0AC5E6FF09C5E6FFA9EC13F0DD :10107000E552E552E552E5520F0EF3CFDBFF100EBD :10108000F4CFDBFF100EDBCF48F50F0EDBCF49F5B9 :1010900010D005010C51E66EE66A0AC5E6FF09C5E7 -:1010A000E6FF44EC13F0E552E552E552E552050146 -:1010B000486F5ED105010B5117E0100E0CC5DBFF28 +:1010A000E6FF46EC13F0E552E552E552E552050144 +:1010B000486F60D105010B0517E1100E0CC5DBFF71 :1010C0000F0E0DC5DBFF0F0EDBCFE6FF100EDBCFE3 -:1010D000E6FF0AC5E6FF09C5E6FF3DEC13F0E55261 +:1010D000E6FF0AC5E6FF09C5E6FF3FEC13F0E5525F :1010E000E552E552E5520BD00CC5E6FF0AC5E6FF16 -:1010F00009C5E6FF39EC13F0E552E552E55238D167 +:1010F00009C5E6FF3BEC13F0E552E552E5523AD163 :10110000100E0AC5DBFF0F0E0BC5DBFF120E0CC560 -:10111000DBFF110E0DC5DBFF110EDBCFE6FF120E5C -:10112000DBCFE6FF0F0EDBCFE6FF100EDBCFE6FFD7 -:1011300009C5E6FF28EC14F0006E050EE15E0050D4 -:1011400017D105010A51E66EE66A09C5E6FF44ECCF -:1011500014F0E552E552E5520F0EF3CFDBFF100E0F -:10116000F4CFDBFF100EDBCF48F50F0EDBCF49F5D8 -:10117000FFD005010A51E66EE66A09C5E6FF47ECB5 -:1011800014F0E552E552E5520F0EF3CFDBFF100EDF -:10119000F4CFDBFF100EDBCF48F50F0EDBCF49F5A8 -:1011A000E7D005010A51E66EE66A280EE66E09C52B -:1011B000E6FFA7EC13F0E552E552E552E5520F0EBB -:1011C000F3CFDBFF100EF4CFDBFF100EDBCF48F5C3 -:1011D0000F0EDBCF49F5CCD005010A51E66EE66A69 -:1011E00009C5E6FF44EC14F0E552E552E5520F0E56 -:1011F000F3CFDBFF100EF4CFDBFF100EDBCF48F593 -:101200000F0EDBCF49F505010A51E66EE66A09C506 -:10121000E6FF47EC14F0E552E552E5520F0EF3CF2E -:10122000DBFF100EF4CFDBFF100EDBCF4AF50F0E05 -:10123000DBCF4BF505010A51E66EE66A280EE66E35 -:1012400009C5E6FFA7EC13F0E552E552E552E55279 -:101250000F0EF3CFDBFF100EF4CFDBFF100EDBCF52 -:101260004CF50F0EDBCF4DF505010A51E66EE66A2F -:101270002A0EE66E09C5E6FF44EC13F0E552E5528E -:10128000E552E55205014E6F05010A51E66EE66A28 -:101290002B0EE66E09C5E6FF44EC13F0E552E5526D -:1012A000E552E55205014F6F05010A51E66EE66A07 -:1012B000060EE66E09C5E6FFA7EC13F0E552E5520F -:1012C000E552E5520F0EF3CFDBFF100EF4CFDBFF3C -:1012D000100EDBCF50F50F0EDBCF51F505010A5193 -:1012E000E66EE66A080EE66E09C5E6FFA7EC13F0A7 -:1012F000E552E552E552E5520F0EF3CFDBFF100E3B -:10130000F4CFDBFF100EDBCF52F50F0EDBCF53F522 -:101310002FD005010B5117E0100E0CC5DBFF0F0E8F -:101320000DC5DBFF0F0EDBCFE6FF100EDBCFE6FFB8 -:101330000AC5E6FF09C5E6FF1BEC14F0E552E552CD -:10134000E552E5520BD00CC5E6FF0AC5E6FF09C51C -:10135000E6FF17EC14F0E552E552E55209D009C555 -:10136000E6FF23EC14F0E55203D00501010E436FB4 -:10137000400EE66E400EE66E050EE66E010EE66E5F -:10138000010EE66E87EC10F0006E050EE15E005077 -:10139000F3CF15F1F4CF16F1400EE66E000EE66EB7 -:1013A000050EE66EE66A010EE66E87EC10F0006E42 -:1013B000050EE15E0050F3CF13F1F4CF14F121D10B -:1013C00005010851030A11E0010A09E0030A01E0DE -:1013D00037D009C5E6FF78EC17F0E55236D009C5DD -:1013E000E6FF86EC17F0E55230D00E0E0CC5DBFFA1 -:1013F0000D0E0DC5DBFF0C0E0EC5DBFF0B0E0FC572 -:10140000DBFFD9500B0FE96EDACFEAFFEECFE6FF34 -:10141000EECFE6FFEECFE6FFEFCFE6FF0BC5E6FF30 -:101420000AC5E6FF09C5E6FF94EC17F0006E070E4B -:10143000E15E0050010EF36E160EF3CFDBFF05D018 -:10144000010EE66E40EC1EF0E552400EE66E000E18 -:10145000E66E050EE66EE66A010EE66E87EC10F0AB -:10146000006E050EE15E0050F3CF13F1F4CF14F1DE -:10147000C8D0800EE66E080EE66E25EC1EF0E55232 -:10148000E552C580BAEC1EF0E66A5EEC1DF0E5524E -:10149000080EE66E050EE66EA6EC1BF0E552E55270 -:1014A000C584C8EC1EF0400EE66E000EE66E050E1A -:1014B000E66EE66A010EE66E87EC10F0006E050E31 -:1014C000E15E0050F3CF13F1F4CF14F19AD04F0E38 -:1014D000AB16AC9ACF0E9D16020EE66EE66A7C0E37 -:1014E000E66E61EC1BF0E552E552E552040EE66E45 -:1014F000E66AD8EC12F0E552E552100EE66E010EE7 -:10150000E66ED8EC12F0E552E552020EE66E030EDE -:10151000E66E010EE66E53EC12F0E552E552E5522E -:10152000040EE66EE66AD8EC12F0E552E552100EB3 -:10153000E66E010EE66ED8EC12F0E552E552020EB0 -:10154000E66E030EE66E010EE66E53EC12F0E55207 -:10155000E552E552DCEC11F0400EE66E000EE66E50 -:10156000050EE66EE66A010EE66E87EC10F0006E80 -:10157000050EE15E0050F3CF13F1F4CF14F141D02A -:1015800001011551161102E1000E08D015C1E9FF45 -:1015900016C1EAFFEF50800B01E0010E000931E1B6 -:1015A00000C540F50501416B0501030E426F0501C1 -:1015B000010E436F400EE66E400EE66E050EE66EBF -:1015C000010EE66E010EE66E87EC10F0006E050E61 -:1015D000E15E0050F3CF15F1F4CF16F1400EE66E48 -:1015E000000EE66E050EE66EE66A010EE66E87EC0C -:1015F00010F0006E050EE15E0050F3CF13F1F4CF52 -:1016000014F1170EE15C02E2E16AE552E16EE55287 -:10161000E7CFD9FF1200010119511A1104E1100E90 -:10162000196F270E1A6F1907000E1A5B6DA207D0EB -:1016300019511A112EE18A7C8ABC13D027D00001DF -:10164000605102E18A9C22D0600502E18A8C09D0B7 -:10165000020E605D02E18A8C19D0040E605D03E128 -:101660008A9C8A8E1200100E605D06E101011951FC -:101670001A110FE18A7C0AD0200E605D0AE1010197 -:1016800019511A1106E18A7C8AAC02D08A9E120096 -:101690008A8E1200120012001200120053EF1AF08C -:1016A00012001E0EE66E010EE66E55EC10F0E552CD -:1016B000E552400EE66E000EE66E050EE66EE66A38 -:1016C000010EE66E87EC10F0006E050EE15E005034 -:1016D000F3CF13F1F4CF14F112006D840001080E62 -:1016E000FD6F070EFE6FFD07000EFE5BFD51FE1144 -:1016F000FAE16D941200D9CFE6FFE1CFD9FFFD0EDC -:10170000DBCF2AF0FE0EDBCF2BF0010E2A1801E111 -:101710002B5033E0E8682A1802E1E8682B182BE028 -:10172000030E2A1801E12B5024E0040E2A1801E1CF -:101730002B501DE0020E2A1801E12B5016E0170E67 -:101740002A1801E12B500FE0160E2A1801E12B5048 -:1017500008E0150E2A1801E12B5001E010D0A1DF9E -:101760000FD09EDF0DD09ADF0BD096DF09D092DF2D -:1017700007D091DF05D091DF03D0000001D000D069 -:10178000010E00D0E552E7CFD9FF12006AD8E65229 -:10179000D0B202D0010E15D0D0B802D0020E11D0B6 -:1017A000D0B002D0030E0DD0D0B602D0040E09D0B6 -:1017B000FCAE02D0050E05D0FCAC02D0060E01D066 -:1017C000070EDF6ED088D086D084D082D080FC9E79 -:1017D000FC9CDF50E552E552E7CFD9FF1200DACF8B -:1017E000E4FFE2CFDAFFE9CFE4FFEACFE4FFF6CF90 -:1017F000E4FFF7CFE4FFF5CFE4FFF3CFE4FFF4CF4E -:10180000E4FFFACFE4FF1200E5CFFAFFE5CFF4FFE3 -:10181000E5CFF3FFE5CFF5FFE5CFF7FFE5CFF6FF27 -:10182000E5CFEAFFE5CFE9FFE5CFDAFF1200E652A8 -:1018300018D8020EE126F350DF6E010EF4CFDBFF65 -:101840001200DF50F36E010EDB50F46E020EE15C0D -:101850001200DFCFE6FFE66A17EC1CF0E552E55216 -:0C1860001200D9CFE6FFE1CFD9FF120043 -:04186C002EEC11F05D -:101870006A6A686A61EC11F06D8C6E6A11EC11F0A5 -:101880006D9CDF6A42EC11F010E2DF50040DF3CFE3 -:10189000E9FFF4CFEAFF000EE926040EEA22EE6A21 -:1018A000EE6AEE6AEE6ADF2AEDD7160E706E68A653 -:1018B00004D0030ED7EC10F0FAD70001736B786BED -:1018C000796B7A6B6D98080E6B6F040E6C6F616BA1 -:1018D000606BE552ECEF10F02EEC11F0000160515E -:1018E0000BE16D6A696A61EC11F06DB602D06D862C -:1018F000FCD70001010E606F600508E16DBA06D0EB -:10190000686A696A69806988020E606F6850040BB2 -:1019100007E06950040B04E0020ED7EC10F089D800 -:101920006DB247D06850010B14E06950010B11E013 -:101930009DDF0001040E606F0401200E026F040E93 -:10194000036F080E016F006B8C0E0013E66AA0ECAB -:1019500011F06850100B07E06950100B04E060D8DC -:10196000040ED7EC10F06850400B0BE06950400BB0 -:1019700008E068EC11F0020EDFEC10F0060ED7EC78 -:1019800010F06850200B04E06950200B01E035D8BE -:101990006850020B0AE06950020B07E068EC11F096 -:1019A000E668E668C0EC11F06A6A040E0001605D4A -:1019B00002E2A19A1FD069A61CD0DF6A040EDF5C88 -:1019C00018E268A616D06CCF80F0030ED7EC10F0AA -:1019D000780E0001801502E138D809D0000EE66EBD -:1019E000E66A800EE66E000EE66E010EE8DBDF2A88 -:1019F000E5D7A19AE552ECEF10F070A00ED0FAEC0A -:101A000010F0EF50800808E1D5DBEF50840804E1C6 -:101A1000FAEC10F08C0EEF6E7090050ED7EF10F010 -:101A20006984040EC4DB6D821AEC11F0040EDFEF42 -:101A300010F01AEC11F0030EC2DB6D92699468A4E9 -:101A400003D0020EB4DBFBD712002EEC11F0FD0E1A -:101A5000000180153DE17E0E8015E8407F0B040DEE -:101A6000F3CF63F0F4CF64F0000E6327040E642319 -:101A700063C065F064C066F06575BCDBEF503C0B7D -:101A8000E842E8420D0822E1B5DB97EC11F0EECF19 -:101A900000F0EFCF01F0280E001816E1040E011837 -:101AA00013E1D1EC11F0DF6AEDDB0EE2DF504AEC1E -:101AB00011F0DF50EA6A200FE96E040EEA22E552C7 -:101AC000E750EF6EDF2AF0D70AD807D01AD805D032 -:101AD000FD0E8015040801E122D8E5527DD36ADBB2 -:101AE000EF50800B02E066DBEF6A00016F6B706BFA -:101AF000746B756B736B64D89DDB170E60DB15EF31 -:101B00000FF0020E0001705D02E1A2EF0FF034D879 -:101B10000001815102E19CEF11F0816B12009EDB0C -:101B200049DBEF50400B01E0010EDF6E00016B75E9 -:101B3000080E605D09E122C46EFF6E50000802E2EB -:101B4000100E01D0040E606F700513E1D5EC11F09A -:101B5000A6D9020E00016F5D03E12CDB840E07D0D5 -:101B6000DF5003E127DBC80E02D024DB880EEF6EC6 -:101B700001D002D8E55230D32BDB0001706B1ADBA9 -:101B8000EF6A040E6B19006E6CC001F0DE6E6CC063 -:101B9000DDFF19DBEF6A78AF0CD07B517C1107E0D9 -:101BA00005D07CC0FAFF00017B51F96EFADF00011D -:101BB000789F020EE15C02E2E16AE552E16E0CD32D -:101BC00004012051600BE842E842E842E842E84262 -:101BD000000901E0120021510C0A45E00B0A3FE028 -:101BE0000C0A31E0010A22E00B0A1EE0020A1CE0A6 -:101BF000030A18E0080A10E0010A0CE00F0A08E0E6 -:101C0000030A01E012000001738F080E606F1200DA -:101C100095EF0EF0FEEF0FF00001610E716F000EF8 -:101C2000726F0CD0D6EF0EF034EF0EF0245100019D -:101C3000716F726B620E7127000E72237381010E39 -:101C4000746F738F12000001738F04012451EA6ACC -:101C5000620FE96E000EEA2222C4EFFF1200EADAF8 -:101C6000160EDFEF10F012007EDB040EE1260401F9 -:101C7000220510E120511F0B00090CE10001738FB8 -:101C8000030E0401215D04E10001010E7F6F02D00B -:101C900000017F6B0401225141E120511F0B02081A -:101CA0003DE124510F0B000939E00001738F04015D -:101CB00024BF05D0A4DA670EE926000E04D09FDA0F -:101CC0006B0EE926000ED2DA030E215D03E17BDA0A -:101CD000840E23D024510F0B016A700F006E0F0E7B -:101CE0000122020E00C0DBFF030E01C0DBFF020E6B -:101CF000DBCFE9FF030EDBCFEAFFEE90ED5224AF1E -:101D000006D061DAEF6ADF745EDA400E06D05BDA85 -:101D1000880EEF6EDF7457DAC80EEF6E040EE15CCA -:101D200002E2E16AE552E16E57D2800E0401205DC5 -:101D30003CE10001C00E736F04012351030A1EE051 -:101D4000010A09E0030A2FE10001740E716F350EDC -:101D5000726F120E22D0C3DA1C0EF626360EA2DAED -:101D6000020E0001F76A7125F66E7251F722090022 -:101D7000F5CF74F00A00F5CF75F01200030E225D66 -:101D80000FE2ADDA1E0EF626360E8CDA71C0F6FFC3 -:101D900072C0F7FF0800F5500001746F756B1200F8 -:101DA0000001736B12000001736B120011DA040161 -:101DB000286B296B20511F0B020A11E0030A0CE06B -:101DC000010A22E10001738F0401288100017F05CF -:101DD0001BE10401288318D00001738F15D0000186 -:101DE000738F040124BF05D00ADA670EE926000EBE -:101DF00004D005DA6B0EE926000E38DAE4D9EF508C -:101E0000040B02E0010E286F000173AF07D0280E0B -:101E1000716F040E726F7381020E746F020EE15CBB -:101E200002E2E16AE552E16ED7D16D98000173BF1D -:101E300008D078AF02D061DA2AD07EDABBD9840E1E -:101E400027D078BF2BD0040120AF24D000017451DB -:101E50000401265D000175510401275904E226C4DE -:101E600074F027C475F01BD80001010E706FA1DA61 -:101E7000800EEF6E816BBED9EE52080EEF6E91DAD6 -:101E8000B9D9840EEF6E010E816F8FDA93D9C80E27 -:101E9000EF6E1200000131DAC80EEF6E120098D911 -:101EA0000001080E745D000E75590DE274C0DEFF6E -:101EB00075C0DDFF6F5102E1010E03D06F0506E131 -:101EC000020E6F6F03D0080EDE6EDD6A73D9EF92DB -:101ED00071D9EF906FD9010EDB50EF126BD9EE5232 -:101EE000DFCFEFFF000EDB50745F010EDB50755B40 -:101EF000280E7D6F040E7E6F73B10FD0F7D91BE0F3 -:101F000071C0F6FF72C0F7FF712B000E722308003C -:101F1000F55096D9F3E2DB06F1D7E8D90CE071C0B1 -:101F2000E9FF72C0EAFF712B000E7223EF5088D9CF -:101F3000F4E2DB06F2D7020EE15C02E2E16AE5526E -:101F4000E16E4AD145D956D9EE52EFCFDFFFDFCF50 -:101F500000F000500001795D000E7A5903E279C06B -:101F6000DFFF09D0DF50006E016AE850795D796FBC -:101F700001507A597A6F010EDB6ADF50F36E010E61 -:101F8000DBCFF4FFF350F45C10E2010EDB5082D99A -:101F900076C0E9FF77C0EAFF762B000E7723E55283 -:101FA000E750EF6E010EDB2AE8D7000ED880795596 -:101FB000000E7A550DE2F4D854D91CD9EF50400BDD -:101FC00003E1EAD9C80E02D0E7D9880EEF6E0FD030 -:101FD000F0D9840EEF6E7B517C1107E005D07CC0F8 -:101FE000FAFF00017B51F96EFADF0001789F020EC3 -:101FF000E15C02E2E16AE552E16EEED00001738F2E -:1020000010D9010EE66EE66AE66A620EE66E000E12 -:10201000AFD922C461F00401225104E10001100E85 -:10202000606F12000001200E606F04D9150EDFEF03 -:1020300010F0CED8000EDE6E040EDD6EE8D8040D72 -:10204000F350006E016A020E0F0B05E0D8900132CA -:102050000032E806FBE1D89000360136D890003611 -:102060000136D9CFE9FFDACFEAFF0050EE26015062 -:10207000ED22A9D8EF9EFD0EDB5002E16AD901D016 -:102080006DD9EA22DECFEEFFDDCFEDFF9CD8EF9CCD -:102090009AD8040EE926000EEA22EF8C020EE15CCB -:1020A00002E2E16AE552E16E97D092D8FE0EDB5073 -:1020B000016A700F006E0F0EDFD885D8FD0EDBCFE2 -:1020C000EFFFDBA402D0E66AF5D8FD0EDBA203D059 -:1020D000010EE66EEFD8020EE15C02E2E16AE55223 -:1020E000E16E7AD075D8FE0EDB5005E125D962D8B5 -:1020F000840EEF6E05D08BD80CD989D8010F09D981 -:10210000020EE15C02E2E16AE552E16E65D060D860 -:10211000FD0EDB5002E022D901D01BD9A7D853D83D -:1021200006D9FB0EDBCFEEFFFC0EDBCFEDFF4BD86D -:10213000EE52FA0EDBCFEFFF400E45D8E850EF1617 -:10214000880E41D8E850EF12FD0EDB5002E006D9B0 -:1021500001D0FFD8EA22EF74DECF00F0DDCF01F02E -:1021600000C0F3FF01C0F4FF020EE15C02E2E16A8D -:10217000E552E16E31D0F7D8010EF36EFC0EDB5064 -:1021800004E0D890F336E806FCE1F31C006EFD0E87 -:10219000DBCFE9FFFE0EDBCFEAFF0050EF161CD0CD -:1021A000FBD8EE52080EEF6EF7D897EF11F0E66EFF -:1021B000A0EF11F06BC0E9FF6CC0EAFF1200E66E01 -:1021C000E66AC0EF11F0DECFE9FFDDCFEAFF1200D3 -:1021D000CAD8020EE1261200E552E7CFD9FF12005D -:1021E000D6D8CCEF11F0FE0EEA6ADB34FE0BEA36ED -:1021F000E96E120063C0E9FF64C0EAFF12002451D7 -:102200000F0BE96EEA6AD890E936EA361200FD0E45 -:10221000DB50E824026EFE0EDB50040DF350022466 -:102220001200000EE66EE66AE66A710EE66E0F0EAA -:10223000B8EF11F0000EE66EE66AE66EE66A12008E -:10224000E66E7DC0E9FF7EC0EAFF7D2B000E7E2397 -:10225000E552E750EF6EDF06010E120084D8E65219 -:102260001200280EEE6E040EED6E1200EA22EECF82 -:10227000DEFFEDCFDDFF1200012200C0DEFF01C056 -:10228000DDFF1200DF50006E016A080E005C000ED8 -:1022900001581200EA6A280FE96E040EEA22EF5094 -:1022A000E66E1200F7220900F5CF71F00A00F5CFB3 -:1022B00072F01200FE0EDBCFE6FFBBDEE552E55208 -:1022C0001200160E6F6E9F0E6B6E7B0E696E120003 -:1022D000010EE66EE66A000EE66EE66A1200225114 -:1022E000F66EF76AD890F636F7361200D9CFE9FFC6 -:1022F000DACFEAFFEE50ED101200020E706F5ADFD7 -:10230000EE52EF6A57DFC80EEF6E4ADFAADFCCEF5E -:1023100011F0040DF3CF00F0F4CF01F0000E002611 -:10232000040EAADF840E4FDFE850EF121200020EF7 -:10233000E926000EEA2212003CD88C0EEF6E120045 -:10234000680EE66E0F0EE66E16DFE552E552E552B8 -:10235000120049DF670EE926000E120044DF6B0E03 -:10236000E926000E1200D9CFE6FFE1CFD9FF120017 -:10237000E66EE1EC1BF0006E050EE15E005012000F -:102380007BEC0BF0006E060EE15E00501200200E9A -:10239000EE6E040EED6E120065C0E9FF66C0EAFF46 -:1023A000120028DFC4DFC7EF11F004DFC0DF31EF18 -:0823B00011F0F6DEF0EF10F071 -:0823B800959A838A190EE66E66 -:1023C000E66A7C0EE66E61EC1BF0E552E552E552E2 -:1023D0001200A9DA030EE126ACA2FED73FEC1DF0F5 -:1023E000DF6E0001A85104E1865102E1010EA96FE0 -:1023F000A90552E1A85182DADFCFEFFF020EA85DF6 -:1024000008E2FF0EDF5C05E0050E85DA0001A96B2E -:10241000A86B030EA85D04E1030EDF240001CA6F60 -:10242000030E0001A85D37E30001CA510001A85D59 -:1024300032E18B5102E0060E6EDA010EDB6A020E0B -:10244000DB6E0001CA51F36E020EDBCFF4FFF350D6 -:10245000F45C0EE2020EDB5051DA010EDBCFE7FF37 -:10246000EF50E726010EE7CFDBFF020EDB2AE9D7AC -:10247000CA5144DAEFCF00F0010EDB1C005C05E02E -:10248000070E49DA0001866B03D00001010E866F4A -:10249000A96BA86B01D0A82B030EE15C02E2E16AF4 -:1024A000E552E16E0FD23FDA220EE126010EDB6823 -:1024B000020EDB68FE0EDB50E76E030EE7CFDBFF9C -:1024C000FC0EDB50020FE76E040EE7CFDBFFFD0EC4 -:1024D000DB50E76E050EE7CFDBFFDF6AFC0EDB505B -:1024E000DF5C13E2DF50EA6AAA0FE96E000EEA220F -:1024F000EF50E66ED950010F006E050EDF24F0D9C3 -:10250000E552E750EF6EDF2AE9D7210EDB6A020EB3 -:10251000DF6EFC0EDB50050FDF5C0FE2D950010FC0 -:10252000006EDF50DDD9210EDBCFE7FFEF50E7264D -:10253000210EE7CFDBFFDF2AECD7210EDB1CE66E96 -:10254000D950010F006EFC0EDB50050FC9D9E552C2 -:10255000E750EF6E839ADF6AFC0EDB50060FDF5CFC -:1025600011E2ACA2FED7D950010F006EDACF01F014 -:10257000DF500F01B5D9EF50E66E8AEC1EF0E55240 -:10258000DF2AEAD7ACA2FED7838A0001866B220E2F -:10259000E15C02E2E16AE552E16E94D1000186510C -:1025A00012000001A751120000018651FDE0120047 -:1025B000BAD9FE0EDB50EA6AAA0FE96E000EEA22D3 -:1025C000FD0EDBCFEFFF7ED10001865102E08B5183 -:1025D0001200000CD9CFE6FFE1CFD9FF020EE126B1 -:1025E000E66A010EE66EFE0EDBCFE6FF5CDFE5522B -:1025F000E552E552DE6ADD6ADECF00F0DDCF01F0A4 -:10260000FC0EDBCF02F0FD0EDBCF03F00250005CCE -:102610000350015818E20001865104E00001A76B45 -:10262000010E16D0000000000000000000000000B5 -:10263000000000000000000000000000DF2A010E82 -:1026400001E3DB2AD9D70001010EA76F000E00D0ED -:10265000006E020EE15C02E2E16AE552E16E0050BA -:10266000E552E7CFD9FF12005ED9E66A060E12D90D -:1026700029D12CD9030E0ED925D115D969D902E259 -:10268000E16AE552E16E1ED1D9CFE6FFE1CFD9FF75 -:10269000020EE126FD0EDBCFE6FFE66A89DFE5529A -:1026A000E552010EE66E010EE66E82DFE552E5525E -:1026B000020EE66E020EE66EFE0EDBCFE6FFF3DEE6 -:1026C000E552E552E552DE6ADD6ADECF00F0DDCF8D -:1026D00001F00A0E2A6E2B6AFB0EDBCF2FF0FC0EE8 -:1026E000DBCF30F035EC16F028C002F029C003F043 -:1026F0000250005C0350015819E20001865105E0C8 -:102700000001A76B00018C5116D0000000000000F2 +:10111000DBFF110E0DC5DBFF0EC5E6FF110EDBCFA9 +:10112000E6FF120EDBCFE6FF0F0EDBCFE6FF100E61 +:10113000DBCFE6FF09C5E6FF2AEC14F0006E060ED1 +:10114000E15E005017D105010A51E66EE66A09C555 +:10115000E6FF4DEC14F0E552E552E5520F0EF3CFE9 +:10116000DBFF100EF4CFDBFF100EDBCF48F50F0EC8 +:10117000DBCF49F5FFD005010A51E66EE66A09C5E5 +:10118000E6FF50EC14F0E552E552E5520F0EF3CFB6 +:10119000DBFF100EF4CFDBFF100EDBCF48F50F0E98 +:1011A000DBCF49F5E7D005010A51E66EE66A280E65 +:1011B000E66E09C5E6FFA9EC13F0E552E552E552EB +:1011C000E5520F0EF3CFDBFF100EF4CFDBFF100E56 +:1011D000DBCF48F50F0EDBCF49F5CCD005010A5126 +:1011E000E66EE66A09C5E6FF4DEC14F0E552E552FD +:1011F000E5520F0EF3CFDBFF100EF4CFDBFF100E26 +:10120000DBCF48F50F0EDBCF49F505010A51E66E3D +:10121000E66A09C5E6FF50EC14F0E552E552E552E6 +:101220000F0EF3CFDBFF100EF4CFDBFF100EDBCF82 +:101230004AF50F0EDBCF4BF505010A51E66EE66A63 +:10124000280EE66E09C5E6FFA9EC13F0E552E5525B +:10125000E552E5520F0EF3CFDBFF100EF4CFDBFFAC +:10126000100EDBCF4CF50F0EDBCF4DF505010A510B +:10127000E66EE66A2A0EE66E09C5E6FF46EC13F056 +:10128000E552E552E552E55205014E6F05010A515E +:10129000E66EE66A2B0EE66E09C5E6FF46EC13F035 +:1012A000E552E552E552E55205014F6F05010A513D +:1012B000E66EE66A060EE66E09C5E6FFA9EC13F0D7 +:1012C000E552E552E552E5520F0EF3CFDBFF100E6B +:1012D000F4CFDBFF100EDBCF50F50F0EDBCF51F557 +:1012E00005010A51E66EE66A080EE66E09C5E6FFDC +:1012F000A9EC13F0E552E552E552E5520F0EF3CF9B +:10130000DBFF100EF4CFDBFF100EDBCF52F50F0E1C +:10131000DBCF53F52FD005010B0517E1100E0CC5DF +:10132000DBFF0F0E0DC5DBFF0F0EDBCFE6FF100E50 +:10133000DBCFE6FF0AC5E6FF09C5E6FF1DEC14F0AA +:10134000E552E552E552E5520BD00CC5E6FF0AC561 +:10135000E6FF09C5E6FF19EC14F0E552E552E55247 +:1013600009D009C5E6FF25EC14F0E55203D00501CC +:10137000010E436F400EE66E400EE66E050EE66E01 +:10138000010EE66E010EE66E89EC10F0006E050EA1 +:10139000E15E0050F3CF15F1F4CF16F1400EE66E8A +:1013A000000EE66E050EE66EE66A010EE66E89EC4C +:1013B00010F0006E050EE15E0050F3CF13F1F4CF94 +:1013C00014F121D105010851030A11E0010A09E0D5 +:1013D000030A01E037D009C5E6FF81EC17F0E552BA +:1013E00036D009C5E6FF8FEC17F0E55230D00E0E6F +:1013F0000CC5DBFF0D0E0DC5DBFF0C0E0EC5DBFFB4 +:101400000B0E0FC5DBFFD9500B0FE96EDACFEAFFE9 +:10141000EECFE6FFEECFE6FFEECFE6FFEFCFE6FF43 +:101420000BC5E6FF0AC5E6FF09C5E6FF9DEC17F010 +:10143000006E070EE15E0050010EF36E160EF3CF44 +:10144000DBFF05D0010EE66E49EC1EF0E552400EC2 +:10145000E66E000EE66E050EE66EE66A010EE66EBC +:1014600089EC10F0006E050EE15E0050F3CF13F131 +:10147000F4CF14F1C8D0800EE66E080EE66E2EECA6 +:101480001EF0E552E552C580C3EC1EF0E66A67EC3B +:101490001DF0E552080EE66E050EE66EAFEC1BF091 +:1014A000E552E552C584D1EC1EF0400EE66E000E0A +:1014B000E66E050EE66EE66A010EE66E89EC10F049 +:1014C000006E050EE15E0050F3CF13F1F4CF14F17E +:1014D0009AD04F0EAB16AC9ACF0E9D16020EE66E4A +:1014E000E66A7C0EE66E6AEC1BF0E552E552E552C8 +:1014F000040EE66EE66ADAEC12F0E552E552100EE2 +:10150000E66E010EE66EDAEC12F0E552E552020EDE +:10151000E66E030EE66E010EE66E55EC12F0E55235 +:10152000E552E552040EE66EE66ADAEC12F0E55298 +:10153000E552100EE66E010EE66EDAEC12F0E552A0 +:10154000E552020EE66E030EE66E010EE66E55ECF7 +:1015500012F0E552E552E552DEEC11F0400EE66E77 +:10156000000EE66E050EE66EE66A010EE66E89EC8A +:1015700010F0006E050EE15E0050F3CF13F1F4CFD2 +:1015800014F141D001011551161102E1000E08D0ED +:1015900015C1E9FF16C1EAFFEF50800B01E0010E13 +:1015A000000931E100C540F50501416B0501030E5D +:1015B000426F0501010E436F400EE66E400EE66E6F +:1015C000050EE66E010EE66E010EE66E89EC10F079 +:1015D000006E050EE15E0050F3CF15F1F4CF16F169 +:1015E000400EE66E000EE66E050EE66EE66A010E31 +:1015F000E66E89EC10F0006E050EE15E0050F3CF50 +:1016000013F1F4CF14F1170EE15C02E2E16AE55246 +:10161000E16EE552E7CFD9FF1200010119511A110D +:1016200004E1100E196F270E1A6F1907000E1A5BCE +:101630006DA207D019511A112EE18A7C8ABC13D0F1 +:1016400027D00001605102E18A9C22D0600502E1AE +:101650008A8C09D0020E605D02E18A8C19D0040EDA +:10166000605D03E18A9C8A8E1200100E605D06E1C7 +:10167000010119511A110FE18A7C0AD0200E605D18 +:101680000AE1010119511A1106E18A7C8AAC02D0E3 +:101690008A9E12008A8E120012001200120012009E +:1016A0005CEF1AF012001E0EE66E010EE66E57ECAD +:1016B00010F0E552E552400EE66E000EE66E050EA5 +:1016C000E66EE66A010EE66E89EC10F0006E050E1D +:1016D000E15E0050F3CF13F1F4CF14F112006D84EA +:1016E0000001080EFD6F070EFE6FFD07000EFE5B8A +:1016F000FD51FE11FAE16D941200D9CFE6FFE1CF62 +:10170000D9FFFD0EDBCF2AF0FE0EDBCF2BF0010E52 +:101710002A1801E12B5033E0E8682A1802E1E86852 +:101720002B182BE0030E2A1801E12B5024E0040EA5 +:101730002A1801E12B501DE0020E2A1801E12B505E +:1017400016E0170E2A1801E12B500FE0160E2A188A +:1017500001E12B5008E0150E2A1801E12B5001E0A1 +:1017600010D0A1DF0FD09EDF0DD09ADF0BD096DF17 +:1017700009D092DF07D091DF05D091DF03D00000C0 +:1017800001D000D0010E00D0E552E7CFD9FF120002 +:101790006AD8E652D0B202D0010E15D0D0B802D02D +:1017A000020E11D0D0B002D0030E0DD0D0B602D0B0 +:1017B000040E09D0FCAE02D0050E05D0FCAC02D060 +:1017C000060E01D0070EDF6ED088D086D084D0827E +:1017D000D080FC9EFC9CDF50E552E552E7CFD9FF5C +:1017E0001200DACFE4FFE2CFDAFFE9CFE4FFEACF7D +:1017F000E4FFF6CFE4FFF7CFE4FFF5CFE4FFF3CF4C +:10180000E4FFF4CFE4FFFACFE4FF1200E5CFFAFFE4 +:10181000E5CFF4FFE5CFF3FFE5CFF5FFE5CFF7FF29 +:10182000E5CFF6FFE5CFEAFFE5CFE9FFE5CFDAFF49 +:101830001200E65218D8020EE126F350DF6E010EB8 +:10184000F4CFDBFF1200DF50F36E010EDB50F46EBD +:10185000020EE15C1200DFCFE6FFE66A20EC1CF02E +:10186000E552E5521200D9CFE6FFE1CFD9FF1200D1 +:1018700030EC11F06A6A686A63EC11F06D8C6E6A84 +:1018800013EC11F06D9CDF6A44EC11F010E2DF50B4 +:10189000040DF3CFE9FFF4CFEAFF000EE926040EB2 +:1018A000EA22EE6AEE6AEE6AEE6ADF2AEDD7160EDB +:1018B000706E68A604D0030ED9EC10F0FAD70001C0 +:1018C000736B786B796B7A6B6D98080E6B6F040E87 +:1018D0006C6F616B606BE552EEEF10F030EC11F065 +:1018E000000160510BE16D6A696A63EC11F06DB63D +:1018F00002D06D86FCD70001010E606F600508E123 +:101900006DBA06D0686A696A69806988020E606F7C +:101910006850040B07E06950040B04E0020ED9EC98 +:1019200010F089D86DB247D06850010B14E06950AF +:10193000010B11E09DDF0001040E606F0401200E19 +:10194000026F040E036F080E016F006B8C0E001304 +:10195000E66AA2EC11F06850100B07E06950100B1A +:1019600004E060D8040ED9EC10F06850400B0BE096 +:101970006950400B08E06AEC11F0020EE1EC10F047 +:10198000060ED9EC10F06850200B04E06950200BD3 +:1019900001E035D86850020B0AE06950020B07E0FD +:1019A0006AEC11F0E668E668C2EC11F06A6A040EAF +:1019B0000001605D02E2A19A1FD069A61CD0DF6A17 +:1019C000040EDF5C18E268A616D06CCF80F0030E20 +:1019D000D9EC10F0780E0001801502E138D809D05A +:1019E000000EE66EE66A800EE66E000EE66E010EF2 +:1019F000E8DBDF2AE5D7A19AE552EEEF10F070A000 +:101A00000ED0FCEC10F0EF50800808E1D5DBEF5071 +:101A1000840804E1FCEC10F08C0EEF6E7090050E63 +:101A2000D9EF10F06984040EC4DB6D821CEC11F058 +:101A3000040EE1EF10F01CEC11F0030EC2DB6D920E +:101A4000699468A403D0020EB4DBFBD7120030EC1B +:101A500011F0FD0E000180153DE17E0E8015E8407D +:101A60007F0B040DF3CF63F0F4CF64F0000E632717 +:101A7000040E642363C065F064C066F06575BCDB6A +:101A8000EF503C0BE842E8420D0822E1B5DB99EC4F +:101A900011F0EECF00F0EFCF01F0280E001816E1A4 +:101AA000040E011813E1D3EC11F0DF6AEDDB0EE256 +:101AB000DF504CEC11F0DF50EA6A200FE96E040EA3 +:101AC000EA22E552E750EF6EDF2AF0D70AD807D0B6 +:101AD0001AD805D0FD0E8015040801E122D8E55280 +:101AE0007DD36ADBEF50800B02E066DBEF6A00011A +:101AF0006F6B706B746B756B736B64D89DDB170EBB +:101B000060DB17EF0FF0020E0001705D02E1A4EF41 +:101B10000FF034D80001815102E19EEF11F0816B8A +:101B200012009EDB49DBEF50400B01E0010EDF6E3F +:101B300000016B75080E605D09E122C46EFF6E50F6 +:101B4000000802E2100E01D0040E606F700513E170 +:101B5000D7EC11F0A6D9020E00016F5D03E12CDB7A +:101B6000840E07D0DF5003E127DBC80E02D024DB50 +:101B7000880EEF6E01D002D8E55230D32BDB000186 +:101B8000706B1ADBEF6A040E6B19006E6CC001F00B +:101B9000DE6E6CC0DDFF19DBEF6A78AF0CD07B51D5 +:101BA0007C1107E005D07CC0FAFF00017B51F96E83 +:101BB000FADF0001789F020EE15C02E2E16AE55281 +:101BC000E16E0CD304012051600BE842E842E84288 +:101BD000E842E842000901E0120021510C0A45E008 +:101BE0000B0A3FE00C0A31E0010A22E00B0A1EE07A +:101BF000020A1CE0030A18E0080A10E0010A0CE0DF +:101C00000F0A08E0030A01E012000001738F080EBA +:101C1000606F120097EF0EF000EF10F00001610E00 +:101C2000716F000E726F0CD0D8EF0EF036EF0EF021 +:101C300024510001716F726B620E7127000E7223C6 +:101C40007381010E746F738F12000001738F040192 +:101C50002451EA6A620FE96E000EEA2222C4EFFF05 +:101C60001200EADA160EE1EF10F012007EDB040E2D +:101C7000E1260401220510E120511F0B00090CE1AF +:101C80000001738F030E0401215D04E10001010EC8 +:101C90007F6F02D000017F6B0401225141E120518E +:101CA0001F0B02083DE124510F0B000939E0000130 +:101CB000738F040124BF05D0A4DA670EE926000E55 +:101CC00004D09FDA6B0EE926000ED2DA030E215DF6 +:101CD00003E17BDA840E23D024510F0B016A700FCD +:101CE000006E0F0E0122020E00C0DBFF030E01C0CA +:101CF000DBFF020EDBCFE9FF030EDBCFEAFFEE9046 +:101D0000ED5224AF06D061DAEF6ADF745EDA400E7E +:101D100006D05BDA880EEF6EDF7457DAC80EEF6E0E +:101D2000040EE15C02E2E16AE552E16E57D2800EF8 +:101D30000401205D3CE10001C00E736F04012351DA +:101D4000030A1EE0010A09E0030A2FE10001860EE2 +:101D5000716F350E726F120E22D0C3DA2E0EF62678 +:101D6000360EA2DA020E0001F76A7125F66E725184 +:101D7000F7220900F5CF74F00A00F5CF75F01200D4 +:101D8000030E225D0FE2ADDA300EF626360E8CDA47 +:101D900071C0F6FF72C0F7FF0800F5500001746FC4 +:101DA000756B12000001736B12000001736B12005F +:101DB00011DA0401286B296B20511F0B020A11E074 +:101DC000030A0CE0010A22E10001738F040128815B +:101DD00000017F051BE10401288318D00001738FE7 +:101DE00015D00001738F040124BF05D00ADA670EF5 +:101DF000E926000E04D005DA6B0EE926000E38DA6B +:101E0000E4D9EF50040B02E0010E286F000173AF1C +:101E100007D0280E716F040E726F7381020E746FFB +:101E2000020EE15C02E2E16AE552E16ED7D16D9803 +:101E3000000173BF08D078AF02D061DA2AD07EDA11 +:101E4000BBD9840E27D078BF2BD0040120AF24D07B +:101E5000000174510401265D0001755104012759E8 +:101E600004E226C474F027C475F01BD80001010EEB +:101E7000706FA1DA800EEF6E816BBED9EE52080E44 +:101E8000EF6E91DAB9D9840EEF6E010E816F8FDAA1 +:101E900093D9C80EEF6E1200000131DAC80EEF6E52 +:101EA000120098D90001080E745D000E75590DE2FC +:101EB00074C0DEFF75C0DDFF6F5102E1010E03D07B +:101EC0006F0506E1020E6F6F03D0080EDE6EDD6A4D +:101ED00073D9EF9271D9EF906FD9010EDB50EF12E9 +:101EE0006BD9EE52DFCFEFFF000EDB50745F010EB7 +:101EF000DB50755B280E7D6F040E7E6F73B10FD0C3 +:101F0000F7D91BE071C0F6FF72C0F7FF712B000E0E +:101F100072230800F55096D9F3E2DB06F1D7E8D931 +:101F20000CE071C0E9FF72C0EAFF712B000E722352 +:101F3000EF5088D9F4E2DB06F2D7020EE15C02E250 +:101F4000E16AE552E16E4AD145D956D9EE52EFCF5A +:101F5000DFFFDFCF00F000500001795D000E7A59FD +:101F600003E279C0DFFF09D0DF50006E016AE8505C +:101F7000795D796F01507A597A6F010EDB6ADF5013 +:101F8000F36E010EDBCFF4FFF350F45C10E2010EB0 +:101F9000DB5082D976C0E9FF77C0EAFF762B000ECE +:101FA0007723E552E750EF6E010EDB2AE8D7000EEB +:101FB000D8807955000E7A550DE2F4D854D91CD941 +:101FC000EF50400B03E1EAD9C80E02D0E7D9880EE2 +:101FD000EF6E0FD0F0D9840EEF6E7B517C1107E0CD +:101FE00005D07CC0FAFF00017B51F96EFADF0001D9 +:101FF000789F020EE15C02E2E16AE552E16EEED00A +:102000000001738F10D9010EE66EE66AE66A620E71 +:10201000E66E000EAFD922C461F00401225104E142 +:102020000001100E606F12000001200E606F04D9D5 +:10203000150EE1EF10F0CED8000EDE6E040EDD6E50 +:10204000E8D8040DF350006E016A020E0F0B05E094 +:10205000D89001320032E806FBE1D8900036013614 +:10206000D89000360136D9CFE9FFDACFEAFF005029 +:10207000EE260150ED22A9D8EF9EFD0EDB5002E1C5 +:102080006AD901D06DD9EA22DECFEEFFDDCFEDFFB8 +:102090009CD8EF9C9AD8040EE926000EEA22EF8C19 +:1020A000020EE15C02E2E16AE552E16E97D092D85D +:1020B000FE0EDB50016A700F006E0F0EDFD885D860 +:1020C000FD0EDBCFEFFFDBA402D0E66AF5D8FD0EF4 +:1020D000DBA203D0010EE66EEFD8020EE15C02E255 +:1020E000E16AE552E16E7AD075D8FE0EDB5005E16B +:1020F00025D962D8840EEF6E05D08BD80CD989D83B +:10210000010F09D9020EE15C02E2E16AE552E16EDB +:1021100065D060D8FD0EDB5002E022D901D01BD97A +:10212000A7D853D806D9FB0EDBCFEEFFFC0EDBCFD2 +:10213000EDFF4BD8EE52FA0EDBCFEFFF400E45D845 +:10214000E850EF16880E41D8E850EF12FD0EDB5034 +:1021500002E006D901D0FFD8EA22EF74DECF00F00A +:10216000DDCF01F000C0F3FF01C0F4FF020EE15C1F +:1021700002E2E16AE552E16E31D0F7D8010EF36E6A +:10218000FC0EDB5004E0D890F336E806FCE1F31CCB +:10219000006EFD0EDBCFE9FFFE0EDBCFEAFF005045 +:1021A000EF161CD0FBD8EE52080EEF6EF7D899EF61 +:1021B00011F0E66EA2EF11F06BC0E9FF6CC0EAFF10 +:1021C0001200E66EE66AC2EF11F0DECFE9FFDDCF66 +:1021D000EAFF1200CAD8020EE1261200E552E7CF4C +:1021E000D9FF1200D6D8CEEF11F0FE0EEA6ADB342A +:1021F000FE0BEA36E96E120063C0E9FF64C0EAFF35 +:10220000120024510F0BE96EEA6AD890E936EA36DB +:102210001200FD0EDB50E824026EFE0EDB50040DB2 +:10222000F35002241200000EE66EE66AE66A710EB2 +:10223000E66E0F0EBAEF11F0000EE66EE66AE66E7D +:10224000E66A1200E66E7DC0E9FF7EC0EAFF7D2BE4 +:10225000000E7E23E552E750EF6EDF06010E1200FE +:1022600084D8E6521200280EEE6E040EED6E1200B7 +:10227000EA22EECFDEFFEDCFDDFF1200012200C02B +:10228000DEFF01C0DDFF1200DF50006E016A080EA4 +:10229000005C000E01581200EA6A280FE96E040E75 +:1022A000EA22EF50E66E1200F7220900F5CF71F036 +:1022B0000A00F5CF72F01200FE0EDBCFE6FFBBDEA8 +:1022C000E552E5521200160E6F6E9F0E6B6E7B0E7E +:1022D000696E1200010EE66EE66A000EE66EE66AB0 +:1022E00012002251F66EF76AD890F636F7361200D1 +:1022F000D9CFE9FFDACFEAFFEE50ED101200020E5F +:10230000706F5ADFEE52EF6A57DFC80EEF6E4ADF8A +:10231000AADFCEEF11F0040DF3CF00F0F4CF01F0FF +:10232000000E0026040EAADF840E4FDFE850EF12E5 +:102330001200020EE926000EEA2212003CD88C0E92 +:10234000EF6E1200680EE66E0F0EE66E16DFE552B7 +:10235000E552E552120049DF670EE926000E120031 +:1023600044DF6B0EE926000E1200D9CFE6FFE1CF65 +:10237000D9FF1200E66EEAEC1BF0006E050EE15E7E +:10238000005012007DEC0BF0006E060EE15E005076 +:102390001200200EEE6E040EED6E120065C0E9FF15 +:1023A00066C0EAFF120028DFC4DFC9EF11F004DFC6 +:0C23B000C0DF33EF11F0F6DEF2EF10F0AA +:0423BC00959A838AE1 +:1023C000190EE66EE66A7C0EE66E6AEC1BF0E552CC +:1023D000E552E5521200B0DA030EE126ACA2FED7B8 +:1023E00048EC1DF0DF6E0001A85104E1865102E1C6 +:1023F000010EA96FA90552E1A85189DADFCFEFFFDD +:10240000020EA85D08E2FF0EDF5C05E0050E8CDA27 +:102410000001A96BA86B030EA85D04E1030EDF2485 +:102420000001CA6F030E0001A85D37E30001CA5125 +:102430000001A85D32E18B5102E0060E75DA010E53 +:10244000DB6A020EDB6E0001CA51F36E020EDBCFB7 +:10245000F4FFF350F45C0EE2020EDB5058DA010E8A +:10246000DBCFE7FFEF50E726010EE7CFDBFF020EE1 +:10247000DB2AE9D7CA514BDAEFCF00F0010EDB1CA3 +:10248000005C05E0070E50DA0001866B03D0000106 +:10249000010E866FA96BA86B01D0A82B030EE15C1F +:1024A00002E2E16AE552E16E16D246DA220EE12638 +:1024B000010EDB68020EDB68FE0EDB50E76E030EDA +:1024C000E7CFDBFFFC0EDB50020FE76E040EE7CF19 +:1024D000DBFFFD0EDB50E76E050EE7CFDBFFDF6AAB +:1024E000FC0EDB50DF5C13E2DF50EA6AAA0FE96EF4 +:1024F000000EEA22EF50E66ED950010F006E050E75 +:10250000DF24F7D9E552E750EF6EDF2AE9D7210E35 +:10251000DB6A020EDF6EFC0EDB50050FDF5C0FE2A4 +:10252000D950010F006EDF50E4D9210EDBCFE7FF59 +:10253000EF50E726210EE7CFDBFFDF2AECD7210E95 +:10254000DB1CE66ED950010F006EFC0EDB50050F50 +:10255000D0D9E552E750EF6E839ADF6AFC0EDB506C +:10256000060FDF5C11E2ACA2FED7D950010F006E5E +:10257000DACF01F0DF500F01BCD9EF50E66E93ECDB +:102580001EF0E552DF2AEAD7ACA2FED7838A00010B +:10259000866B220EE15C02E2E16AE552E16E9BD1BC +:1025A0000001865112000001A7511200000186515E +:1025B000FDE01200C1D9FE0EDB50EA6AAA0FE96EF7 +:1025C000000EEA22FD0EDBCFEFFF85D10001865120 +:1025D00002E08B511200000CD9CFE6FFE1CFD9FF0A +:1025E000020EE126E66A010EE66EFE0EDBCFE6FF86 +:1025F0005CDFE552E552E552DE6ADD6ADECF00F0CF +:10260000DDCF01F0FC0EDBCF02F0FD0EDBCF03F0DF +:102610000250005C0350015818E20001865104E0AA +:102620000001A76B010E16D00000000000000000A2 +:10263000000000000000000000000000000000009A +:10264000DF2A010E01E3DB2AD9D70001010EA76FB3 +:10265000000E00D0006E020EE15C02E2E16AE5527B +:10266000E16E0050E552E7CFD9FF120065D9E66A66 +:10267000060E19D930D133D9030E15D92CD11CD956 +:1026800070D902E2E16AE552E16E25D1D9CFE6FFC9 +:10269000E1CFD9FF020EE126FD0EDBCFE6FFE66AB1 +:1026A00089DFE552E552010EE66E010EE66E82DF2D +:1026B000E552E552020EE66E020EE66EFE0EDBCF2E +:1026C000E6FFF3DEE552E552E552DE6ADD6ADECF73 +:1026D00000F0DDCF01F00A0E2A6E2B6AFB0EDBCF75 +:1026E0002FF0FC0EDBCF30F03EEC16F028C002F0ED +:1026F00029C003F00250005C0350015819E20001A8 +:10270000865105E00001A76B00018C5116D0000036 :1027100000000000000000000000000000000000B9 -:102720000000DF2A010E01E3DB2ACFD70001010EF2 -:10273000A76F000E00D0006E020EE15C02E2E16ABB -:10274000E552E16E0050E552E7CFD9FF1200D9CF34 -:10275000E6FFE1CFD9FF040EE126FD0EDBCFE6FF59 -:10276000E66A26DFE552E552020EE66E010EE66EDF -:102770001FDFE552E552020EE66E020EE66EFE0E19 -:10278000DBCFE6FF90DEE552E552E552DE6ADD6A18 -:10279000DECF00F0DDCF01F00A0E2A6E2B6AFB0EB1 -:1027A000DBCF2FF0FC0EDBCF30F035EC16F028C07D -:1027B00002F029C003F00250005C0350015827E2E8 -:1027C000000186511... [truncated message content] |
From: Jérémie D. <Ba...@us...> - 2010-02-21 22:15:49
|
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 ef68adf5d8a6209f7a0b8f9dbf2a487e9b04f242 (commit) from ab2cfcdadce3fc01dee7134bad0c1ecbb6ce35aa (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 ef68adf5d8a6209f7a0b8f9dbf2a487e9b04f242 Author: Jérémie Dimino <je...@di...> Date: Sun Feb 21 23:15:18 2010 +0100 add the "now" argument to ax12-goto ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/script.ml b/PC_Mainboard/clients/script.ml index 76c0099..93619ef 100644 --- a/PC_Mainboard/clients/script.ml +++ b/PC_Mainboard/clients/script.ml @@ -261,8 +261,8 @@ let () = ("curve-left", `Curve_left); ("curve-right", `Curve_right)]) (int ~default:0 "bypass-dist")) - (fun logger krobot x y speed acc mode bypass -> - Krobot.goto krobot x y speed acc mode bypass >>= move_result logger); + (fun logger krobot x y speed acc mode bypass now -> + Krobot.goto krobot x y speed acc mode bypass now >>= move_result logger); (* +---------------------------------------------------------------+ | Motors low-level conrol | @@ -330,11 +330,12 @@ let () = and speed = int ~default:50 "speed" and timeout = int ~default:100 "timeout" and reg = int "reg" - and value = int "value" in + and value = int "value" + and now = keyword ~default:true "now" [("true", true); ("false", false)] in - register "ax12-goto" (f3 id pos speed) - (fun logger krobot id pos speed -> - Krobot.AX12.goto krobot id pos speed); + register "ax12-goto" (f4 id pos speed now) + (fun logger krobot id pos speed now -> + Krobot.AX12.goto krobot id pos speed now); register "ax12-ping" (f2 id timeout) (fun logger krobot id timeout -> Krobot.AX12.ping krobot id timeout >>= function diff --git a/PC_Mainboard/driver/commands.ml b/PC_Mainboard/driver/commands.ml index 71db61c..a96f831 100644 --- a/PC_Mainboard/driver/commands.ml +++ b/PC_Mainboard/driver/commands.ml @@ -44,12 +44,16 @@ end module AX12 = struct - let goto card id pos speed = + let goto card id pos speed now = 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; + RW.set_uint8 data 6 (if now then + Protocol.ax12_exec_now + else + Protocol.ax12_exec_prepare); lwt _ = Card.send_request card Protocol.cmd_ax12 data in return () @@ -66,7 +70,7 @@ struct RW.set_uint8 data 0 Protocol.ax12_read; RW.set_uint8 data 1 id; RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 0; + RW.set_uint8 data 3 Protocol.ax12_value8; RW.set_uint8 data 4 timeout; lwt data = Card.send_request card Protocol.cmd_ax12 data in return (RW.get_uint8 data 0) @@ -76,7 +80,7 @@ struct RW.set_uint8 data 0 Protocol.ax12_read; RW.set_uint8 data 1 id; RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 1; + RW.set_uint8 data 3 Protocol.ax12_value16; RW.set_uint8 data 4 timeout; lwt data = Card.send_request card Protocol.cmd_ax12 data in return (RW.get_uint16 data 0) @@ -86,7 +90,7 @@ struct RW.set_uint8 data 0 Protocol.ax12_write; RW.set_uint8 data 1 id; RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 0; + RW.set_uint8 data 3 Protocol.ax12_value8; RW.set_uint8 data 4 value; lwt data = Card.send_request card Protocol.cmd_ax12 data in return () @@ -96,7 +100,7 @@ struct RW.set_uint8 data 0 Protocol.ax12_write; RW.set_uint8 data 1 id; RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 0; + RW.set_uint8 data 3 Protocol.ax12_value16; RW.set_uint16 data 4 value; lwt data = Card.send_request card Protocol.cmd_ax12 data in return () @@ -144,7 +148,7 @@ struct RW.set_uint8 data 0 Protocol.ax12_write_reg; RW.set_uint8 data 1 id; RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 0; + RW.set_uint8 data 3 Protocol.ax12_value8; RW.set_uint8 data 4 value; lwt _ = Card.send_request card Protocol.cmd_ax12 data in return () @@ -154,7 +158,7 @@ struct RW.set_uint8 data 0 Protocol.ax12_write_reg; RW.set_uint8 data 1 id; RW.set_uint8 data 2 reg; - RW.set_uint8 data 3 1; + RW.set_uint8 data 3 Protocol.ax12_value16; RW.set_int16 data 4 value; lwt _ = Card.send_request card Protocol.cmd_ax12 data in return () diff --git a/PC_Mainboard/driver/commands.mli b/PC_Mainboard/driver/commands.mli index 8e2028e..3832838 100644 --- a/PC_Mainboard/driver/commands.mli +++ b/PC_Mainboard/driver/commands.mli @@ -22,7 +22,7 @@ module Compass : sig end module AX12 : sig - val goto : Card.t -> int -> int -> int -> unit Lwt.t + val goto : Card.t -> int -> int -> int -> bool -> unit Lwt.t val ping : Card.t -> int -> int -> int Lwt.t val read8 : Card.t -> int -> int -> int -> int Lwt.t val read16 : Card.t -> int -> int -> int -> int Lwt.t diff --git a/PC_Mainboard/driver/driver.ml b/PC_Mainboard/driver/driver.ml index ad4f936..0003dcc 100644 --- a/PC_Mainboard/driver/driver.ml +++ b/PC_Mainboard/driver/driver.ml @@ -78,7 +78,7 @@ struct let wrap f dev = f dev.card - OL_method Goto : int -> int -> int -> unit = wrap Commands.AX12.goto + OL_method Goto : int -> int -> int -> bool -> unit = wrap Commands.AX12.goto OL_method Ping : int -> int -> int = wrap Commands.AX12.ping OL_method Read8 : int -> int -> int -> int = wrap Commands.AX12.read8 OL_method Read16 : int -> int -> int -> int = wrap Commands.AX12.read16 @@ -249,6 +249,14 @@ struct include OBus.MakeInterface(struct let name = "fr.krobot.Device.Motors" end) (* +---------------------------------------------------------------+ + | Dispatching | + +---------------------------------------------------------------+ *) + + (* The dispatcher *) +(* let *) + + + (* +---------------------------------------------------------------+ | High-level movement | +---------------------------------------------------------------+ *) diff --git a/PC_Mainboard/lib_krobot/krobot.ml b/PC_Mainboard/lib_krobot/krobot.ml index ed460f0..84b99c4 100644 --- a/PC_Mainboard/lib_krobot/krobot.ml +++ b/PC_Mainboard/lib_krobot/krobot.ml @@ -176,7 +176,7 @@ OP_method CalibrationContinue : unit module AX12 = struct include MakeDevice(struct let name = "AX12" end) - OP_method Goto : id : int -> pos : int -> speed : int -> unit + OP_method Goto : id : int -> pos : int -> speed : int -> now : bool -> unit OP_method Ping : id : int -> timeout : int -> int OP_method Read8 : id : int -> reg : int -> timeout : int -> int OP_method Read16 : id : int -> reg : int -> timeout : int -> int diff --git a/PC_Mainboard/lib_krobot/krobot.mli b/PC_Mainboard/lib_krobot/krobot.mli index 18aba87..bd72172 100644 --- a/PC_Mainboard/lib_krobot/krobot.mli +++ b/PC_Mainboard/lib_krobot/krobot.mli @@ -62,7 +62,7 @@ val calibration_stop : t -> unit Lwt.t (** {6 Manipulation of AX12s} *) module AX12 : sig - val goto : t -> id : int -> pos : int -> speed : int -> unit Lwt.t + val goto : t -> id : int -> pos : int -> speed : int -> now : bool -> unit Lwt.t val ping : t -> id : int -> timeout : int -> int Lwt.t val read8 : t -> id : int -> reg : int -> timeout : int -> int Lwt.t val read16 : t -> id : int -> reg : int -> timeout : int -> int Lwt.t hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-21 21:42:45
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "krobot". The branch, master has been updated via ab2cfcdadce3fc01dee7134bad0c1ecbb6ce35aa (commit) from 6408969deba870f986a2c0b8852fda276eb23b3a (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 ab2cfcdadce3fc01dee7134bad0c1ecbb6ce35aa Author: Jérémie Dimino <je...@di...> Date: Sun Feb 21 22:42:16 2010 +0100 add a test ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/myocamlbuild.ml b/PC_Mainboard/myocamlbuild.ml index b23d4cf..b2743eb 100644 --- a/PC_Mainboard/myocamlbuild.ml +++ b/PC_Mainboard/myocamlbuild.ml @@ -79,6 +79,7 @@ let targets = List.filter_opt (function (true, target) -> Some target | (false, (* Tests *) (have_lwt_unix && have_obus, "tests/double_move.best"); (have_lwt_unix && have_obus, "tests/stop_and_restart.best"); + (have_lwt_unix && have_obus, "tests/trajectories.best"); ] (* +-----------------------------------------------------------------+ diff --git a/PC_Mainboard/tests/trajectories.ml b/PC_Mainboard/tests/trajectories.ml new file mode 100644 index 0000000..9a2cd01 --- /dev/null +++ b/PC_Mainboard/tests/trajectories.ml @@ -0,0 +1,19 @@ +(* + * trajectories.ml + * --------------- + * Copyright : (c) 2010, Jeremie Dimino <je...@di...> + * Licence : BSD3 + * + * This file is a part of [kro]bot. + *) + +(* The expected result is a single move, without stopping between the + two move *) + +open Lwt + +lwt () = + lwt krobot = Krobot.create () in + lwt _ = Krobot.move krobot 100 400 800 in + lwt _ = Krobot.move krobot 100 400 800 in + return () hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-21 18:52: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 6408969deba870f986a2c0b8852fda276eb23b3a (commit) from 68bb8ac64989467872ce6cfcc345ce5bd4f2b4bb (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 6408969deba870f986a2c0b8852fda276eb23b3a Author: Jérémie Dimino <je...@di...> Date: Sun Feb 21 19:51:24 2010 +0100 [joy_control] remove video initialisation ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/joy_control.ml b/PC_Mainboard/clients/joy_control.ml index 42b9b4d..7c84d21 100644 --- a/PC_Mainboard/clients/joy_control.ml +++ b/PC_Mainboard/clients/joy_control.ml @@ -221,7 +221,6 @@ let () = | 0 -> Unix.close fd_r; Sdl.init [`JOYSTICK;`VIDEO]; - ignore (Sdlvideo.set_video_mode 100 100 []); Sdljoystick.set_event_state true; let joy = try hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-21 18:09:25
|
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 68bb8ac64989467872ce6cfcc345ce5bd4f2b4bb (commit) from 2022bc49119a03672546af0c2403b821f5b0ab5b (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 68bb8ac64989467872ce6cfcc345ce5bd4f2b4bb Author: Jérémie Dimino <je...@di...> Date: Sun Feb 21 19:08:39 2010 +0100 [contorller] fix a small rendering glitch ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/controller.ml b/PC_Mainboard/clients/controller.ml index 173b0f6..1d45d75 100644 --- a/PC_Mainboard/clients/controller.ml +++ b/PC_Mainboard/clients/controller.ml @@ -275,7 +275,7 @@ let rec draw krobot = Draw.text zone 0 0 (Printf.sprintf "(reverse-i-search)'%s'" state.Engine.search_word); begin match state.Engine.search_history with | [] -> - 20 + len + 19 + len | phrase :: _ -> let ptr_start = match Text.find phrase state.Engine.search_word with | Some ptr -> @@ -295,7 +295,7 @@ let rec draw krobot = Reset; Text after; ]; - 20 + len + 19 + len end in Draw.map zone cursor_position 0 (fun point -> { point with style = { point.style with inverse = true } }); hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-21 17:45:44
|
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 2022bc49119a03672546af0c2403b821f5b0ab5b (commit) via a1569a3a2a4a8c207bd4ea194783f2aae66be14a (commit) from 9383eb0cc3a954ab07681748fb6c59f65703bd2c (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 2022bc49119a03672546af0c2403b821f5b0ab5b Author: Jérémie Dimino <je...@di...> Date: Sun Feb 21 16:58:59 2010 +0100 [controller] typo commit a1569a3a2a4a8c207bd4ea194783f2aae66be14a Author: Jérémie Dimino <je...@di...> Date: Sun Feb 21 16:54:01 2010 +0100 [controller] use the same limit for all screen refresh ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/controller.ml b/PC_Mainboard/clients/controller.ml index d0a730c..173b0f6 100644 --- a/PC_Mainboard/clients/controller.ml +++ b/PC_Mainboard/clients/controller.ml @@ -170,11 +170,11 @@ let rec draw krobot = Draw.textc screen 1 0 [fg line_color; text "─[ "; fg name_color; text "Range finders"; - fg line_color; text "]─┬─[ "; + fg line_color; text " ]─┬─[ "; fg name_color; text "Logic Sensors"; - fg line_color; text "]─┬─[ "; + fg line_color; text " ]─┬─[ "; fg name_color; text "Status"; - fg line_color; text "]─"]; + fg line_color; text " ]─"]; points.(9).(0) <- { line with char = "├" }; points.(9).(size.columns - 1) <- { line with char = "┤" }; for i = 1 to size.columns - 2 do @@ -362,19 +362,16 @@ lwt () = Lwt_main.exit_hooks in - (* Events that causes the display to be redrawn *) + (* Minimum delay to wait between two screen redrawing *) let delay = 1.0 /. (float_of_int refresh_rate) in - let notify signal = - Lwt_signal.always_notify_p - (fun _ -> refresh krobot) - (Lwt_signal.limit (fun () -> Lwt_unix.sleep delay) signal) - and urgent signal = - Lwt_signal.always_notify_p - (fun _ -> refresh krobot) - signal - in - urgent Lwt_term.size; - urgent engine_state; + (* Event which refresh the screen when it occurs: *) + let event, push = React.E.create () in + Lwt_event.always_notify_p + (fun () -> refresh krobot) + (* Limit the number of redraw per seconds: *) + (Lwt_event.limit (fun () -> Lwt_unix.sleep delay) event); + (* Ask for a refresh when [signal] changes: *) + let notify signal = Lwt_signal.always_notify (fun _ -> push ()) signal in notify box; notify logs; notify (Krobot.compass krobot); @@ -388,6 +385,11 @@ lwt () = notify (Krobot.Card.state krobot `Sensor); notify (Krobot.Card.state krobot `Motor); + (* Redraw immedlatly the screen when [signal] changes: *) + let urgent signal = Lwt_signal.always_notify_p (fun _ -> refresh krobot) signal in + urgent Lwt_term.size; + urgent engine_state; + lwt history = Lwt_read_line.load_history history_file_name in set_engine_state (Engine.init history); hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-21 13:17:41
|
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 9383eb0cc3a954ab07681748fb6c59f65703bd2c (commit) from 7a4f8545c3cb92904815340be3fca2e044a8f6a8 (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 9383eb0cc3a954ab07681748fb6c59f65703bd2c Author: Jérémie Dimino <je...@di...> Date: Sun Feb 21 14:16:56 2010 +0100 rename Lwt_term.{save,restore}_state to Lwt_term.{enter,leave}_drawing_mode ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/controller.ml b/PC_Mainboard/clients/controller.ml index 0b26109..d0a730c 100644 --- a/PC_Mainboard/clients/controller.ml +++ b/PC_Mainboard/clients/controller.ml @@ -347,7 +347,7 @@ lwt () = lwt krobot = Krobot.create () in (* Put the terminal into drawing mode: *) - lwt () = Lwt_term.save_state () in + lwt () = Lwt_term.enter_drawing_mode () in lwt () = Lwt_term.hide_cursor () in init_logger (); @@ -357,7 +357,7 @@ lwt () = let node = Lwt_sequence.add_l (fun () -> - lwt () = restore_state () in + lwt () = Lwt_term.leave_drawing_mode () in Lwt_list.iter_s printlc (List.rev (React.S.value logs))) Lwt_main.exit_hooks in @@ -398,4 +398,4 @@ lwt () = Lwt_sequence.remove node; (* Leave drawing mode *) - restore_state () + Lwt_term.leave_drawing_mode () hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-21 12:59:34
|
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 7a4f8545c3cb92904815340be3fca2e044a8f6a8 (commit) from 57b3104ae0cceeee30a418c3ffe4da4f7ced6d11 (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 7a4f8545c3cb92904815340be3fca2e044a8f6a8 Author: Jérémie Dimino <je...@di...> Date: Sun Feb 21 13:55:06 2010 +0100 rewrite Script and Controller Controller: use more colors Script: merge completion definitions and commands definitions ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/controller.ml b/PC_Mainboard/clients/controller.ml index 5d43d37..0b26109 100644 --- a/PC_Mainboard/clients/controller.ml +++ b/PC_Mainboard/clients/controller.ml @@ -9,7 +9,7 @@ (* Prints status continuously *) -module Log = Lwt_log.Make(struct let section = "controller" end) +module Log = Lwt_log.Make(struct let section = "" end) open Lwt open Lwt_term @@ -17,188 +17,69 @@ open Lwt_read_line module TextSet = Set.Make(Text) +(* Maximum number of refresh by seconds: *) +let refresh_rate = 10 + (* +-----------------------------------------------------------------+ - | Drawing | + | Logging | +-----------------------------------------------------------------+ *) -(* Prevent concurrent drawing: *) -let drawer_mutex = Lwt_mutex.create () +(* Maximum number of lines to keep in logs: *) +let log_count = 16384 -(* Draw the whole screen *) -let rec draw - (size, - (engine_state, box, logs), - ((compass, logic_sensors, range_finders, team, jack), - (inhibited_forward_until, inhibited_backward_until), - (state_interface, state_sensor, state_motor))) = - Lwt_mutex.with_lock drawer_mutex begin fun () -> - lwt () = Lwt_main.fast_yield () in - 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 text_of_state name = function - | `Absent -> [fg lred; textf "%s card is absent" name] - | `Present -> [textf "%s card is present" name] - in - Draw.textc zone x 3 (text_of_state "interface" state_interface); - Draw.textc zone x 4 (text_of_state "sensor" state_sensor); - Draw.textc zone x 5 (text_of_state "motor" state_motor); - let date = Unix.gettimeofday () in - let string_of_motor_state until = - if date < until then - "inhibited" +(* Signal holding the current logs: *) +let logs, set_logs = React.S.create [] + +let add_date line = + let buffer = Buffer.create 42 in + Lwt_log.render ~buffer ~level:Lwt_log.Info ~message:"" ~template:"$(date): "; + text (Buffer.contents buffer) :: line + +(* Add a list of lines to logs *) +let log_add_lines lines = + let rec truncate n = function + | [] -> + [] + | line :: rest -> + if n = log_count then + [] 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 ===== *) - - 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 + line :: truncate (n + 1) rest + in + set_logs (truncate 0 (List.rev_map add_date lines @ (React.S.value logs))) + +let log_add_line line = + log_add_lines [line] + +(* Redirect stderr to logs *) +let redirect_stderr () = + let rec copy_logs ic = + lwt line = Lwt_io.read_line ic in + log_add_line [text line]; + copy_logs ic + in + 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)) + +(* Make the default logger to logs into the log buffer *) +let init_logger () = + Lwt_log.default := + Lwt_log.make + ~output:(fun level lines -> + log_add_lines + (List.map + (fun line -> + if level >= Lwt_log.Warning then + (* Colorize error in red: *) + [fg lred; text line] + else + [text line]) + lines); + return ()) + ~close:return + () (* +-----------------------------------------------------------------+ | Read-line | @@ -219,30 +100,6 @@ let () = 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 log_line line = - let rec truncate n = function - | [] -> - [] - | line :: rest -> - if n = 1024 then - [] - else - line :: truncate (n + 1) rest - in - set_logs (line :: truncate 1 (React.S.value logs)) -let log_lines lines = - let rec truncate n = function - | [] -> - [] - | line :: rest -> - if n = 1024 then - [] - else - line :: truncate (n + 1) rest - in - set_logs (List.rev lines @ truncate (List.length lines) (React.S.value logs)) - let history_file_name = Filename.concat (try Unix.getenv "HOME" with _ -> "") ".krobot-controller-history" @@ -263,7 +120,7 @@ let rec loop krobot history = let history = Lwt_read_line.add_entry line history in set_engine_state (Engine.init history); lwt () = Log.notice line in - ignore (Script.exec krobot line); + ignore (Script.exec ~krobot ~logger:(fun line -> log_add_line line; return ()) ~command:line); loop krobot history end | Command.Complete -> @@ -277,76 +134,268 @@ let rec loop krobot history = loop krobot history (* +-----------------------------------------------------------------+ - | Entry point | + | Drawing | +-----------------------------------------------------------------+ *) -let rec copy_logs ic = - lwt line = Lwt_io.read_line ic in - log_line line; - copy_logs ic +(* Thread currently redrawing the screen: *) +let renderer = ref (return ()) -let redirect_stderr () = - 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)); - (* Logs to the log window: *) - Lwt_log.default := - Lwt_log.make - ~output:(fun level lines -> - let buffer = Buffer.create 128 in - let lines = - List.map (fun line -> - Buffer.clear buffer; - Lwt_log.render ~buffer ~level ~message:line ~template:"$(date): $(message)"; - Buffer.contents buffer) lines - in - log_lines lines; - return ()) - ~close:return - () +(* Draw the whole screen *) +let rec draw krobot = + let size = React.S.value Lwt_term.size in + + let screen = Zone.make ~width:size.columns ~height:size.lines in + let points = Zone.points screen in + + let line_color = lblue in + let line = { blank with style = { blank.style with foreground = line_color } } in + let name_color = lwhite in + + (* ===== Borders ===== *) + + for i = 1 to size.columns - 2 do + points.(0).(i) <- { line with char = "─" }; + points.(size.lines - 1).(i) <- { line with char = "─" } + done; + for i = 1 to size.lines - 2 do + points.(i).(0) <- { line with char = "│" }; + points.(i).(size.columns - 1) <- { line with char = "│" } + done; + points.(0).(0) <- { line with char = "┌" }; + points.(size.lines - 1).(0) <- { line with char = "└" }; + points.(size.lines - 1).(size.columns - 1) <- { line with char = "┘" }; + points.(0).(size.columns - 1) <- { line with char = "┐" }; + + (* ===== Status ===== *) + + Draw.textc screen 1 0 [fg line_color; text "─[ "; + fg name_color; text "Range finders"; + fg line_color; text "]─┬─[ "; + fg name_color; text "Logic Sensors"; + fg line_color; text "]─┬─[ "; + fg name_color; text "Status"; + fg line_color; text "]─"]; + points.(9).(0) <- { line with char = "├" }; + points.(9).(size.columns - 1) <- { line with char = "┤" }; + for i = 1 to size.columns - 2 do + points.(9).(i) <- { line with char = "─" } + done; + for i = 1 to 8 do + points.(i).(20) <- { line with char = "│" }; + points.(i).(40) <- { line with char = "│" } + done; + Draw.textc screen 1 9 [fg line_color; text "───────────────────┴───────────────────┴"]; + + let zone = Zone.inner screen in + + let range_finders = React.S.value (Krobot.range_finders krobot) in + for i = 0 to Array.length range_finders - 1 do + Draw.textf zone 0 i "%d : %d" i range_finders.(i) + done; + + let logic_sensors = React.S.value (Krobot.logic_sensors krobot) in + 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 React.S.value (Krobot.team krobot) with + | Krobot.Team_red -> "red" + | Krobot.Team_green -> "green"); + Draw.textf zone x 1 "jack = %s" (if React.S.value (Krobot.jack krobot) then "present" else "absent"); + Draw.textf zone x 2 "compass = %d" (React.S.value (Krobot.compass krobot)); + let text_of_state name = function + | `Absent -> [fg lred; textf "%s card is absent" name] + | `Present -> [textf "%s card is present" name] + in + Draw.textc zone x 3 (text_of_state "interface" (React.S.value (Krobot.Card.state krobot `Interface))); + Draw.textc zone x 4 (text_of_state "sensor" (React.S.value (Krobot.Card.state krobot `Sensor))); + Draw.textc zone x 5 (text_of_state "motor" (React.S.value (Krobot.Card.state krobot `Motor))); + let date = Unix.gettimeofday () in + let text_of_motor_state mode until = + if date < until then + [text mode; fg lyellow; text "inhibited"] + else + [text mode; text "OK"] + in + Draw.textc zone x 6 (text_of_motor_state "move forward: " (React.S.value (Krobot.inhibited_forward_until krobot))); + Draw.textc zone x 7 (text_of_motor_state "move backward: " (React.S.value (Krobot.inhibited_backward_until krobot))); + + (* ===== 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.textc zone 0 y line; + loop (y - 1) rest + end + in + loop (Zone.height zone - 1) (React.S.value logs); + + (* ===== Read-line ===== *) + + points.(size.lines - 3).(0) <- { line with char = "├" }; + points.(size.lines - 3).(size.columns - 1) <- { line with char = "┤" }; + points.(size.lines - 5).(0) <- { line with char = "├" }; + points.(size.lines - 5).(size.columns - 1) <- { line with char = "┤" }; + for i = 1 to size.columns - 2 do + points.(size.lines - 5).(i) <- { line with char = "─" }; + points.(size.lines - 3).(i) <- { line with char = "─" } + done; + + let zone = Zone.sub ~zone:screen ~x:1 ~y:(size.lines - 4) ~width:(size.columns - 2) ~height:1 in + let engine_state = React.S.value engine_state 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 React.S.value 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.textc zone i 0 [fg line_color; text "┬"]; + Draw.textc zone i 1 [fg line_color; text "│"]; + Draw.textc zone i 2 [fg line_color; text "┴"]; + i + 1) + words 0) + end; + + Lwt.cancel !renderer; + renderer := Lwt_term.render (Zone.points screen) + +(* Wether the screen need to be refreshed *) +let refresh_needed = ref false + +(* Program a refresh before the next main loop iteration *) +let refresh krobot = + if !refresh_needed then + return () + else begin + refresh_needed := true; + lwt () = Lwt_main.fast_yield () in + refresh_needed := false; + draw krobot; + return () + end + +(* +-----------------------------------------------------------------+ + | Entry point | + +-----------------------------------------------------------------+ *) lwt () = lwt () = Log.notice "connecting to the krobot bus..." in lwt krobot = Krobot.create () in - lwt () = save_state () in - lwt () = hide_cursor () in + + (* Put the terminal into drawing mode: *) + lwt () = Lwt_term.save_state () in + lwt () = Lwt_term.hide_cursor () in + + init_logger (); + redirect_stderr (); + + (* Dump all logs to stdout on abnormal exit: *) let node = Lwt_sequence.add_l (fun () -> - (* Dump logs on abnormal exit: *) lwt () = restore_state () in - Lwt_list.iter_s Lwt_io.printl (List.rev (React.S.value logs))) + Lwt_list.iter_s printlc (List.rev (React.S.value logs))) Lwt_main.exit_hooks in - redirect_stderr (); - let signal = - React.S.map draw - (React.S.l3 (fun a b c -> (a, b, c)) - Lwt_term.size - (React.S.l3 (fun a b c -> (a, b, c)) - engine_state - box - logs) - (Lwt_signal.limit (fun () -> Lwt_unix.sleep 0.1) - (React.S.l3 (fun a b c -> (a, b, c)) - (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)) - (Krobot.inhibited_forward_until krobot) - (Krobot.inhibited_backward_until krobot)) - (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))))) + + (* Events that causes the display to be redrawn *) + let delay = 1.0 /. (float_of_int refresh_rate) in + let notify signal = + Lwt_signal.always_notify_p + (fun _ -> refresh krobot) + (Lwt_signal.limit (fun () -> Lwt_unix.sleep delay) signal) + and urgent signal = + Lwt_signal.always_notify_p + (fun _ -> refresh krobot) + signal in + urgent Lwt_term.size; + urgent engine_state; + notify box; + notify logs; + notify (Krobot.compass krobot); + notify (Krobot.logic_sensors krobot); + notify (Krobot.range_finders krobot); + notify (Krobot.team krobot); + notify (Krobot.jack krobot); + notify (Krobot.inhibited_forward_until krobot); + notify (Krobot.inhibited_backward_until krobot); + notify (Krobot.Card.state krobot `Interface); + notify (Krobot.Card.state krobot `Sensor); + notify (Krobot.Card.state krobot `Motor); + lwt history = Lwt_read_line.load_history history_file_name in set_engine_state (Engine.init history); + + (* User input loop *) lwt () = Lwt_term.with_raw_mode (fun () -> loop krobot history) in - React.S.stop signal; + + (* Normal exit, do not dump logs on stdout: *) Lwt_sequence.remove node; + + (* Leave drawing mode *) restore_state () diff --git a/PC_Mainboard/clients/script.ml b/PC_Mainboard/clients/script.ml index 73ff644..76c0099 100644 --- a/PC_Mainboard/clients/script.ml +++ b/PC_Mainboard/clients/script.ml @@ -7,93 +7,121 @@ * This file is a part of [kro]bot. *) -module Log = Lwt_log.Make(struct let section = "script" end) - open Lwt +open Lwt_term module TextSet = Set.Make(Text) -type argument = - | Arg_int - | Arg_string - | Arg_keyword of string list +let set_of_list l = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty l + +(* +-----------------------------------------------------------------+ + | Commands | + +-----------------------------------------------------------------+ *) + +type logger = Lwt_term.styled_text -> unit Lwt.t + +(* Type of an argument *) +type arg_type = + | Int + | Keyword of string list type command = { - name : string; - args : (string * argument) list; + c_name : string; + (* The command name *) + + c_exec : (string * string) list -> logger -> Krobot.t -> unit Lwt.t; + (* The command implementation. It takes as argument the list of + parameters. *) + + c_args : (string * arg_type) list; + (* Argument description, used for completion. *) } -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 = "goto"; - args = [("x", Arg_int); ("y", Arg_int); ("speed", Arg_int); ("acc", Arg_int); - ("mode", Arg_keyword ["straight"; "curve-left"; "curve-right"]); - ("bypass-dist", 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"])] }; - { name = "set-speed"; - args = [("motor", Arg_keyword ["left"; "right"; "both"]); - ("speed", Arg_int); - ("acc", Arg_int)] }; - { name = "bootloader"; - args = [("card", Arg_keyword ["interface"; "sensor"; "motor"])] }; - { name = "reset"; - args = [("card", Arg_keyword ["interface"; "sensor"; "motor"])] }; - { name = "test"; - args = [("card", Arg_keyword ["interface"; "sensor"; "motor"])] }; - { name = "get-calibration"; - args = [] }; - { name = "calibration-start"; - args = [("range-finder", Arg_int); ("skip-meas", Arg_keyword ["true"; "false"])] }; - { name = "calibration-stop"; - args = [] }; - { name = "calibration-continue"; - args = [] }; - { name = "ax12-goto"; - args = [("id", Arg_int); ("pos", Arg_int); ("speed", Arg_int)] }; - { name = "ax12-ping"; - args = [("id", Arg_int); ("timeout", Arg_int)] }; - { name = "ax12-read8"; - args = [("id", Arg_int); ("reg", Arg_int); ("timeout", Arg_int)] }; - { name = "ax12-read16"; - args = [("id", Arg_int); ("reg", Arg_int); ("timeout", Arg_int)] }; - { name = "ax12-write8"; - args = [("id", Arg_int); ("reg", Arg_int); ("value", Arg_int)] }; - { name = "ax12-write16"; - args = [("id", Arg_int); ("reg", Arg_int); ("value", Arg_int)] }; - { name = "ax12-get-pos"; - args = [("id", Arg_int); ("timeout", Arg_int)] }; - { name = "ax12-get-speed"; - args = [("id", Arg_int); ("timeout", Arg_int)] }; - { name = "ax12-get-load"; - args = [("id", Arg_int); ("timeout", Arg_int)] }; - { name = "ax12-stats"; - args = [("id", Arg_int); ("timeout", Arg_int)] }; - { name = "ax12-write-reg8"; - args = [("id", Arg_int); ("reg", Arg_int); ("value", Arg_int)] }; - { name = "ax12-write-reg16"; - args = [("id", Arg_int); ("reg", Arg_int); ("value", Arg_int)] }; - { name = "ax12-action"; - args = [("id", Arg_int)] }; -] +(* An argument description *) +type 'a arg = { + a_type : arg_type; + a_name : string; + a_cast : string -> 'a; + a_default : 'a option; +} -let set_of_list l = List.fold_left (fun set x -> TextSet.add x set) TextSet.empty l +(* A function description *) +type 'a func = { + f_args : (string * arg_type) list; + (* Arguments of the function, for completion *) + + f_func : (string * string) list -> 'a -> unit Lwt.t; + (* [f_func args f] parses arguments [args] and apply them to [f] *) +} + +(* All registred commands *) +let commands = ref [] -let command_names = - List.fold_left (fun acc command -> TextSet.add command.name acc) TextSet.empty commands +(* Register a command *) +let register name func f = + let command = { + c_name = name; + c_exec = (fun args logger krobot -> func.f_func args (f logger krobot)); + c_args = func.f_args; + } in + commands := command :: !commands + +exception Argument_error of string + (* Exception raised when there is a problem with an argument *) + +let arg_error msg = raise (Argument_error msg) + +(* Returns the value associated to [key] if any, and the list without + the first occurence of [key] *) +let rec assoc_remove key = function + | [] -> + (None, []) + | (key', value) :: rest when key = key' -> + (Some value, rest) + | pair :: rest -> + let result, l = assoc_remove key rest in + (result, pair :: l) + +let ( --> ) arg func = { + f_args = (arg.a_name, arg.a_type) :: func.f_args; + f_func = + fun args f -> + let result, args = assoc_remove arg.a_name args in + match result with + | Some str -> + func.f_func args (f (arg.a_cast str)) + | None -> + match arg.a_default with + | Some value -> + func.f_func args (f value) + | None -> + Printf.ksprintf arg_error "argument '%s' is mandatory" arg.a_name +} + +let f0 = { + f_args = []; + f_func = + fun args f -> + match args with + | [] -> + f + | (key, _) :: _ -> + Printf.ksprintf arg_error "unused argument '%s'" key +} + +let f1 arg0 = arg0 --> f0 +let f2 arg0 arg1 = arg0 --> (f1 arg1) +let f3 arg0 arg1 arg2 = arg0 --> (f2 arg1 arg2) +let f4 arg0 arg1 arg2 arg3 = arg0 --> (f3 arg1 arg2 arg3) +let f5 arg0 arg1 arg2 arg3 arg4 = arg0 --> (f4 arg1 arg2 arg3 arg4) +let f6 arg0 arg1 arg2 arg3 arg4 arg5 = arg0 --> (f5 arg1 arg2 arg3 arg4 arg5) + +(* +-----------------------------------------------------------------+ + | Completion | + +-----------------------------------------------------------------+ *) let rec args_of_command command = function - | { name = name; args = args } :: _ when name = command -> + | { c_name = name; c_args = args } :: _ when name = command -> Some args | _ :: rest -> args_of_command command rest @@ -102,11 +130,12 @@ let rec args_of_command command = function let complete ~before ~after = try - match Script_lexer.command (Lexing.from_string before) with + match Script_lexer.partial_command (Lexing.from_string before) with | `Command(before, name) -> - Lwt_read_line.complete ~suffix:" " before name after command_names + Lwt_read_line.complete ~suffix:" " before name after + (set_of_list (List.map (fun command -> command.c_name) !commands)) | `Arg(before, name, args, `Key key) -> begin - match args_of_command name commands with + match args_of_command name !commands with | None -> raise Exit | Some args' -> @@ -116,13 +145,13 @@ let complete ~before ~after = 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 + match args_of_command name !commands with | None -> raise Exit | Some args' -> try match List.assoc key args' with - | Arg_keyword words -> + | Keyword words -> Lwt_read_line.complete ~suffix:" " before value after (set_of_list words) | _ -> raise Exit @@ -135,153 +164,225 @@ 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" +(* +-----------------------------------------------------------------+ + | Execution | + +-----------------------------------------------------------------+ *) + +let exec ~krobot ~logger ~command = + match try `OK(Script_lexer.command (Lexing.from_string command)) with exn -> `Fail exn with + | `Fail(Script_lexer.Parse_failure msg) -> + logger [fg lred; textf "parse failure: %s" msg] + | `Fail exn -> + logger [fg lred; textf "parse failure: %s" (Printexc.to_string exn)] + | `OK(name, args) -> + try + let rec search = function + | [] -> + logger [fg lred; textf "unknown command '%s'" name] + | cmd :: rest when cmd.c_name <> name -> + search rest + | cmd :: _ -> + cmd.c_exec args logger krobot + in + search !commands + with + | Argument_error msg -> + logger [fg lred; textf "%s: %s" name msg] + | Failure msg -> + logger [fg lred; textf "command '%s' failed: %s" name msg] + | exn -> + logger [fg lred; textf "command '%s' failed with: %s" name (Printexc.to_string exn)] -let move thread = - thread >>= function +(* +-----------------------------------------------------------------+ + | Arguments | + +-----------------------------------------------------------------+ *) + +let int ?default name = { + a_name = name; + a_type = Int; + a_cast = (fun str -> + try + int_of_string str + with Failure _ -> + Printf.ksprintf arg_error "invalid value for argument '%s': an integer was expected" name); + a_default = default; +} + +let keyword ?default name keywords = { + a_name = name; + a_type = Keyword(List.map fst keywords); + a_cast = (fun key -> + try + List.assoc key keywords + with Not_found -> + Printf.ksprintf arg_error "invalid value for '%s'" name); + a_default = default; +} + +(* +-----------------------------------------------------------------+ + | All commands | + +-----------------------------------------------------------------+ *) + +let () = + register "exit" f0 + (fun logger -> exit 0); + + (* +---------------------------------------------------------------+ + | Movement | + +---------------------------------------------------------------+ *) + + let dist = int ~default:100 "dist" + and angle = int ~default:90 "angle" + and speed = int ~default:400 "speed" + and acc = int ~default:800 "acc" in + + let move_result logger = function | `OK -> - Log.notice "done" + logger [text "move completed"] | `Stopped -> - Log.notice "stopped" - -let exec krobot line = - try_lwt - 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" -> - move (Krobot.move krobot ~dist:(arg_int "dist" 100) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)) - | "backward" -> - move (Krobot.move krobot ~dist:(-(arg_int "dist" 100)) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)) - | "left" -> - move (Krobot.turn krobot ~angle:(arg_int "angle" 100) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)) - | "right" -> - move (Krobot.turn krobot ~angle:(-(arg_int "angle" 100)) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800)) - | "goto" -> - move (Krobot.goto krobot - ~x:(arg_int "x" 0) ~y:(arg_int "y" 0) ~speed:(arg_int "speed" 400) ?acc:(arg_int "acc" 800) - ~mode:(match arg_string "mode" "straight" with - | "straight" -> `Straight - | "curve-left" -> `Curve_left - | "curve-right" -> `Curve_right - | _ -> failwith "Script.exec: invalid goto mode") - ~bypass_dist:(arg_int "bypass-dist" 0)) - | "stop-motors" -> - Krobot.stop_motors krobot - ~motor:(motor_of_string (arg_string "motor" "both")) - ~mode:(match arg_string "mode" "smooth" 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) - | "bootloader" -> - Krobot.Card.bootloader krobot - (match arg_string "card" "" with - | "interface" -> `Interface - | "motor" -> `Motor - | "sensor" -> `Sensor - | _ -> failwith "Script.exec: invalid card") - | "reset" -> - Krobot.Card.reset krobot - (match arg_string "card" "" with - | "interface" -> `Interface - | "motor" -> `Motor - | "sensor" -> `Sensor - | _ -> failwith "Script.exec: invalid card") - | "test" -> - Krobot.Card.test krobot - (match arg_string "card" "" with - | "interface" -> `Interface - | "motor" -> `Motor - | "sensor" -> `Sensor - | _ -> failwith "Script.exec: invalid card") - | "get-calibration" -> - lwt l = Lwt_list.map_p (Krobot.get_calibration krobot) [0; 1; 2; 3; 4; 5; 6; 7] in - let buffer = Buffer.create 1024 in - let _ = - List.fold_left - (fun i cal -> - Printf.bprintf buffer "calibration[%d]:" i; - for i = 0 to Array.length cal - 1 do - Printf.bprintf buffer " %d" cal.(i) - done; - Buffer.add_char buffer '\n'; - (i + 1)) - 0 l - in - Log.notice (Buffer.contents buffer) - | "calibration-start" -> - Krobot.calibration_start krobot (arg_int "range-finder" 0) - (match arg_string "skip-meas" "false" with - | "true" -> true - | "false" -> false - | _ -> raise (Failure "invalid boolean value")) - | "calibration-continue" -> - Krobot.calibration_continue krobot - | "calibration-stop" -> - Krobot.calibration_stop krobot - | "ax12-goto" -> - Krobot.AX12.goto krobot ~id:(arg_int "id" 0) ~pos:(arg_int "pos" 0) ~speed:(arg_int "speed" 0) - | "ax12-ping" -> - lwt n = Krobot.AX12.ping krobot ~id:(arg_int "id" 0) ~timeout:(arg_int "timeout" 100) in - Log.notice_f "ax12 ping result: %d" n - | "ax12-read8" -> - lwt n = Krobot.AX12.read8 krobot ~id:(arg_int "id" 0) ~reg:(arg_int "reg" 0) ~timeout:(arg_int "timeout" 100) in - Log.notice_f "ax12 read8 result: %d" n - | "ax12-read16" -> - lwt n = Krobot.AX12.read16 krobot ~id:(arg_int "id" 0) ~reg:(arg_int "reg" 0) ~timeout:(arg_int "timeout" 100) in - Log.notice_f "ax12 read16 result: %d" n - | "ax12-write8" -> - Krobot.AX12.write8 krobot ~id:(arg_int "id" 0) ~reg:(arg_int "reg" 0) ~value:(arg_int "value" 0) - | "ax12-write16" -> - Krobot.AX12.write16 krobot ~id:(arg_int "id" 0) ~reg:(arg_int "reg" 0) ~value:(arg_int "value" 0) - | "ax12-get-pos" -> - lwt n = Krobot.AX12.get_pos krobot ~id:(arg_int "id" 0) ~timeout:(arg_int "timeout" 100) in - Log.notice_f "ax12 position: %d" n - | "ax12-get-speed" -> - lwt n = Krobot.AX12.get_speed krobot ~id:(arg_int "id" 0) ~timeout:(arg_int "timeout" 100) in - Log.notice_f "ax12 speed: %d" n - | "ax12-get-load" -> - lwt n = Krobot.AX12.get_load krobot ~id:(arg_int "id" 0) ~timeout:(arg_int "timeout" 100) in - Log.notice_f "ax12 load: %d" n - | "ax12-stats" -> - lwt stats = Krobot.AX12.stats krobot ~id:(arg_int "id" 0) ~timeout:(arg_int "timeout" 100) in - Log.notice_f "ax12 position = %d\n\ - ax12 speed = %d\n\ - ax12 torque = %d\n\ - ax12 voltage = %d\n\ - ax12 temperature = %d\n\ - ax12 cw-angle-limit = %d\n\ - ax12 ccw-angle-limit = %d\n" - stats.Types.ax12_position - stats.Types.ax12_speed - stats.Types.ax12_torque - stats.Types.ax12_voltage - stats.Types.ax12_temperature - stats.Types.ax12_cw_angle_limit - stats.Types.ax12_ccw_angle_limit - | "ax12-write-reg8" -> - Krobot.AX12.write_reg8 krobot ~id:(arg_int "id" 0) ~reg:(arg_int "reg" 0) ~value:(arg_int "value" 0) - | "ax12-write-reg16" -> - Krobot.AX12.write_reg16 krobot ~id:(arg_int "id" 0) ~reg:(arg_int "reg" 0) ~value:(arg_int "value" 0) - | "ax12-action" -> - Krobot.AX12.action krobot ~id:(arg_int "id" 0) - | _ -> - Log.error_f "unknown command %S" action - with - | Script_lexer.Parse_failure msg -> - Log.error_f "parse failure: %s" msg - | Failure msg -> - Log.error_f "command failed: %s" msg - | exn -> - Log.exn exn "command failed with" + logger [fg lyellow; text "move stopped"] + in + + register "forward" (f3 dist speed acc) + (fun logger krobot dist speed acc -> + Krobot.move krobot dist speed acc >>= move_result logger); + register "backward" (f3 dist speed acc) + (fun logger krobot dist speed acc -> + Krobot.move krobot (-dist) speed acc >>= move_result logger); + register "left" (f3 angle speed acc) + (fun logger krobot angle speed acc -> + Krobot.turn krobot angle speed acc >>= move_result logger); + register "right" (f3 angle speed acc) + (fun logger krobot angle speed acc -> + Krobot.turn krobot (-angle) speed acc >>= move_result logger); + register "goto" (f6 + (int ~default:0 "x") (int ~default:0 "y") speed acc + (keyword ~default:`Straight "mode" [("straight", `Straight); + ("curve-left", `Curve_left); + ("curve-right", `Curve_right)]) + (int ~default:0 "bypass-dist")) + (fun logger krobot x y speed acc mode bypass -> + Krobot.goto krobot x y speed acc mode bypass >>= move_result logger); + + (* +---------------------------------------------------------------+ + | Motors low-level conrol | + +---------------------------------------------------------------+ *) + + let motor = keyword ~default:`Both "motor" + [("left", `Left); ("right", `Right); ("both", `Both)] + and stop_mode = keyword ~default:`Smooth "stop-mode" + [("off", `Off); ("abrupt", `Abrupt); ("smooth", `Smooth)] in + + register "stop-motors" (f2 motor stop_mode) + (fun logger krobot motor mode -> Krobot.stop_motors krobot ~motor ~mode); + register "set-speed" (f3 motor speed acc) + (fun logger krobot motor speed acc -> Krobot.set_speed krobot ~motor ~speed ~acc); + + (* +---------------------------------------------------------------+ + | Cards control | + +---------------------------------------------------------------+ *) + + let card = keyword "card" [("interface", `Interface); + ("motor", `Motor); + ("sensor", `Sensor)] in + + register "bootloader" (f1 card) + (fun logger -> Krobot.Card.bootloader); + register "reset" (f1 card) + (fun logger -> Krobot.Card.reset); + register "test" (f1 card) + (fun logger -> Krobot.Card.test); + + (* +---------------------------------------------------------------+ + | Range finders | + +---------------------------------------------------------------+ *) + + register "get-calibration" f0 + (fun logger krobot -> + lwt cals = Lwt_list.map_p (Krobot.get_calibration krobot) [0; 1; 2; 3; 4; 5; 6; 7] in + let rec loop i = function + | [] -> + return () + | cal :: rest -> + let buffer = Buffer.create 42 in + Printf.bprintf buffer "calibration[%d]:" i; + for i = 0 to Array.length cal - 1 do + Printf.bprintf buffer " %d" cal.(i) + done; + lwt () = logger [text (Buffer.contents buffer)] in + loop (i + 1) rest + in + loop 0 cals); + + register "calibration-start" (f2 (int "range-finder") (keyword "skip-meas" [("true", true); ("false", false)])) + (fun logger -> Krobot.calibration_start); + register "calibartion-stop" f0 + (fun logger -> Krobot.calibration_stop); + register "calibartion-continue" f0 + (fun logger -> Krobot.calibration_continue); + + (* +---------------------------------------------------------------+ + | AX12 | + +---------------------------------------------------------------+ *) + + let id = int "id" + and pos = int "pos" + and speed = int ~default:50 "speed" + and timeout = int ~default:100 "timeout" + and reg = int "reg" + and value = int "value" in + + register "ax12-goto" (f3 id pos speed) + (fun logger krobot id pos speed -> + Krobot.AX12.goto krobot id pos speed); + register "ax12-ping" (f2 id timeout) + (fun logger krobot id timeout -> + Krobot.AX12.ping krobot id timeout >>= function + | 0 -> logger [textf "ax12-ping[%d] reply: " id; fg lred; text "timeout"] + | _ -> logger [textf "ax12-ping[%d] reply: " id; fg lgreen; text "success"]); + register "ax12-read8" (f3 id reg timeout) + (fun logger krobot id reg timeout -> + lwt x = Krobot.AX12.read8 krobot id reg timeout in + logger [textf "ax12-read8[%d] reply: %d" id x]); + register "ax12-read16" (f3 id reg timeout) + (fun logger krobot id reg timeout -> + lwt x = Krobot.AX12.read16 krobot id reg timeout in + logger [textf "ax12-read16[%d] reply: %d" id x]); + register "ax12-write8" (f3 id reg value) + (fun logger krobot id reg value -> + Krobot.AX12.write8 krobot id reg value); + register "ax12-write16" (f3 id reg value) + (fun logger krobot id reg value -> + Krobot.AX12.write16 krobot id reg value); + register "ax12-get-pos" (f2 id timeout) + (fun logger krobot id timeout -> + lwt x = Krobot.AX12.get_pos krobot id timeout in + logger [textf "ax12-position[%d]: %d" id x]); + register "ax12-get-speed" (f2 id timeout) + (fun logger krobot id timeout -> + lwt x = Krobot.AX12.get_speed krobot id timeout in + logger [textf "ax12-speed[%d]: %d" id x]); + register "ax12-get-load" (f2 id timeout) + (fun logger krobot id timeout -> + lwt x = Krobot.AX12.get_load krobot id timeout in + logger [textf "ax12-load[%d]: %d" id x]); + register "ax12-stats" (f2 id timeout) + (fun logger krobot id timeout -> + lwt stats = Krobot.AX12.stats krobot id timeout in + lwt () = logger [textf "ax12[%d] position = %d" id stats.Types.ax12_position] in + lwt () = logger [textf "ax12[%d] speed = %d" id stats.Types.ax12_speed] in + lwt () = logger [textf "ax12[%d] torque = %d" id stats.Types.ax12_torque] in + lwt () = logger [textf "ax12[%d] voltage = %d" id stats.Types.ax12_voltage] in + lwt () = logger [textf "ax12[%d] temperature = %d" id stats.Types.ax12_temperature] in + lwt () = logger [textf "ax12[%d] cw-angle-limit = %d" id stats.Types.ax12_cw_angle_limit] in + lwt () = logger [textf "ax12[%d] ccw-angle-limit = %d" id stats.Types.ax12_ccw_angle_limit] in + return ()); + register "ax12-write-reg8" (f3 id reg value) + (fun logger krobot id reg value -> + Krobot.AX12.write_reg8 krobot id reg value); + register "ax12-write-reg16" (f3 id reg value) + (fun logger krobot id reg value -> + Krobot.AX12.write_reg16 krobot id reg value); + register "ax12-action" (f1 (int ~default:254 "id")) + (fun logger krobot id -> + Krobot.AX12.action krobot id) diff --git a/PC_Mainboard/clients/script.mli b/PC_Mainboard/clients/script.mli index 69d7d98..48dbbda 100644 --- a/PC_Mainboard/clients/script.mli +++ b/PC_Mainboard/clients/script.mli @@ -9,23 +9,12 @@ (** 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 *) +val exec : + krobot : Krobot.t -> + logger : (Lwt_term.styled_text -> unit Lwt.t) -> + command : string -> unit Lwt.t + (** [exec ~krobot ~logger ~command] parses [command] and execute + it. The result is logged with [logger]. *) diff --git a/PC_Mainboard/clients/script_lexer.mll b/PC_Mainboard/clients/script_lexer.mll index 00676ce..46d64fc 100644 --- a/PC_Mainboard/clients/script_lexer.mll +++ b/PC_Mainboard/clients/script_lexer.mll @@ -32,18 +32,18 @@ let maybe_ident = "" | ident let value = (alpha | digit | "-")+ -rule command = parse +rule partial_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 + let args, last = partial_arguments buf lexbuf in `Arg(Buffer.contents buf, command, args, last) } | "" { raise (Parse_failure "command expceted") } -and arguments buf = parse +and partial_arguments buf = parse | (blank+ as before) (maybe_ident as key) eof { Buffer.add_string buf before; (TextSet.empty, `Key key) } @@ -52,19 +52,20 @@ and arguments buf = parse (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 + let set, x = partial_arguments buf lexbuf in (TextSet.add key set, x) } | "" { (TextSet.empty, `Nothing) } -and whole_command = parse +and command = parse | blank* (ident as command) - { (command, whole_arguments lexbuf) } + { (command, arguments lexbuf) } | "" { raise (Parse_failure "command expceted") } -and whole_arguments = parse +and arguments = parse | blank+ (ident as key) blank* "=" blank* (value as value) - { (key, value) :: whole_arguments lexbuf } + { (key, value) :: arguments lexbuf } | blank* eof { [] } + | "" { raise (Parse_failure "syntax error") } hooks/post-receive -- krobot |
From: Nicolas D. <Ba...@us...> - 2010-02-21 00:16:41
|
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 57b3104ae0cceeee30a418c3ffe4da4f7ced6d11 (commit) from 267b942be7cf2e0c043a60806dd1140c4fe24422 (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 57b3104ae0cceeee30a418c3ffe4da4f7ced6d11 Author: Nicolas Dandrimont <Nic...@cr...> Date: Sun Feb 21 01:15:46 2010 +0100 Display the right message for ax12-read16 ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/clients/script.ml b/PC_Mainboard/clients/script.ml index 8b1673d..73ff644 100644 --- a/PC_Mainboard/clients/script.ml +++ b/PC_Mainboard/clients/script.ml @@ -240,7 +240,7 @@ let exec krobot line = Log.notice_f "ax12 read8 result: %d" n | "ax12-read16" -> lwt n = Krobot.AX12.read16 krobot ~id:(arg_int "id" 0) ~reg:(arg_int "reg" 0) ~timeout:(arg_int "timeout" 100) in - Log.notice_f "ax12 read8 result: %d" n + Log.notice_f "ax12 read16 result: %d" n | "ax12-write8" -> Krobot.AX12.write8 krobot ~id:(arg_int "id" 0) ~reg:(arg_int "reg" 0) ~value:(arg_int "value" 0) | "ax12-write16" -> hooks/post-receive -- krobot |
From: Jérémie D. <Ba...@us...> - 2010-02-21 00:15:34
|
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 267b942be7cf2e0c043a60806dd1140c4fe24422 (commit) from 24d14ea8f4dd015f9ff36d28a4680ed9f9f5046c (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 267b942be7cf2e0c043a60806dd1140c4fe24422 Author: Jérémie Dimino <je...@di...> Date: Sun Feb 21 01:14:45 2010 +0100 [driver] log dropped messages ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/driver/card.ml b/PC_Mainboard/driver/card.ml index 7ffe0b7..5ecf347 100644 --- a/PC_Mainboard/driver/card.ml +++ b/PC_Mainboard/driver/card.ml @@ -155,6 +155,16 @@ let abort wrapper exn = | Dispatching | +-----------------------------------------------------------------+ *) +let dropped typ msg = + lwt () = Log.warning_f "%s dropped" typ in + lwt () = Log.warning_f "===== +host_serial = %d +device_serial = %d +command = %d +error = %d +data:" msg.host_serial msg.device_serial msg.command msg.error in + Lwt_stream.iter_s (fun line -> Log.warning line) (Lwt_stream.hexdump (Lwt_stream.of_string msg.data)) + (* Dispatch incomming messages continously *) let rec dispatch card = let buffer = String.create 64 in @@ -187,7 +197,7 @@ let rec dispatch card = card.serial_pool <- card.serial_pool @ [msg.host_serial]; Lwt.wakeup wakener msg.data | None -> - ignore (Log.warning "response dropped") + ignore (dropped "response" msg) end else begin match try Some(Int_map.find msg.command card.events) with Not_found -> None with | Some seq -> @@ -199,7 +209,7 @@ let rec dispatch card = ignore (Log.exn_f exn "pushing event %d from %s card failed with" msg.command card.wrapper.name)) seq | None -> - ignore (Log.warning "command dropped") + ignore (dropped "command" msg) end; dispatch card end hooks/post-receive -- krobot |
From: Xavier L. <Ba...@us...> - 2010-02-21 00:06:48
|
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 24d14ea8f4dd015f9ff36d28a4680ed9f9f5046c (commit) from 46c68826d321ead8c8275d217416d0c30750e21c (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 24d14ea8f4dd015f9ff36d28a4680ed9f9f5046c Author: Xavier Lagorce <Xav...@cr...> Date: Sun Feb 21 01:06:46 2010 +0100 Missing files ----------------------------------------------------------------------- Changes: diff --git a/USB_Module/Motor_Controller/Firmware/Motor_Controller.mcw b/USB_Module/Motor_Controller/Firmware/Motor_Controller.mcw index 5c9abc6..192f5e4 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/Motor_controller.mcs b/USB_Module/Motor_Controller/Firmware/Motor_controller.mcs new file mode 100644 index 0000000..c264c8c --- /dev/null +++ b/USB_Module/Motor_Controller/Firmware/Motor_controller.mcs @@ -0,0 +1,149 @@ +[Header] +MagicCookie={0b13fe8c-dfe0-40eb-8900-6712719559a7} +Version=1.0 +[File000] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\usb_descriptors.o +Folder=Intermediary +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} +LanguageToolLocation=C:\MCC18\bin\mcc18.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString= +TraceCmdString= +DebugOptions= +[File001] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\main.o +Folder=Intermediary +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} +LanguageToolLocation=C:\MCC18\bin\mcc18.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString= +TraceCmdString= +DebugOptions= +[File002] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\eeprom.o +Folder=Intermediary +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} +LanguageToolLocation=C:\MCC18\bin\mcc18.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString= +TraceCmdString= +DebugOptions= +[File003] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\motor.o +Folder=Intermediary +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} +LanguageToolLocation=C:\MCC18\bin\mcc18.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString= +TraceCmdString= +DebugOptions= +[File004] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\lm629.o +Folder=Intermediary +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} +LanguageToolLocation=C:\MCC18\bin\mcc18.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString= +TraceCmdString= +DebugOptions= +[File005] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\usb_device.o +Folder=Intermediary +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} +LanguageToolLocation=C:\MCC18\bin\mcc18.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString= +TraceCmdString= +DebugOptions= +[File006] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\usb_function_hid.o +Folder=Intermediary +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} +LanguageToolLocation=C:\MCC18\bin\mcc18.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString= +TraceCmdString= +DebugOptions= +[File007] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\error.o +Folder=Intermediary +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} +LanguageToolLocation=C:\MCC18\bin\mcc18.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString= +TraceCmdString= +DebugOptions= +[File008] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\Motor_controller.cof +Folder=Output +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={96C98149-AA1B-4CF9-B967-FAE79CAB663C} +LanguageToolLocation=C:\MCC18\bin\mplink.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString=/m"$(BINDIR_)$(TARGETBASE).map" /w /o"$(BINDIR_)$(TARGETBASE).cof" +TraceCmdString= +DebugOptions= +[File009] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\Motor_controller.hex +Folder=Output +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={96C98149-AA1B-4CF9-B967-FAE79CAB663C} +LanguageToolLocation=C:\MCC18\bin\mplink.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString=/m"$(BINDIR_)$(TARGETBASE).map" /w /o"$(BINDIR_)$(TARGETBASE).cof" +TraceCmdString= +DebugOptions= +[File010] +Location=Z:\USB_Module\Motor_Controller\Firmware\output\Motor_controller.map +Folder=Output +DeviceName=PIC18F4550 +LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +LanguageToolID={96C98149-AA1B-4CF9-B967-FAE79CAB663C} +LanguageToolLocation=C:\MCC18\bin\mplink.exe +PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| +SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| +SuiteArgsString= +ToolArgsString=/m"$(BINDIR_)$(TARGETBASE).map" /w /o"$(BINDIR_)$(TARGETBASE).cof" +TraceCmdString= +DebugOptions= +[TOOL_LOC_STAMPS] +tool_loc{96C98149-AA1B-4CF9-B967-FAE79CAB663C}=C:\MCC18\bin\mplink.exe +tool_loc{E56A1C86-9D32-4DF6-8C34-FE0388B1B644}=C:\MCC18\bin\mcc18.exe hooks/post-receive -- krobot |
From: Xavier L. <Ba...@us...> - 2010-02-20 23:49: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 46c68826d321ead8c8275d217416d0c30750e21c (commit) from 88a46a02c10984a60294ece535b3fcbad4e2fe89 (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 46c68826d321ead8c8275d217416d0c30750e21c Author: Xavier Lagorce <Xav...@cr...> Date: Sun Feb 21 00:47:26 2010 +0100 New version of the 'goto' function This version finally works in every mode. ----------------------------------------------------------------------- Changes: diff --git a/USB_Module/Motor_Controller/Firmware/Motor_Controller.mcs b/USB_Module/Motor_Controller/Firmware/Motor_Controller.mcs deleted file mode 100644 index 7e843b1..0000000 --- a/USB_Module/Motor_Controller/Firmware/Motor_Controller.mcs +++ /dev/null @@ -1,149 +0,0 @@ -[Header] -MagicCookie={0b13fe8c-dfe0-40eb-8900-6712719559a7} -Version=1.0 -[File000] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\usb_descriptors.o -Folder=Intermediary -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} -LanguageToolLocation=C:\MCC18\bin\mcc18.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString= -TraceCmdString= -DebugOptions= -[File001] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\main.o -Folder=Intermediary -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} -LanguageToolLocation=C:\MCC18\bin\mcc18.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString= -TraceCmdString= -DebugOptions= -[File002] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\eeprom.o -Folder=Intermediary -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} -LanguageToolLocation=C:\MCC18\bin\mcc18.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString= -TraceCmdString= -DebugOptions= -[File003] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\motor.o -Folder=Intermediary -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} -LanguageToolLocation=C:\MCC18\bin\mcc18.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString= -TraceCmdString= -DebugOptions= -[File004] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\lm629.o -Folder=Intermediary -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} -LanguageToolLocation=C:\MCC18\bin\mcc18.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString= -TraceCmdString= -DebugOptions= -[File005] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\usb_device.o -Folder=Intermediary -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} -LanguageToolLocation=C:\MCC18\bin\mcc18.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString= -TraceCmdString= -DebugOptions= -[File006] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\usb_function_hid.o -Folder=Intermediary -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} -LanguageToolLocation=C:\MCC18\bin\mcc18.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString= -TraceCmdString= -DebugOptions= -[File007] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\error.o -Folder=Intermediary -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={E56A1C86-9D32-4DF6-8C34-FE0388B1B644} -LanguageToolLocation=C:\MCC18\bin\mcc18.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString= -TraceCmdString= -DebugOptions= -[File008] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\Motor_controller.cof -Folder=Output -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={96C98149-AA1B-4CF9-B967-FAE79CAB663C} -LanguageToolLocation=C:\MCC18\bin\mplink.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString=/m"$(BINDIR_)$(TARGETBASE).map" /w /o"$(BINDIR_)$(TARGETBASE).cof" -TraceCmdString= -DebugOptions= -[File009] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\Motor_controller.hex -Folder=Output -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={96C98149-AA1B-4CF9-B967-FAE79CAB663C} -LanguageToolLocation=C:\MCC18\bin\mplink.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString=/m"$(BINDIR_)$(TARGETBASE).map" /w /o"$(BINDIR_)$(TARGETBASE).cof" -TraceCmdString= -DebugOptions= -[File010] -Location=C:\krobot\USB_Module\Motor_Controller\Firmware\output\Motor_controller.map -Folder=Output -DeviceName=PIC18F4550 -LanguageToolSuiteID={5B7D72DD-9861-47BD-9F60-2BE967BF8416} -LanguageToolID={96C98149-AA1B-4CF9-B967-FAE79CAB663C} -LanguageToolLocation=C:\MCC18\bin\mplink.exe -PPAD=$(BINDIR)|output||$(TMPDIR)|output||$(AINDIR)||$(INCDIR)|C:\MCC18\h;.;Include||$(LIBDIR)|C:\mcc18\lib||$(LKRDIR)|| -SOLK=<src>|usb_descriptors.c|main.c|eeprom.c|motor.c|lm629.c|usb_device.c|usb_function_hid.c|error.c||<obj>||<lib>||<lkr>|rm18f4550.lkr|| -SuiteArgsString= -ToolArgsString=/m"$(BINDIR_)$(TARGETBASE).map" /w /o"$(BINDIR_)$(TARGETBASE).cof" -TraceCmdString= -DebugOptions= -[TOOL_LOC_STAMPS] -tool_loc{96C98149-AA1B-4CF9-B967-FAE79CAB663C}=C:\MCC18\bin\mplink.exe -tool_loc{E56A1C86-9D32-4DF6-8C34-FE0388B1B644}=C:\MCC18\bin\mcc18.exe diff --git a/USB_Module/Motor_Controller/Firmware/lm629.c b/USB_Module/Motor_Controller/Firmware/lm629.c index 77d23a7..0ee0b12 100644 --- a/USB_Module/Motor_Controller/Firmware/lm629.c +++ b/USB_Module/Motor_Controller/Firmware/lm629.c @@ -577,11 +577,11 @@ void moveForward(short pos, short vel, short acc) { resetInterrupt(MOTOR_BOTH); newPosition(MOTOR_RIGHT, - CON_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, - CON_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)); @@ -599,11 +599,11 @@ void moveBackward(short pos, short vel, short acc) { resetInterrupt(MOTOR_BOTH); newPosition(MOTOR_RIGHT, - - CON_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, - - CON_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)); @@ -621,11 +621,11 @@ void turnRight(short angle, short vel, short acc) { resetInterrupt(MOTOR_BOTH); newPosition(MOTOR_RIGHT, - - CON_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, - CON_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)); @@ -643,11 +643,11 @@ void turnLeft(short angle, short vel, short acc) { resetInterrupt(MOTOR_BOTH); newPosition(MOTOR_RIGHT, - CON_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, - - CON_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)); @@ -681,7 +681,7 @@ void turnLeft(short angle, short vel, short acc) { void goTo(short x, short y, short vel, short acc, BYTE mode, short d) { short posRight, posLeft, velRight, velLeft; float angle1, angle2, angle3; - float xc, r; + float r, ux, uy, vx, vy, Ox, Oy, u2x, u2y; float a; a = (((float) x)*((float) x) + ((float) y)*((float) y))/4.0; @@ -695,17 +695,35 @@ void goTo(short x, short y, short vel, short acc, BYTE mode, short d) { moveForward(sqrt(4.0 * a), vel, acc); } else { - xc = a/(2.0*d)-d/2.0; - r = xc + d; - - angle2 = -atan2(((float) y)/2.0 - xc*x/(4.0*a), ((float) x)/2.0 + xc*y/(4.0*a)); - angle3 = atan2(2.0*xc*a, xc*xc - a*a); - angle3 = (angle3 >= 0.0) ? angle3 : -angle3; + // Trajectory radius + r = a/(2.0*d)+d/2.0; + + // Director vector of start to end + ux = 1.0/(2.0*sqrt(a))*x; + uy = 1.0/(2.0*sqrt(a))*y; + + // Rotate last vector by 90 + vx = - uy; + vy = ux; + + // Position of the circle's center + Ox = x/2.0 - (r-d)*vx; + Oy = y/2.0 - (r-d)*vy; + + // Director vector of start to center rotated by 90 + u2x = - Oy / r; + u2y = Ox / r; + + // Tangent angle from the X axis + angle2 = atan2(u2y, u2x); + + // Angle to travel on the circle + angle3 = 2.0*atan2(sqrt(a), r-d); if (mode == GOTO_CURVE_LEFT) { - // angle2 = angle2 si on contourne par la gauche + // angle2 = angle2 if we pass left - turnRight(angle2*180.0/PI, vel, acc); + turnRight(90.0-angle2*180.0/PI, vel, acc); posRight = (r - (float) WHEELS_DIST/2.0)*angle3; posLeft = (r + (float) WHEELS_DIST/2.0)*angle3; @@ -713,11 +731,10 @@ void goTo(short x, short y, short vel, short acc, BYTE mode, short d) { velRight = ((float) posRight / ((float) posLeft)) * vel; } else { - // Si on on contourne par la droite, il faut faire le symique - // de la trajectoire par rapport au chemin direct + // If we pass right, we need to adjust the calculated angle angle2 = 2.0*angle1 - angle2; - turnRight(angle2*180.0/PI, vel, acc); + turnRight(90.0-angle2*180.0/PI, vel, acc); posRight = (r + (float) WHEELS_DIST/2.0)*angle3; posLeft = (r - (float) WHEELS_DIST/2.0)*angle3; @@ -728,11 +745,11 @@ void goTo(short x, short y, short vel, short acc, BYTE mode, short d) { waitTrajComplete(); newPosition(MOTOR_RIGHT, - - (long) ((float) posRight * COEF_RIGHT_WHEEL), + (long) ((float) posRight * COEF_RIGHT_WHEEL), (long) ((float) velRight * COEF_RIGHT_WHEEL * CONST_VEL), (long) ((float) acc * COEF_RIGHT_WHEEL * CONST_ACC)); newPosition(MOTOR_LEFT, - (long) ((float) posLeft * COEF_LEFT_WHEEL), + - (long) ((float) posLeft * COEF_LEFT_WHEEL), (long) ((float) velLeft * COEF_LEFT_WHEEL * CONST_VEL), (long) ((float) acc * COEF_LEFT_WHEEL * CONST_ACC)); diff --git a/USB_Module/Motor_Controller/Firmware/output/Motor_controller.cof b/USB_Module/Motor_Controller/Firmware/output/Motor_controller.cof index f106d0e..591696c 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 d6ded68..278bba0 100644 --- a/USB_Module/Motor_Controller/Firmware/output/Motor_controller.hex +++ b/USB_Module/Motor_Controller/Firmware/output/Motor_controller.hex @@ -1,25 +1,25 @@ :020000040000FA -:060000002AEF33F01200AC +:060000005EEF33F0120078 :0600080004EF04F01200F9 :060018000CEF04F01200E1 -:060800002AEF33F01200A4 +:060800005EEF33F0120070 :060808002EEF04F01200C7 :0608180096EF04F012004F -:06082A000400E766000077 -:100830002601000021000000DF6600005F010000CB -:1008400008000000D1660000470100000E00000013 -:0C085000CE6600006A01000003000000FA +:06082A0004004F6700000E +:100830002601000021000000476700005F01000062 +:100840000800000039670000470100000E000000AA +:0C085000366700006A0100000300000091 :04085C00DACFE4FF0C :10086000E2CFDAFFE9CFE4FFEACFE4FFF6CFE4FF1F :10087000F7CFE4FFF5CFE4FFF3CFE4FFF4CFE4FFDD -:10088000FACFE4FF00EE45F0140EE80403E3EECFE8 -:10089000E4FFFBD700EE00F0450EE80403E3EECFE3 +:10088000FACFE4FF00EE29F0140EE80403E3EECF04 +:10089000E4FFFBD700EE00F0290EE80403E3EECFFF :1008A000E4FFFBD75EEC13F09EA013D068EC13F0CE :1008B00001014D2B000E4E23E80E4D5D030E4E59E7 -:1008C00005E34D6B4E6B4F2B000E5023D4EC2BF0F9 +:1008C00005E34D6B4E6B4F2B000E502308EC2CF0C4 :1008D0009E9071EC13F002E2E16AE552E16EE5529E -:1008E000E7CFD9FFE55200EE44F0450EE80403E3FC -:1008F000E5CFEDFFFBD700EE58F0140EE80403E35C +:1008E000E7CFD9FFE55200EE28F0290EE80403E334 +:1008F000E5CFEDFFFBD700EE3CF0140EE80403E378 :10090000E5CFEDFFFBD7E5CFFAFFE5CFF4FFE5CF6D :10091000F3FFE5CFF5FFE5CFF7FFE5CFF6FFE5CF36 :10092000EAFFE5CFE9FFE5CFDAFF1100D8CFE4FF1A @@ -27,18 +27,18 @@ :10094000E4FFF4CFE4FF5EEC13F071EC13F002E28D :10095000E16AE552E16EE552E7CFD9FFE552E5CF16 :10096000F4FFE5CFF3FFE5CFDAFFE550E5CFE0FF99 -:10097000E5CFD8FF100004D8B7EC1EF060D8FCD744 -:100980000F0EC11202D881EF1EF081EC13F0E65277 +:10097000E5CFD8FF100004D8EBEC1EF060D8FCD710 +:100980000F0EC11202D8B5EF1EF081EC13F0E65243 :1009900035EC13F00101676F070E675D10E1E66A41 -:1009A00044EC32F0E552DF6E000EDF8079EC13F09C -:1009B000E66AFDEC32F0E552DF7079EC13F0D08E90 +:1009A00078EC32F0E552DF6E000EDF8079EC13F068 +:1009B000E66A31EC33F0E552DF7079EC13F0D08E5B :1009C000F28EF28CF30E8C1695160101476B486B74 :1009D000496B4A6B010E4B6FF90E921680160E0E84 -:1009E000E66E7C0EE66EE10EE66EB7EC31F0E55297 +:1009E000E66E7C0EE66EE10EE66EEBEC31F0E55263 :1009F000E552E552CF0E9216939894943F0E9516B9 :100A0000010EE66E86EC13F0E552838C81888284B9 -:100A1000808A838E80888294010EE66E38EC33F0F3 -:100A2000E55282849D80C50EE66E8DEC32F0E55273 +:100A1000808A838E80888294010EE66E6CEC33F0BF +:100A2000E55282849D80C50EE66EC1EC32F0E5523F :100A300068EC13F0E552E552E7CFD9FF1200D9CFA9 :100A4000E6FFE1CFD9FF0F0EE12601014B5102E095 :100A50007AEC12F0200E0101005D03E36D50020BF1 @@ -49,33 +49,33 @@ :100AA0004C514C2B0501416F0501040E426F0101B1 :100AB0004651EA6A260FE96E010EEA22EFCF43F5AE :100AC000400EE66E400EE66E050EE66E010EE66E18 -:100AD000010EE66ED2EC22F0006E050EE15E0050D3 +:100AD000010EE66E06EC23F0006E050EE15E00509E :100AE000F3CF49F1F4CF4AF101014651EA6A260FEA :100AF000E96E010EEA22EF6A01014651000803E2A5 :100B00000101460707D001014551000803E2010138 :100B10001F0E466F010149514A1102E1000E08D033 :100B200049C1E9FF4AC1EAFFEF50800B01E0010E25 -:100B300000092CE10101520529E10BEC1BF0000931 +:100B300000092CE10101520529E1E4EC1AF0000959 :100B400025E00501406B01014C514C2B0501416F23 :100B500005010A0E426F0501436B0501010E486F46 :100B6000400EE66E400EE66E050EE66E010EE66E77 -:100B7000010EE66ED2EC22F0006E050EE15E005032 +:100B7000010EE66E06EC23F0006E050EE15E0050FD :100B8000F3CF49F1F4CF4AF10101526B000E01019C :100B9000E76E5119E8AE02D0513503D0E750D88046 :100BA000515501E38ED001015151FF0A29E0FD0AA0 -:100BB00013E0030A01E06ED0020EE66E20EC2DF089 +:100BB00013E0030A01E06ED0020EE66E54EC2DF055 :100BC000E552ADEC16F0000904E00101020E516F90 :100BD00002D00101516960D0200EE66E030EE66E70 -:100BE000C80EE66EE66AE80EE66E030EE66E0DECE3 +:100BE000C80EE66EE66AE80EE66E030EE66E06ECEA :100BF00018F0006E060EE15E00500101516B4CD002 :100C0000010149514A1102E1000E08D049C1E9FF32 :100C10004AC1EAFFEF50800B01E0010E000939E103 :100C20000501406B01014C514C2B0501416F050141 -:100C3000050E426F0501436B0501486B4F0E006EB8 +:100C3000050E426F0501436B0501486BB70E006E50 :100C4000630E016E026A00C0E6FF01C0E6FF02C04B -:100C5000E6FF480EE66E050EE66E08EC32F0036E17 +:100C5000E6FF480EE66E050EE66E3CEC32F0036EE3 :100C6000050EE15E0350400EE66E400EE66E050E88 -:100C7000E66E010EE66E010EE66ED2EC22F0006E1C +:100C7000E66E010EE66E010EE66E06EC23F0006EE7 :100C8000050EE15E0050F3CF49F1F4CF4AF10101C6 :100C9000516B02D00101516B020EE66EE66A48EC20 :100CA00016F0E552E55200090AE1020EE66E010E69 @@ -85,8 +85,8 @@ :100CE00002E070EF12F005010251070A02E1D1EFB4 :100CF00011F00D0A01E10CD2010A01E1DCD10D0A6B :100D000001E174D1040A1AE0030A07E0010A02E0D3 -:100D10002FEF12F0FF0070EF12F0E66A44EC32F0B1 -:100D2000E552DF6E000EDB80DFCFE6FFE66A24ECE3 +:100D10002FEF12F0FF0070EF12F0E66A78EC32F07D +:100D2000E552DF6E000EDB80DFCFE6FFE66A58ECAF :100D300032F0E552E552FF0070EF12F00101495127 :100D40004A1102E1000E08D049C1E9FF4AC1EAFF99 :100D5000EF50800B01E0010E000901E045D100C514 @@ -94,26 +94,26 @@ :100D700005010851070A01E1BBD0010A01E17ED05B :100D8000020A71E0070A64E0010A20E0030A06E0B3 :100D9000010A01E0FFD067C148F5FFD00501486BAB -:100DA0002B0E006E630E016E026A00C0E6FF01C0EA -:100DB000E6FF02C0E6FF480EE66E050EE66E08ECA2 +:100DA000930E006E630E016E026A00C0E6FF01C082 +:100DB000E6FF02C0E6FF480EE66E050EE66E3CEC6E :100DC00032F0036E050EE15E0350E7D00501486B7B -:100DD0001F0E006E630E016E026A00C0E6FF01C0C6 -:100DE000E6FF02C0E6FF480EE66E050EE66E08EC72 -:100DF00032F0036E050EE15E03501D0E006E630EB1 +:100DD000870E006E630E016E026A00C0E6FF01C05E +:100DE000E6FF02C0E6FF480EE66E050EE66E3CEC3E +:100DF00032F0036E050EE15E0350850E006E630E49 :100E0000016E026A00C0E6FF01C0E6FF02C0E6FF15 -:100E1000480EE66E050EE66E08EC32F0036E050E27 -:100E2000E15E0350140E006E630E016E026A00C094 +:100E1000480EE66E050EE66E3CEC32F0036E050EF3 +:100E2000E15E03507C0E006E630E016E026A00C02C :100E3000E6FF01C0E6FF02C0E6FF480EE66E050EC3 -:100E4000E66E08EC32F0036E050EE15E0350A5D0AD +:100E4000E66E3CEC32F0036E050EE15E0350A5D079 :100E500092CF48F593CF49F594CF4AF595CF4BF50E :100E600096CF4CF59AD080CF48F581CF49F582CF07 -:100E70004AF583CF4BF584CF4CF58FD0E66A7AECF8 -:100E80002CF0E552010E49C0DBFF020E4AC0DBFF29 -:100E9000030E4BC0DBFF040E4CC0DBFF040EDBCFA8 +:100E70004AF583CF4BF584CF4CF58FD0E66AAEECC4 +:100E80002CF0E552010E2DC0DBFF020E2EC0DBFF61 +:100E9000030E2FC0DBFF040E30C0DBFF040EDBCFE0 :100EA00048F5030EDBCF49F5020EDBCF4AF5010E04 -:100EB000DBCF4BF5010EE66E7AEC2CF0E552010E1D -:100EC00049C0DBFF020E4AC0DBFF030E4BC0DBFF55 -:100ED000040E4CC0DBFF040EDBCF4CF5030EDBCF62 +:100EB000DBCF4BF5010EE66EAEEC2CF0E552010EE9 +:100EC0002DC0DBFF020E2EC0DBFF030E2FC0DBFFA9 +:100ED000040E30C0DBFF040EDBCF4CF5030EDBCF7E :100EE0004DF5020EDBCF4EF5010EDBCF4FF555D0A1 :100EF0000A0EE66EE66AD6EC13F0E552E552E66AB3 :100F00003AEC15F0E552030EF3CFDBFF040EF4CFFD @@ -126,10 +126,10 @@ :100F7000F3CFDEFFF4CFDDFFDD52040EDBCF4CF507 :100F8000030EDBCF4DF5020EDBCF4EF5010EDBCFAE :100F90004FF503D00501020E436F400EE66E400E82 -:100FA000E66E050EE66E010EE66E010EE66ED2EC02 -:100FB00022F0006E050EE15E0050F3CF49F1F4CF50 +:100FA000E66E050EE66E010EE66E010EE66E06ECCE +:100FB00023F0006E050EE15E0050F3CF49F1F4CF4F :100FC0004AF1400EE66E000EE66E050EE66EE66A2B -:100FD000010EE66ED2EC22F0006E050EE15E0050CE +:100FD000010EE66E06EC23F0006E050EE15E005099 :100FE000F3CF47F1F4CF48F170EF12F0050108514B :100FF000030A37E0010A25E0030A13E0010A01E0D1 :1010000040D005010951921205010A5193120501C0 @@ -140,14 +140,14 @@ :101050000B1D8B1605010C1D8C1605010D1D8D1623 :1010600015D005010951891205010A518A1205019D :101070000B518B1205010C518C1205010D518D1273 -:1010800005D0030EE66ECAEC32F0E552400EE66E75 -:10109000000EE66E050EE66EE66A010EE66ED2EC16 -:1010A00022F0006E050EE15E0050F3CF47F1F4CF61 +:1010800005D0030EE66EFEEC32F0E552400EE66E41 +:10109000000EE66E050EE66EE66A010EE66E06ECE2 +:1010A00023F0006E050EE15E0050F3CF47F1F4CF60 :1010B00048F170EF12F005010851020A09E0030A35 -:1010C00001E00CD009C5E6FF20EC2DF0E5520BD075 -:1010D00009C5E6FF30EC2DF0E55205D0010EE66EB5 -:1010E000CAEC32F0E552400EE66E000EE66E050EDA -:1010F000E66EE66A010EE66ED2EC22F0006E050E98 +:1010C00001E00CD009C5E6FF54EC2DF0E5520BD041 +:1010D00009C5E6FF64EC2DF0E55205D0010EE66E81 +:1010E000FEEC32F0E552400EE66E000EE66E050EA6 +:1010F000E66EE66A010EE66E06EC23F0006E050E63 :10110000E15E0050F3CF47F1F4CF48F170EF12F0F9 :1011100005010851060A02E190EF11F0080A02E108 :1011200056EF11F0030A02E14DEF11F0070A02E158 @@ -157,80 +157,80 @@ :10116000030A01E1ACD1010A01E1A5D10C0A01E1B8 :1011700026D1030A01E194D0040A02E0B8EF11F08D :101180000501095104E0020E0501095D40E10AC5AF -:10119000E6FF010EE66E24EC32F0E552E5520BC597 -:1011A000E6FF020EE66E24EC32F0E552E5520CC585 -:1011B000E6FF030EE66E24EC32F0E552E5520DC573 -:1011C000E6FF040EE66E24EC32F0E552E5520EC561 -:1011D000E6FF050EE66E24EC32F0E552E5520FC54F -:1011E000E6FF060EE66E24EC32F0E552E55210C53D -:1011F000E6FF070EE66E24EC32F0E552E55211C52B -:10120000E6FF080EE66E24EC32F0E552E5520501E9 +:10119000E6FF010EE66E58EC32F0E552E5520BC563 +:1011A000E6FF020EE66E58EC32F0E552E5520CC551 +:1011B000E6FF030EE66E58EC32F0E552E5520DC53F +:1011C000E6FF040EE66E58EC32F0E552E5520EC52D +:1011D000E6FF050EE66E58EC32F0E552E5520FC51B +:1011E000E6FF060EE66E58EC32F0E552E55210C509 +:1011F000E6FF070EE66E58EC32F0E552E55211C5F7 +:10120000E6FF080EE66E58EC32F0E552E5520501B5 :10121000090504E0020E0501095D40E10AC5E6FF8B -:10122000090EE66E24EC32F0E552E5520BC5E6FFFE -:101230000A0EE66E24EC32F0E552E5520CC5E6FFEC -:101240000B0EE66E24EC32F0E552E5520DC5E6FFDA -:101250000C0EE66E24EC32F0E552E5520EC5E6FFC8 -:101260000D0EE66E24EC32F0E552E5520FC5E6FFB6 -:101270000E0EE66E24EC32F0E552E55210C5E6FFA4 -:101280000F0EE66E24EC32F0E552E55211C5E6FF92 -:10129000100EE66E24EC32F0E552E552BDEF11F08F +:10122000090EE66E58EC32F0E552E5520BC5E6FFCA +:101230000A0EE66E58EC32F0E552E5520CC5E6FFB8 +:101240000B0EE66E58EC32F0E552E5520DC5E6FFA6 +:101250000C0EE66E58EC32F0E552E5520EC5E6FF94 +:101260000D0EE66E58EC32F0E552E5520FC5E6FF82 +:101270000E0EE66E58EC32F0E552E55210C5E6FF70 +:101280000F0EE66E58EC32F0E552E55211C5E6FF5E +:10129000100EE66E58EC32F0E552E552BDEF11F05B :1012A00000C540F50501416B0501030E426F0501C4 -:1012B000436B010EE66E44EC32F0E5520501486FD7 -:1012C000020EE66E44EC32F0E5520501496F030E62 -:1012D000E66E44EC32F0E55205014A6F040EE66E0C -:1012E00044EC32F0E55205014B6F050EE66E44EC1E -:1012F00032F0E55205014C6F060EE66E44EC32F01A -:10130000E55205014D6F070EE66E44EC32F0E552F2 -:1013100005014E6F080EE66E44EC32F0E552050111 -:101320004F6F090EE66E44EC32F0E5520501506F46 -:101330000A0EE66E44EC32F0E5520501516F0B0ED9 -:10134000E66E44EC32F0E5520501526F0C0EE66E8B -:1013500044EC32F0E5520501536F0D0EE66E44EC9D -:1013600032F0E5520501546F0E0EE66E44EC32F099 -:10137000E5520501556F0F0EE66E44EC32F0E55272 -:101380000501566F100EE66E44EC32F0E552050191 +:1012B000436B010EE66E78EC32F0E5520501486FA3 +:1012C000020EE66E78EC32F0E5520501496F030E2E +:1012D000E66E78EC32F0E55205014A6F040EE66ED8 +:1012E00078EC32F0E55205014B6F050EE66E78ECB6 +:1012F00032F0E55205014C6F060EE66E78EC32F0E6 +:10130000E55205014D6F070EE66E78EC32F0E552BE +:1013100005014E6F080EE66E78EC32F0E5520501DD +:101320004F6F090EE66E78EC32F0E5520501506F12 +:101330000A0EE66E78EC32F0E5520501516F0B0EA5 +:10134000E66E78EC32F0E5520501526F0C0EE66E57 +:1013500078EC32F0E5520501536F0D0EE66E78EC35 +:1013600032F0E5520501546F0E0EE66E78EC32F065 +:10137000E5520501556F0F0EE66E78EC32F0E5523E +:101380000501566F100EE66E78EC32F0E55205015D :10139000576F400EE66E400EE66E050EE66E010ECD -:1013A000E66E010EE66ED2EC22F0006E050EE15EF6 +:1013A000E66E010EE66E06EC23F0006E050EE15EC1 :1013B0000050F3CF49F1F4CF4AF1BDEF11F0030E25 -:1013C000E66E010EE66E24EC32F0E552E552E80ED0 -:1013D000E66E020EE66E24EC32F0E552E552E66A65 -:1013E000030EE66E24EC32F0E552E552010EE66E95 -:1013F000040EE66E24EC32F0E552E552E66A050E84 -:10140000E66E24EC32F0E552E552E66A060EE66E30 -:1014100024EC32F0E552E552270EE66E070EE66E3A -:1014200024EC32F0E552E552100EE66E080EE66E40 -:1014300024EC32F0E552E552030EE66E090EE66E3C -:1014400024EC32F0E552E552E80EE66E0A0EE66E46 -:1014500024EC32F0E552E552E66A0B0EE66E24EC1F -:1014600032F0E552E552010EE66E0C0EE66E24EC0B -:1014700032F0E552E552E66A0D0EE66E24EC32F0EB -:10148000E552E552E66A0E0EE66E24EC32F0E552C5 -:10149000E552270EE66E0F0EE66E24EC32F0E552B2 -:1014A000E552100EE66E100EE66E24EC32F0E552B8 +:1013C000E66E010EE66E58EC32F0E552E552E80E9C +:1013D000E66E020EE66E58EC32F0E552E552E66A31 +:1013E000030EE66E58EC32F0E552E552010EE66E61 +:1013F000040EE66E58EC32F0E552E552E66A050E50 +:10140000E66E58EC32F0E552E552E66A060EE66EFC +:1014100058EC32F0E552E552270EE66E070EE66E06 +:1014200058EC32F0E552E552100EE66E080EE66E0C +:1014300058EC32F0E552E552030EE66E090EE66E08 +:1014400058EC32F0E552E552E80EE66E0A0EE66E12 +:1014500058EC32F0E552E552E66A0B0EE66E58ECB7 +:1014600032F0E552E552010EE66E0C0EE66E58ECD7 +:1014700032F0E552E552E66A0D0EE66E58EC32F0B7 +:10148000E552E552E66A0E0EE66E58EC32F0E55291 +:10149000E552270EE66E0F0EE66E58EC32F0E5527E +:1014A000E552100EE66E100EE66E58EC32F0E55284 :1014B000E552BDEF11F0ADEC16F0BDEF11F0060EE8 :1014C00009C5DBFF050E0AC5DBFF080E0BC5DBFFF8 :1014D000070E0CC5DBFF0A0E0DC5DBFF090E0EC59E :1014E000DBFF090EDBCFE6FF0A0EDBCFE6FF070EC0 :1014F000DBCFE6FF080EDBCFE6FF050EDBCFE6FF16 -:10150000060EDBCFE6FF0DEC18F0006E060EE15E76 +:10150000060EDBCFE6FF06EC18F0006E060EE15E7D :1015100000500101010E526FBDEF11F0060E09C51A :10152000DBFF050E0AC5DBFF080E0BC5DBFF070E50 :101530000CC5DBFF0A0E0DC5DBFF090E0EC5DBFF78 :10154000090EDBCFE6FF0A0EDBCFE6FF070EDBCF8F :10155000E6FF080EDBCFE6FF050EDBCFE6FF060E4B -:10156000DBCFE6FF18EC18F0006E060EE15E0050CF +:10156000DBCFE6FF11EC18F0006E060EE15E0050D6 :101570000101010E526FBDEF11F0060E09C5DBFF30 :10158000050E0AC5DBFF080E0BC5DBFF070E0CC5F9 :10159000DBFF0A0E0DC5DBFF090E0EC5DBFF090ED2 :1015A000DBCFE6FF0A0EDBCFE6FF070EDBCFE6FF61 :1015B000080EDBCFE6FF050EDBCFE6FF060EDBCF26 -:1015C000E6FF23EC18F0006E060EE15E005001010C +:1015C000E6FF1EEC18F0006E060EE15E0050010111 :1015D000010E526FBDEF11F0060E09C5DBFF050EBF :1015E0000AC5DBFF080E0BC5DBFF070E0CC5DBFFD2 :1015F0000A0E0DC5DBFF090E0EC5DBFF090EDBCFA2 :10160000E6FF0A0EDBCFE6FF070EDBCFE6FF080E94 :10161000DBCFE6FF050EDBCFE6FF060EDBCFE6FFF6 -:1016200032EC18F0006E060EE15E00500101010E72 +:101620002AEC18F0006E060EE15E00500101010E7A :10163000526FBDEF11F0060E09C5DBFF050E0AC59E :10164000DBFF080E0BC5DBFF070E0CC5DBFF0A0E28 :101650000DC5DBFF090E0EC5DBFF0C0E0FC5DBFF52 @@ -239,232 +239,232 @@ :10168000E6FF0B0EDBCFE6FF0C0EDBCFE6FF090E0D :10169000DBCFE6FF0A0EDBCFE6FF070EDBCFE6FF70 :1016A000080EDBCFE6FF050EDBCFE6FF060EDBCF35 -:1016B000E6FF3FEC18F0006E0B0EE15E00500101FA +:1016B000E6FF36EC18F0006E0B0EE15E0050010103 :1016C000010E526FBDEF11F0060E0AC5DBFF050ECD :1016D0000BC5DBFF050EDBCFE6FF060EDBCFE6FF1B -:1016E00009C5E6FF05EC18F0E552E552E552BDEFFD +:1016E00009C5E6FFFCEC17F0E552E552E552BDEF07 :1016F00011F0060E0AC5DBFF050E0BC5DBFF080E59 :101700000CC5DBFF070E0DC5DBFF0A0E0EC5DBFFA8 :10171000090E0FC5DBFF020E0501095D01E0B8D11E -:10172000090EDBCF4BF00A0EDBCF4CF027EC24F098 -:101730004AC008F04BC009F04CC00AF04DC00BF095 -:10174000A60E4F6E280E506E940E516E3F0E526EC6 -:1017500008C04AF009C04BF00AC04CF00BC04DF075 -:1017600041EC25F04AC004F04BC005F04CC006F037 -:101770004DC007F0CC0E4F6EBC0E506E8C0E516EED -:101780003B0E526E04C04AF005C04BF006C04CF050 -:1017900007C04DF041EC25F0DDEC25F049C000F02C -:1017A0004AC001F04BC002F04CC003F000C0E6FF9D +:10172000090EDBCF2FF00A0EDBCF30F05BEC24F09C +:101730002EC008F02FC009F030C00AF031C00BF005 +:10174000A60E336E280E346E940E356E3F0E366E36 +:1017500008C02EF009C02FF00AC030F00BC031F0E5 +:1017600075EC25F02EC004F02FC005F030C006F057 +:1017700031C007F0CC0E336EBC0E346E8C0E356E5D +:101780003B0E366E04C02EF005C02FF006C030F0C0 +:1017900007C031F075EC25F011EC26F02DC000F0FB +:1017A0002EC001F02FC002F030C003F000C0E6FFF1 :1017B00001C0E6FF02C0E6FF03C0E6FF070EDBCF75 -:1017C0004BF0080EDBCF4CF027EC24F04AC014F0AD -:1017D0004BC015F04CC016F04DC017F0A60E4F6E62 -:1017E000280E506E940E516E3F0E526E14C04AF089 -:1017F00015C04BF016C04CF017C04DF041EC25F071 -:101800004AC010F04BC011F04CC012F04DC013F0A4 -:10181000BD0E4F6E370E506E860E516E410E526EDB -:1018200010C04AF011C04BF012C04CF013C04DF084 -:1018300041EC25F0DDEC25F049C00CF04AC00DF07C -:101840004BC00EF04CC00FF00CC0E6FF0DC0E6FF21 -:101850000EC0E6FF0FC0E6FF050EDBCF4BF0060E15 -:10186000DBCF4CF027EC24F04AC01CF04BC01DF03D -:101870004CC01EF04DC01FF0A60E4F6E280E506ECD -:10188000940E516E3F0E526E1CC04AF01DC04BF0BC -:101890001EC04CF01FC04DF041EC25F0DDEC25F0F2 -:1018A00049C018F04AC019F04BC01AF04CC01BF0E8 +:1017C0002FF0080EDBCF30F05BEC24F02EC014F0CD +:1017D0002FC015F030C016F031C017F0A60E336ED2 +:1017E000280E346E940E356E3F0E366E14C02EF0F9 +:1017F00015C02FF016C030F017C031F075EC25F091 +:101800002EC010F02FC011F030C012F031C013F014 +:10181000BD0E336E370E346E860E356E410E366E4B +:1018200010C02EF011C02FF012C030F013C031F0F4 +:1018300075EC25F011EC26F02DC00CF02EC00DF04B +:101840002FC00EF030C00FF00CC0E6FF0DC0E6FF59 +:101850000EC0E6FF0FC0E6FF050EDBCF2FF0060E31 +:10186000DBCF30F05BEC24F02EC01CF02FC01DF05D +:1018700030C01EF031C01FF0A60E336E280E346E3D +:10188000940E356E3F0E366E1CC02EF01DC02FF02C +:101890001EC030F01FC031F075EC25F011EC26F0C1 +:1018A0002DC018F02EC019F02FC01AF030C01BF058 :1018B000000E186C191E19221A1E1A221B1E1B223A :1018C00018C0E6FF19C0E6FF1AC0E6FF1BC0E6FF1E :1018D000E66A2FEC17F0206E0D0EE15E2050090E27 -:1018E000DBCF4BF00A0EDBCF4CF027EC24F04AC0E4 -:1018F00008F04BC009F04CC00AF04DC00BF0A60E2A -:101900004F6E280E506E940E516E3F0E526E08C0F0 -:101910004AF009C04BF00AC04CF00BC04DF041EC4E -:1019200025F04AC004F04BC005F04CC006F04DC095 -:1019300007F0CC0E4F6EBC0E506E8C0E516E3B0EEF -:10194000526E04C04AF005C04BF006C04CF007C010 -:101950004DF041EC25F0DDEC25F049C000F04AC027 -:1019600001F04BC002F04CC003F000C0E6FF01C024 -:10197000E6FF02C0E6FF03C0E6FF070EDBCF4BF039 -:10198000080EDBCF4CF027EC24F04AC014F04BC01B -:1019900015F04CC016F04DC017F0A60E4F6E280E75 -:1019A000506E940E516E3F0E526E14C04AF015C028 -:1019B0004BF016C04CF017C04DF041EC25F04AC07A -:1019C00010F04BC011F04CC012F04DC013F0BD0E22 -:1019D0004F6E370E506E860E516E410E526E10C015 -:1019E0004AF011C04BF012C04CF013C04DF041EC66 -:1019F00025F0DDEC25F049C00CF04AC00DF04BC0DD -:101A00000EF04CC00FF00CC0E6FF0DC0E6FF0EC09C -:101A1000E6FF0FC0E6FF050EDBCF4BF0060EDBCF77 -:101A20004CF027EC24F04AC01CF04BC01DF04CC019 -:101A30001EF04DC01FF0A60E4F6E280E506E940E75 -:101A4000516E3F0E526E1CC04AF01DC04BF01EC0BE -:101A50004CF01FC04DF041EC25F0DDEC25F049C005 -:101A600018F04AC019F04BC01AF04CC01BF018C057 +:1018E000DBCF2FF00A0EDBCF30F05BEC24F02EC004 +:1018F00008F02FC009F030C00AF031C00BF0A60E7E +:10190000336E280E346E940E356E3F0E366E08C060 +:101910002EF009C02FF00AC030F00BC031F075EC8A +:1019200025F02EC004F02FC005F030C006F031C005 +:1019300007F0CC0E336EBC0E346E8C0E356E3B0E43 +:10194000366E04C02EF005C02FF006C030F007C080 +:1019500031F075EC25F011EC26F02DC000F02EC012 +:1019600001F02FC002F030C003F000C0E6FF01C05C +:10197000E6FF02C0E6FF03C0E6FF070EDBCF2FF055 +:10198000080EDBCF30F05BEC24F02EC014F02FC03B +:1019900015F030C016F031C017F0A60E336E280EC9 +:1019A000346E940E356E3F0E366E14C02EF015C098 +:1019B0002FF016C030F017C031F075EC25F02EC0B6 +:1019C00010F02FC011F030C012F031C013F0BD0E76 +:1019D000336E370E346E860E356E410E366E10C085 +:1019E0002EF011C02FF012C030F013C031F075ECA2 +:1019F00025F011EC26F02DC00CF02EC00DF02FC0FC +:101A00000EF030C00FF00CC0E6FF0DC0E6FF0EC0B8 +:101A1000E6FF0FC0E6FF050EDBCF2FF0060EDBCF93 +:101A200030F05BEC24F02EC01CF02FC01DF030C055 +:101A30001EF031C01FF0A60E336E280E346E940EC9 +:101A4000356E3F0E366E1CC02EF01DC02FF01EC02E +:101A500030F01FC031F075EC25F011EC26F02DC0F0 +:101A600018F02EC019F02FC01AF030C01BF018C0AB :101A7000E6FF19C0E6FF1AC0E6FF1BC0E6FF010E35 :101A8000E66E2FEC17F0206E0D0EE15E2050E0D0D8 -:101A9000090EDBCF4BF00A0EDBCF4CF027EC24F025 -:101AA0004AC008F04BC009F04CC00AF04DC00BF022 -:101AB000A60E4F6E280E506E940E516E3F0E526E53 -:101AC00008C04AF009C04BF00AC04CF00BC04DF002 -:101AD00041EC25F04AC004F04BC005F04CC006F0C4 -:101AE0004DC007F0CC0E4F6EBC0E506E8C0E516E7A -:101AF0003B0E526E04C04AF005C04BF006C04CF0DD -:101B000007C04DF041EC25F0DDEC25F049C000F0B8 -:101B10004AC001F04BC002F04CC003F000C0E6FF29 +:101A9000090EDBCF2FF00A0EDBCF30F05BEC24F029 +:101AA0002EC008F02FC009F030C00AF031C00BF092 +:101AB000A60E336E280E346E940E356E3F0E366EC3 +:101AC00008C02EF009C02FF00AC030F00BC031F072 +:101AD00075EC25F02EC004F02FC005F030C006F0E4 +:101AE00031C007F0CC0E336EBC0E346E8C0E356EEA +:101AF0003B0E366E04C02EF005C02FF006C030F04D +:101B000007C031F075EC25F011EC26F02DC000F087 +:101B10002EC001F02FC002F030C003F000C0E6FF7D :101B200001C0E6FF02C0E6FF03C0E6FF070EDBCF01 -:101B30004BF0080EDBCF4CF027EC24F04AC014F039 -:101B40004BC015F04CC016F04DC017F0A60E4F6EEE -:101B5000280E506E940E516E3F0E526E14C04AF015 -:101B600015C04BF016C04CF017C04DF041EC25F0FD -:101B70004AC010F04BC011F04CC012F04DC013F031 -:101B8000BD0E4F6E370E506E860E516E410E526E68 -:101B900010C04AF011C04BF012C04CF013C04DF011 -:101BA00041EC25F0DDEC25F049C00CF04AC00DF009 -:101BB0004BC00EF04CC00FF00CC0E6FF0DC0E6FFAE -:101BC0000EC0E6FF0FC0E6FF050EDBCF4BF0060EA2 -:101BD000DBCF4CF027EC24F04AC01CF04BC01DF0CA -:101BE0004CC01EF04DC01FF0A60E4F6E280E506E5A -:101BF000940E516E3F0E526E1CC04AF01DC04BF049 -:101C00001EC04CF01FC04DF041EC25F0DDEC25F07E -:101C100049C018F04AC019F04BC01AF04CC01BF074 +:101B30002FF0080EDBCF30F05BEC24F02EC014F059 +:101B40002FC015F030C016F031C017F0A60E336E5E +:101B5000280E346E940E356E3F0E366E14C02EF085 +:101B600015C02FF016C030F017C031F075EC25F01D +:101B70002EC010F02FC011F030C012F031C013F0A1 +:101B8000BD0E336E370E346E860E356E410E366ED8 +:101B900010C02EF011C02FF012C030F013C031F081 +:101BA00075EC25F011EC26F02DC00CF02EC00DF0D8 +:101BB0002FC00EF030C00FF00CC0E6FF0DC0E6FFE6 +:101BC0000EC0E6FF0FC0E6FF050EDBCF2FF0060EBE +:101BD000DBCF30F05BEC24F02EC01CF02FC01DF0EA +:101BE00030C01EF031C01FF0A60E336E280E346ECA +:101BF000940E356E3F0E366E1CC02EF01DC02FF0B9 +:101C00001EC030F01FC031F075EC25F011EC26F04D +:101C10002DC018F02EC019F02FC01AF030C01BF0E4 :101C2000000E186C191E19221A1E1A221B1E1B22C6 :101C300018C0E6FF19C0E6FF1AC0E6FF1BC0E6FFAA :101C400009C5E6FF2FEC17F0206E0D0EE15E205067 :101C500094D3060E0AC5DBFF050E0BC5DBFF080E8D :101C60000CC5DBFF070E0DC5DBFF020E0501095D8C :101C700001E04FD1FF0E05010E03F350E66E070E93 -:101C8000DBCF4BF0080EDBCF4CF027EC24F04AC042 -:101C900008F04BC009F04CC00AF04DC00BF0A60E86 -:101CA0004F6E280E506E940E516E3F0E526E08C04D -:101CB0004AF009C04BF00AC04CF00BC04DF041ECAB -:101CC00025F04AC004F04BC005F04CC006F04DC0F2 -:101CD00007F0CC0E4F6EBC0E506E8C0E516E3B0E4C -:101CE000526E04C04AF005C04BF006C04CF007C06D -:101CF0004DF041EC25F0DDEC25F049C000F04AC084 -:101D000001F04BC002F04CC003F000C0E6FF01C080 -:101D1000E6FF02C0E6FF03C0E6FF050EDBCF4BF097 -:101D2000060EDBCF4CF027EC24F04AC014F04BC079 -:101D300015F04CC016F04DC017F0A60E4F6E280ED1 -:101D4000506E940E516E3F0E526E14C04AF015C084 -:101D50004BF016C04CF017C04DF041EC25F04AC0D6 -:101D600010F04BC011F04CC012F04DC013F0BD0E7E -:101D70004F6E370E506E860E516E410E526E10C071 -:101D80004AF011C04BF012C04CF013C04DF041ECC2 -:101D900025F0DDEC25F049C00CF04AC00DF04BC039 -:101DA0000EF04CC00FF00CC0E6FF0DC0E6FF0EC0F9 +:101C8000DBCF2FF0080EDBCF30F05BEC24F02EC062 +:101C900008F02FC009F030C00AF031C00BF0A60EDA +:101CA000336E280E346E940E356E3F0E366E08C0BD +:101CB0002EF009C02FF00AC030F00BC031F075ECE7 +:101CC00025F02EC004F02FC005F030C006F031C062 +:101CD00007F0CC0E336EBC0E346E8C0E356E3B0EA0 +:101CE000366E04C02EF005C02FF006C030F007C0DD +:101CF00031F075EC25F011EC26F02DC000F02EC06F +:101D000001F02FC002F030C003F000C0E6FF01C0B8 +:101D1000E6FF02C0E6FF03C0E6FF050EDBCF2FF0B3 +:101D2000060EDBCF30F05BEC24F02EC014F02FC099 +:101D300015F030C016F031C017F0A60E336E280E25 +:101D4000346E940E356E3F0E366E14C02EF015C0F4 +:101D50002FF016C030F017C031F075EC25F02EC012 +:101D600010F02FC011F030C012F031C013F0BD0ED2 +:101D7000336E370E346E860E356E410E366E10C0E1 +:101D80002EF011C02FF012C030F013C031F075ECFE +:101D900025F011EC26F02DC00CF02EC00DF02FC058 +:101DA0000EF030C00FF00CC0E6FF0DC0E6FF0EC015 :101DB000E6FF0FC0E6FFE66A71EC17F0186E0A0E38 -:101DC000E15E18500EC5E6FF070EDBCF4BF0080EA4 -:101DD000DBCF4CF027EC24F04AC008F04BC009F0F0 -:101DE0004CC00AF04DC00BF0A60E4F6E280E506E80 -:101DF000940E516E3F0E526E08C04AF009C04BF06F -:101E00000AC04CF00BC04DF041EC25F04AC004F084 -:101E10004BC005F04CC006F04DC007F0CC0E4F6E25 -:101E2000BC0E506E8C0E516E3B0E526E04C04AF0CA -:101E300005C04BF006C04CF007C04DF041EC25F05A -:101E4000DDEC25F049C000F04AC001F04BC002F0C3 -:101E50004CC003F000C0E6FF01C0E6FF02C0E6FF91 -:101E600003C0E6FF050EDBCF4BF0060EDBCF4CF0D8 -:101E700027EC24F04AC014F04BC015F04CC016F00B -:101E80004DC017F0A60E4F6E280E506E940E516E78 -:101E90003F0E526E14C04AF015C04BF016C04CF005 -:101EA00017C04DF041EC25F04AC010F04BC011F0C6 -:101EB0004CC012F04DC013F0BD0E4F6E370E506E79 -:101EC000860E516E410E526E10C04AF011C04BF09A -:101ED00012C04CF013C04DF041EC25F0DDEC25F0C4 -:101EE00049C00CF04AC00DF04BC00EF04CC00FF0D2 +:101DC000E15E18500EC5E6FF070EDBCF2FF0080EC0 +:101DD000DBCF30F05BEC24F02EC008F02FC009F010 +:101DE00030C00AF031C00BF0A60E336E280E346EF0 +:101DF000940E356E3F0E366E08C02EF009C02FF0DF +:101E00000AC030F00BC031F075EC25F02EC004F0A4 +:101E10002FC005F030C006F031C007F0CC0E336E95 +:101E2000BC0E346E8C0E356E3B0E366E04C02EF03A +:101E300005C02FF006C030F007C031F075EC25F07A +:101E400011EC26F02DC000F02EC001F02FC002F0E2 +:101E500030C003F000C0E6FF01C0E6FF02C0E6FFAD +:101E600003C0E6FF050EDBCF2FF0060EDBCF30F010 +:101E70005BEC24F02EC014F02FC015F030C016F02B +:101E800031C017F0A60E336E280E346E940E356EE8 +:101E90003F0E366E14C02EF015C02FF016C030F075 +:101EA00017C031F075EC25F02EC010F02FC011F0E6 +:101EB00030C012F031C013F0BD0E336E370E346EE9 +:101EC000860E356E410E366E10C02EF011C02FF00A +:101ED00012C030F013C031F075EC25F011EC26F093 +:101EE0002DC00CF02EC00DF02FC00EF030C00FF042 :101EF0000CC0E6FF0DC0E6FF0EC0E6FF0FC0E6FF18 :101F0000010EE66E71EC17F0186E0A0EE15E1850C5 :101F1000A9D0FF0E05010E03F350E66E070EDBCFCE -:101F20004BF0080EDBCF4CF027EC24F04AC008F051 -:101F30004BC009F04CC00AF04DC00BF0A60E4F6E1E -:101F4000280E506E940E516E3F0E526E08C04AF02D -:101F500009C04BF00AC04CF00BC04DF041EC25F02D -:101F60004AC004F04BC005F04CC006F04DC007F06D -:101F7000CC0E4F6EBC0E506E8C0E516E3B0E526EE0 -:101F800004C04AF005C04BF006C04CF007C04DF04D -:101F900041EC25F0DDEC25F049C000F04AC001F02D -:101FA0004BC002F04CC003F000C0E6FF01C0E6FFEA -:101FB00002C0E6FF03C0E6FF050EDBCF4BF0060EC6 -:101FC000DBCF4CF027EC24F04AC014F04BC015F0E6 -:101FD0004CC016F04DC017F0A60E4F6E280E506E76 -:101FE000940E516E3F0E526E14C04AF015C04BF065 -:101FF00016C04CF017C04DF041EC25F04AC010F06F -:102000004BC011F04CC012F04DC013F0BD0E4F6E1E -:10201000370E506E860E516E410E526E10C04AF051 -:1020200011C04BF012C04CF013C04DF041EC25F044 -:10203000DDEC25F049C00CF04AC00DF04BC00EF0AD -:102040004CC00FF00CC0E6FF0DC0E6FF0EC0E6FF6F +:101F20002FF0080EDBCF30F05BEC24F02EC008F071 +:101F30002FC009F030C00AF031C00BF0A60E336E8E +:101F4000280E346E940E356E3F0E366E08C02EF09D +:101F500009C02FF00AC030F00BC031F075EC25F04D +:101F60002EC004F02FC005F030C006F031C007F0DD +:101F7000CC0E336EBC0E346E8C0E356E3B0E366E50 +:101F800004C02EF005C02FF006C030F007C031F0BD +:101F900075EC25F011EC26F02DC000F02EC001F0FC +:101FA0002FC002F030C003F000C0E6FF01C0E6FF22 +:101FB00002C0E6FF03C0E6FF050EDBCF2FF0060EE2 +:101FC000DBCF30F05BEC24F02EC014F02FC015F006 +:101FD00030C016F031C017F0A60E336E280E346EE6 +:101FE000940E356E3F0E366E14C02EF015C02FF0D5 +:101FF00016C030F017C031F075EC25F02EC010F08F +:102000002FC011F030C012F031C013F0BD0E336E8E +:10201000370E346E860E356E410E366E10C02EF0C1 +:1020200011C02FF012C030F013C031F075EC25F064 +:1020300011EC26F02DC00CF02EC00DF02FC00EF0CC +:1020400030C00FF00CC0E6FF0DC0E6FF0EC0E6FF8B :102050000FC0E6FF09C5E6FF71EC17F0186E0A0E17 :10206000E15E18508AD1060E0AC5DBFF050E0BC5CE :10207000DBFF020E0501095D01E0B3D0FF0E050193 -:102080000C03F350E66E050EDBCF4BF0060EDBCFF4 -:102090004CF027EC24F04AC008F04BC009F04CC0CB -:1020A0000AF04DC00BF0A60E4F6E280E506E940E27 -:1020B000516E3F0E526E08C04AF009C04BF00AC084 -:1020C0004CF00BC04DF041EC25F04AC004F04BC081 -:1020D00005F04CC006F04DC007F0BD0E4F6E370E38 -:1020E000506E860E516E410E526E04C04AF005C00D -:1020F0004BF006C04CF007C04DF041EC25F0DDEC94 -:1021000025F049C000F04AC001F04BC002F04CC0BD +:102080000C03F350E66E050EDBCF2FF0060EDBCF10 +:1020900030F05BEC24F02EC008F02FC009F030C007 +:1020A0000AF031C00BF0A60E336E280E346E940E7B +:1020B000356E3F0E366E08C02EF009C02FF00AC0F4 +:1020C00030F00BC031F075EC25F02EC004F02FC0BD +:1020D00005F030C006F031C007F0BD0E336E370E8C +:1020E000346E860E356E410E366E04C02EF005C07D +:1020F0002FF006C030F007C031F075EC25F011EC80 +:1021000026F02DC000F02EC001F02FC002F030C02C :1021100003F000C0E6FF01C0E6FF02C0E6FF03C017 -:10212000E6FFE66AB9EC17F00C6E060EE15E0C50A5 -:102130000CC5E6FF050EDBCF4BF0060EDBCF4CF0F7 -:1021400027EC24F04AC008F04BC009F04CC00AF05C -:102150004DC00BF0A60E4F6E280E506E940E516EB1 -:102160003F0E526E08C04AF009C04BF00AC04CF056 -:102170000BC04DF041EC25F04AC004F04BC005F017 -:102180004CC006F04DC007F0BD0E4F6E370E506EBE -:10219000860E516E410E526E04C04AF005C04BF0DF -:1021A00006C04CF007C04DF041EC25F0DDEC25F009 -:1021B00049C000F04AC001F04BC002F04CC003F02F +:10212000E6FFE66AB5EC17F00C6E060EE15E0C50A9 +:102130000CC5E6FF050EDBCF2FF0060EDBCF30F02F +:102140005BEC24F02EC008F02FC009F030C00AF07C +:1021500031C00BF0A60E336E280E346E940E356E21 +:102160003F0E366E08C02EF009C02FF00AC030F0C6 +:102170000BC031F075EC25F02EC004F02FC005F037 +:1021800030C006F031C007F0BD0E336E370E346E2E +:10219000860E356E410E366E04C02EF005C02FF04F +:1021A00006C030F007C031F075EC25F011EC26F0D8 +:1021B0002DC000F02EC001F02FC002F030C003F09F :1021C00000C0E6FF01C0E6FF02C0E6FF03C0E6FF75 -:1021D000010EE66EB9EC17F00C6E060EE15E0C50C7 +:1021D000010EE66EB5EC17F00C6E060EE15E0C50CB :1021E0005BD0FF0E05010C03F350E66E050EDBCF4E -:1021F0004BF0060EDBCF4CF027EC24F04AC008F081 -:102200004BC009F04CC00AF04DC00BF0A60E4F6E4B -:10221000280E506E940E516E3F0E526E08C04AF05A -:1022200009C04BF00AC04CF00BC04DF041EC25F05A -:102230004AC004F04BC005F04CC006F04DC007F09A -:10224000BD0E4F6E370E506E860E516E410E526EA1 -:1022500004C04AF005C04BF006C04CF007C04DF07A -:1022600041EC25F0DDEC25F049C000F04AC001F05A -:102270004BC002F04CC003F000C0E6FF01C0E6FF17 -:1022800002C0E6FF03C0E6FF09C5E6FFB9EC17F0A0 -:102290000C6E060EE15E0C5070D009C5E6FFD7EC5F -:1022A00017F0E5520101010E526F67D0DAEC1AF017 -:1022B000050EF3CFDBFF060EF4CFDBFFF2EC1AF0D6 +:1021F0002FF0060EDBCF30F05BEC24F02EC008F0A1 +:102200002FC009F030C00AF031C00BF0A60E336EBB +:10221000280E346E940E356E3F0E366E08C02EF0CA +:1022200009C02FF00AC030F00BC031F075EC25F07A +:102230002EC004F02FC005F030C006F031C007F00A +:10224000BD0E336E370E346E860E356E410E366E11 +:1022500004C02EF005C02FF006C030F007C031F0EA +:1022600075EC25F011EC26F02DC000F02EC001F029 +:102270002FC002F030C003F000C0E6FF01C0E6FF4F +:1022800002C0E6FF03C0E6FF09C5E6FFB5EC17F0A4 +:102290000C6E060EE15E0C5070D009C5E6FFCDEC69 +:1022A00017F0E5520101010E526F67D0B3EC1AF03E +:1022B000050EF3CFDBFF060EF4CFDBFFCBEC1AF0FD :1022C000070EF3CFDBFF080EF4CFDBFF00C540F5B0 :1022D0000501416B0501030E426F0501436B060EBC :1022E000DBCF48F5050EDBCF49F5080EDBCF4AF50D :1022F000070EDBCF4BF5400EE66E400EE66E050E88 -:10230000E66E010EE66E010EE66ED2EC22F0006E75 +:10230000E66E010EE66E010EE66E06EC23F0006E40 :10231000050EE15E0050F3CF49F1F4CF4AF12DD024 :1023200000C540F50501416B0501030E426F050133 -:10233000436B0BEC1BF0000904E00501010E486F34 +:10233000436BE4EC1AF0000904E00501010E486F5C :1023400002D00501486B400EE66E400EE66E050EAB -:10235000E66E010EE66E010EE66ED2EC22F0006E25 +:10235000E66E010EE66E010EE66E06EC23F0006EF0 :10236000050EE15E0050F3CF49F1F4CF4AF105D0FC -:10237000010EE66ECAEC32F0E552400EE66E000E3B -:10238000E66E050EE66EE66A010EE66ED2EC22F00F +:10237000010EE66EFEEC32F0E552400EE66E000E07 +:10238000E66E050EE66EE66A010EE66E06EC23F0DA :10239000006E050EE15E0050F3CF47F1F4CF48F137 :1023A0009FD0010149514A1102E1000E08D049C1F4 :1023B000E9FF4AC1EAFFEF50800B01E0010E00097E :1023C0004DE10101010E516F0501406B01014C51BE :1023D0004C2B0501416F0501050E426F0501436B52 -:1023E0000501486B000E006E630E016E026A00C0AC +:1023E0000501486B680E006E630E016E026A00C044 :1023F000E6FF01C0E6FF02C0E6FF480EE66E050EEE -:10240000E66E08EC32F0036E050EE15E0350400EFE +:10240000E66E3CEC32F0036E050EE15E0350400ECA :10241000E66E400EE66E050EE66E010EE66E010EED -:10242000E66ED2EC22F0006E050EE15E0050F3CFB6 +:10242000E66E06EC23F0006E050EE15E0050F3CF81 :1024300049F1F4CF4AF1400EE66E000EE66E050E4D -:10244000E66EE66A010EE66ED2EC22F0006E050E34 +:10244000E66EE66A010EE66E06EC23F0006E050EFF :10245000E15E0050F3CF47F1F4CF48F141D00101E4 :1024600049514A1102E1000E08D049C1E9FF4AC1B1 :10247000EAFFEF50800B01E0010E000931E100C5D9 :1024800040F50501416B0501030E426F0501010E88 :10249000436F400EE66E400EE66E050EE66E010ED0 -:1024A000E66E010EE66ED2EC22F0006E050EE15EE5 +:1024A000E66E010EE66E06EC23F0006E050EE15EB0 :1024B0000050F3CF49F1F4CF4AF1400EE66E000E22 -:1024C000E66E050EE66EE66A010EE66ED2EC22F0CE +:1024C000E66E050EE66EE66A010EE66E06EC23F099 :1024D000006E050EE15E0050F3CF47F1F4CF48F1F6 :1024E0000F0EE15C02E2E16AE552E16EE552E7CFF0 :1024F000D9FF120001015351541104E1100E536F22 @@ -475,19 +475,19 @@ :102540008C861200100E005D06E1010153515411FA :102550000FE18C740AD0200E005D0AE10101535195 :10256000541106E18C748CA402D08C9612008C86D7 -:102570001200120012001200120071EF30F012006F -:102580001E0EE66E010EE66EA0EC22F0E552E5525C +:1025700012001200120012001200A5EF30F012003B +:102580001E0EE66E010EE66ED4EC22F0E552E55228 :10259000400EE66E000EE66E050EE66EE66A010E71 -:1025A000E66ED2EC22F0006E050EE15E0050F3CF35 +:1025A000E66E06EC23F0006E050EE15E0050F3CF00 :1025B00047F1F4CF48F112006D840101080E686FF5 :1025C000070E696F6807000E695B68516911FAE1CF :1025D0006D941200D9CFE6FFE1CFD9FFFD0EDBCF1E -:1025E0004BF0FE0EDBCF4CF0010E4B1801E14C50CE -:1025F00033E0E8684B1802E1E8684C182BE0030E62 -:102600004B1801E14C5024E0040E4B1801E14C50F2 -:102610001DE0020E4B1801E14C5016E0170E4B184E -:1026200001E14C500FE0160E4B1801E14C5008E050 -:10263000150E4B1801E14C5001E010D0A1DF0FD076 +:1025E0002FF0FE0EDBCF30F0010E2F1801E130503E +:1025F00033E0E8682F1802E1E86830182BE0030E9A +:102600002F1801E1305024E0040E2F1801E1305062 +:102610001DE0020E2F1801E1305016E0170E2F18A2 +:1026200001E130500FE0160E2F1801E1305008E0A4 +:10263000150E2F1801E1305001E010D0A1DF0FD0AE :102640009EDF0DD09ADF0BD096DF09D092DF07D046 :1026500091DF05D091DF03D0000001D000D0010E42 :1026600000D0E552E7CFD9FF12004BD8E652D0B2E6 @@ -497,14 +497,14 @@ :1026A000DF6ED088D086D084D082D080FC9EFC9C07 :1026B000DF50E552E552E7CFD9FF1200E65221D8AC :1026C000020EE126F350DF6E010EF4CFDBFF1200A5 -:1026D000C00EE66EE00EE66EAEEC32F0E552E5526C +:1026D000C00EE66EE00EE66EE2EC32F0E552E55238 :1026E0001200DF50F36E010EDB50F46E020EE15C5F -:1026F0001200DFCFE6FFE66A24EC32F0E552E55245 +:1026F0001200DFCFE6FFE66A58EC32F0E552E55211 :0C2700001200D9CFE6FFE1CFD9FF120094 -:04270C00D4EC1BF0FE +:04270C001BEC1CF0B6 :10271000FE0EDB5006E1F80E96163C0E94169598C8 :1027200008D0FE0EDB0405E1070E9612C30E9412CC -:102730009588D9EF1BF0D9CFE6FFE1CFD9FFE6525C +:10273000958820EF1CF0D9CFE6FFE1CFD9FFE65214 :10274000010EE66EE3DFE552809AFE0EDB5004E0F8 :10275000FE0EDB5002080FE1839C81880000839EFF :102760000000000000008450010BDF6E838E00002B @@ -590,970 +590,976 @@ :102C6000F3CF00F08250400B01E0010E800DF350D5 :102C70000010011002100310041005100610DF6E82 :102C8000838EDF5000D0E552E552E7CFD9FF120026 -:102C9000D4EC1BF0E652DF6A2BEC1CF0DF6EFD0E6D +:102C90001BEC1CF0E652DF6A58EC1CF0DF6EFD0EF8 :102CA000DB50DF14DF6EDF5002E0010E01D0000EBA -:102CB000E552D9EF1BF0D4EC1BF01D0E82EC1BF09B -:102CC000000EABEC1DF0D9EF1BF0D4EC1BF02BEC9D -:102CD0001CF084080DE02BEC1CF0C40809E0E66A47 -:102CE000B9EC1DF0ADEC1CF0FDEC32F0E552EFD785 -:102CF0001C0E82EC1BF00A0EABEC1DF0B1EC1CF0CC -:102D00002BEC1CF0800804E02BEC1CF0C008E7E181 -:102D10002BEC1CF0C00802E1B1EC1CF01E0E82ECA2 -:102D20001BF00F0EABEC1DF05DEC1EF0FA0EDBCFCE -:102D3000E6FFFB0E49EC1DF0F80EDBCFE6FFF90EC7 -:102D400049EC1DF0F60EDBCFE6FFF70E49EC1DF067 -:102D5000040E82EC1BF0D9EF1BF0D4EC1BF0080E34 -:102D6000E126010EACEC1BF0010EE7CFDBFF020EFB -:102D7000DEEC1DF0DF6E030EACEC1BF0030EE7CFB4 -:102D8000DBFF040EACEC1BF0020EE7CFDBFF050E01 -:102D9000ACEC1BF0050EE7CFDBFF060EACEC1BF036 -:102DA000040EE7CFDBFF070EACEC1BF0070EE7CFFE -:102DB000DBFF080EACEC1BF009EC1CF0E66AB6EC8D -:102DC0001CF0090EACEC1BF0010EE7CFDBFF0A0E86 -:102DD000DEEC1DF0DF6E0B0EACEC1BF0030EE7CF4C -:102DE000DBFF0C0EACEC1BF0020EE7CFDBFF0D0E91 -:102DF000ACEC1BF0050EE7CFDBFF0E0EACEC1BF0CE -:102E0000040EE7CFDBFF0F0EACEC1BF0070EE7CF95 -:102E1000DBFF100EACEC1BF009EC1CF0010EE66EB3 -:102E2000B6EC1CF0020EE66EE66EADEC1CF0E66A47 -:102E30008EEC1CF007E1020EE66E010EE66E8EECE3 +:102CB000E55220EF1CF01BEC1CF01D0EBDEC1BF0D0 +:102CC000000EE1EC1DF020EF1CF01BEC1CF058ECAA +:102CD0001CF084080DE058EC1CF0C40809E0E66A1A +:102CE000EFEC1DF0B0EC1CF031EC33F0E552EFD717 +:102CF0001C0EBDEC1BF00A0EE1EC1DF0B4EC1CF058 +:102D000058EC1CF0800804E058EC1CF0C008E7E127 +:102D100058EC1CF0C00802E1B4EC1CF01E0EBDEC37 +:102D20001BF00F0EE1EC1DF085EC1EF0FA0EDBCF70 +:102D3000E6FFFB0E5AEC1DF0F80EDBCFE6FFF90EB6 +:102D40005AEC1DF0F60EDBCFE6FFF70E5AEC1DF045 +:102D5000040EBDEC1BF020EF1CF01BEC1CF0080E69 +:102D6000E126010EEFEC1BF0010EE7CFDBFF020EB8 +:102D700000EC1EF0DF6E030EEFEC1BF0030EE7CF4E +:102D8000DBFF040EEFEC1BF0020EE7CFDBFF050EBE +:102D9000EFEC1BF0050EE7CFDBFF060EEFEC1BF0B0 +:102DA000040EE7CFDBFF070EEFEC1BF0070EE7CFBB +:102DB000DBFF080EEFEC1BF024EC1CF0E66AB9EC2C +:102DC0001CF0090EEFEC1BF0010EE7CFDBFF0A0E43 +:102DD00000EC1EF0DF6E0B0EEFEC1BF0030EE7CFE6 +:102DE000DBFF0C0EEFEC1BF0020EE7CFDBFF0D0E4E +:102DF000EFEC1BF0050EE7CFDBFF0E0EEFEC1BF048 +:102E0000040EE7CFDBFF0F0EEFEC1BF0070EE7CF52 +:102E1000DBFF100EEFEC1BF024EC1CF0010EE66E55 +:102E2000B9EC1CF0020EE66EE66EB0EC1CF0E66A41 +:102E30009EEC1CF007E1020EE66E010EE66E9EECC3 :102E40001CF002E0000E01D0010E006E080EE15CE5 -:102E500002E2E16AE552E16E0050D9EF1BF0D4ECDA -:102E60001BF00C0EB3EC1BF0D950F20FAFEC1DF0C1 +:102E500002E2E16AE552E16E005020EF1CF01BEC4B +:102E60001CF00C0EF2EC1BF0D950F20FE5EC1DF04B :102E7000080EEECFDBFF090EEECFDBFF0A0EEECF22 -:102E8000DBFF0B0EEECFDBFF1F0E82EC1BF094EC92 -:102E90001CF00A0EDBCF02F00B0EBDEC1CF010E0B4 -:102EA0002B0EABEC1DF00A0EDBCFE6FF0B0E49EC50 +:102E8000DBFF0B0EEECFDBFF1F0EBDEC1BF0A4EC47 +:102E90001CF00A0EDBCF02F00B0EC0EC1CF010E0B1 +:102EA0002B0EE1EC1DF00A0EDBCFE6FF0B0E5AEC09 :102EB0001DF0080EDBCFE6FF090EDBCFE6FF03D0E7 -:102EC0000B0EE66EE66A25EC1EF049EC1DF037ECC1 -:102ED0001EF00C0EE15C02E2E16AE552E16ED9EF10 -:102EE0001BF0D4EC1BF00A0EB3EC1BF0080EDB6AEF -:102EF000090EDB6A1F0E82EC1BF0F50EDBCF00F033 +:102EC0000B0EE66EE66A54EC1EF05AEC1DF05FEC59 +:102ED0001EF00C0EE15C02E2E16AE552E16E20EFC9 +:102EE0001CF01BEC1CF00A0EF2EC1BF0080EDB6A67 +:102EF000090EDB6A1F0EBDEC1BF0F50EDBCF00F0F8 :102F0000003407E2080EDB6A100EF36E090EF3CFF1 :102F1000DBFF040EDBCF00F0050EDBCF01F0060E69 -:102F2000DBCF02F0070EBDEC1CF00FE094EC1CF0C0 -:102F3000280E0012080E011200C0E6FF01C0E6FFD5 -:102F400025EC1EF0DBCFE6FF09D094EC1CF0080E58 -:102F50000012011200C0E6FF01C0E6FF7FDB37EC84 -:102F60001EF00A0EE15C02E2E16AE552E16ED9EF81 -:102F70001BF0D4EC1BF0F90EDBCFE6FFE66AE66A45 -:102F8000E66AE66AD950FA0FAFEC1DF0EECFE6FF25 -:102F9000EECFE6FFEECFE6FFEFCFE6FFB9EC1DF098 -:102FA000A0DF006E0A0EE15E0050D9EF1BF0D4ECFA -:102FB0001BF0FE0EDB5004E0FE0EDB5002080DE1BC -:102FC0007DEC1CF0F3CF61F1F4CF62F1E66AF5EC31 -:102FD0001DF0F3CF5FF1F4CF60F1FE0EDB0404E0EF -:102FE000FE0EDB5002080EE155EC1CF0F3CF65F14C -:102FF000F4CF66F1010EE66EF5EC1DF0F3CF63F150 -:10300000F4CF64F1010E7EDBD4D3CEDB1F0E7ADB6E -:103010005DEC1EF0010E76DBCCD356EC1EF0C3EC5B -:103020001DF075EC1CF071EC1DF022EC1CF0C1D30E -:1030300056EC1EF071EC1DF075EC1CF0C3EC1DF0AD -:1030400022EC1CF0B6D356EC1EF0F2EC1CF0F9ECBE -:103050001DF0E66A48EC1CF0F2EC1CF0F9EC1DF0F7 -:103060007AEF1DF056EC1EF0F2EC1CF02EDBE66A57 -:1030700048EC1CF0F2EC1CF028DB7AEF1DF094DB3E -:10308000200EE1264DEC1DF0FDEC1DF0C7EC1DF00F -:10309000ECDAF2DB41EC25F006EC1EF07EEC1EF0E3 -:1030A00013EC1EF075EC1DF05EEC1CF0DEDA9BEC10 -:1030B0001CF041EC25F053EC1DF085DB58EC24F0BE -:1030C0002BDB4F6A506A800E516E6AEC1EF01C0EAC -:1030D0004AC0DBFF1D0E4BC0DBFF1E0E4CC0DBFFEA -:1030E0001F0E4DC0DBFF4DEC1DF016DB38DB75EC21 -:1030F0001DF066DBE3EC1DF0086E080EE15E085083 -:10310000080E49C0DBFF090E4AC0DBFF0A0E4BC0A8 -:10311000DBFF0B0E4CC0DBFFC2DBF60EDB5007E023 -:10312000D950F40FAFEC1DF0EE50ED1059E13CEC2E -:103130001DF0026A036AB40E046E420E056E080E9C -:10314000DBCF0EF0090EDBCF0FF00A0EDBCF10F055 -:103150000B0EDBCF11F0CDEC1DF00EC04AF00FC00E -:103160004BF010C04CF011C04DF041EC25F04AC0BE -:103170000AF04BC00BF04CC00CF04DC00DF083ECCE -:103180001DF0E2DB72DA02C04AF0C4EC1CF057EC2E -:1031900024F056EC1DF057DF126E060EE15E125061 -:1031A00047DA3CEC1DF069EC1DF0CEDBD8DAB3EC6D -:1031B00029F0E552E552E552E55249C002F04AC015 -:1031C00003F04BC004F04CC005F049C04AF0DCDB12 -:1031D00056EC1DF022DF0A6E060EE15E0A50E3D1C6 -:1031E0001C0EDBCF04F01D0EDBCF05F01E0EDBCF77 -:1031F00006F01F0EDBCF07F00C6A0D6A0E6A400E58 -:103200000F6EE6EC1DF00FEC1EF053EC1DF00CC041 -:103210004AF00DC04BF00EC04CF00FC04DF041EC29 -:1032200025F0FDEC1DF047EC1EF0E6EC1DF046DB52 -:103230005FDB13EC1EF08BEC1DF057EC24F0140E4A -:103240004AC0DBFF150E4BC0DBFF160E4CC0DBFF88 -:10325000170E4DC0DBFF140EDBCF00F0150EDBCFD9 -:1032600001F0160EDBCF02F0170EDBCF03F0E6EC19 -:103270001DF0A6DA8BEC1DF058EC24F0180E4AC0B5 -:10328000DBFF190E4BC0DBFF1A0E4CC0DBFF1B0E21 -:103290004DC0DBFFC7EC1DF02BDBFDEC1DF0140E69 -:1032A000DBCF18F0150EDBCF19F0160EDBCF1AF0BE -:1032B000170EDBCF1BF07EEC1EF090EC1DF0D5D985 -:1032C00018C04AF019C04BF01AC04CF01BC04DF0AA -:1032D00041EC25F013EC1EF069EC1DF091DAC5D934 -:1032E0002ADBEEEC24F0DFDBC7DA58EC24F006EC46 -:1032F0001EF035DA7EEC1EF04AC02CF04BC02DF0EB -:103300004CC02EF04DC02FF0F3DA4AC028F04BC06D -:1033100029F04CC02AF04DC02BF0140EDBCF38F052 -:10332000150EDBCF39F0160EDBCF3AF0170EDBCFE0 -:103330003BF0B3DB4AC03CF04BC03DF04CC03EF02C -:103340004DC03FF092D938C04AF039C04BF03AC076 -:103350004CF03BC04DF041EC25F04AC034F04BC07E -:1033600035F04CC036F04DC037F0B3DB4AC040F00A -:103370004BC041F04CC042F04DC043F076D934C050 -:103380004AF035C04BF036C04CF037C04DF0EEEC93 -:1033900024F04AC030F04BC031F04CC032F04DC088 -:1033A00033F063D928C04AF029C04BF02AC04CF052 -:1033B0002BC04DF057EC24F01ADAE3EC1DF0446E0C -:1033C000080EE15E44503EEC1EF0E5DA49C04AF0DA -:1033D0005CDA7EDA140EDBCF4AF0150EDBCF4BF051 -:1033E000160EDBCF4CF0170EDBCF4DF039DA06ECC2 -:1033F0001EF01C0EDBCF4AF01D0EDBCF4BF01E0E75 -:10340000DBCF4CF01F0EDBCF4DF070D9F6DB2DD9A2 -:10341000DAD957EC24F080D9A2D94A6A4B6A4C6AAF -:10342000400E4D6E1DDA62D984DBCDDB106E080EC6 -:10343000E15E1050100E49C0DBFF110E4AC0DBFFE9 -:10344000120E4BC0DBFF130E4CC0DBFF100EDBCFA8 -:1034500004F0110EDBCF05F0120EDBCF06F0130ED9 -:10346000DBCF07F04F6A506A516A526AACD914EC4C -:1034700026F0010A0DE0100EDBCF00F0110EDBCFBD -:1034800001F0120EDBCF02F0130EDBCF03F011D0F0 -:10349000100EDBCF08F0110EDBCF09F0120EDBCFE0 -:1034A0000AF0130EDBCF0BF076DAE6D941EC25F00B -:1034B00033D9100E00C0DBFF110E01C0DBFF120E6E -:1034C00002C0DBFF130E03C0DBFFF60EDB50020869 -:1034D00016E1D4D857EC24F019D958EC24F07CD953 -:1034E000060E4BC0DBFF070E4CC0DBFF74DB68D958 -:1034F00077DBA1DA040E4BC0DBFF050E3DD04A6A34 -:103500004B6A4C6A400E4D6E080EDBCF4FF0090E31 -:10351000DBCF50F00A0EDBCF51F00B0ECADBFCD82C -:103520000C0EDBCF04F00D0EDBCF05F00E0EDBCF63 -:1035300006F00F0EDBCF07F004C04FF005C050F0CF -:1035400006C051F007C052F057EC24F0C1D996D80C -:1035500058EC24F0DBD857EC24F03ED9040E4BC0D5 -:10356000DBFF050E4CC0DBFF3BDB2AD934DB63DA23 -:10357000060E4BC0DBFF070E4CC0DBFF59D89FD8AF -:10358000040EDBCF4BF0050E14DA25DB0DDB9DD8E6 -:10359000ACD995D8060EDBCF4BF0070E0ADA20DB4C -:1035A00003DB27DB4FD9200EE15C02E2E16AE55242 -:1035B000E16EFFD0F9D8040EE1269FD9F3D9E66A6F -:1035C000A3D901015F51EE5C066E6051EE58076EA3 -:1035D0006151EE58086E6251A8D802E2E16AE552E4 -:1035E000E16EE7D0E1D8040EE1265FD9DBD9010E08 -:1035F000E66E8AD901016351EE5C066E6451EE58A5 -:10360000076E6551EE58086E66518FD802E2E16A86 -:10361000E552E16ECED0040EE66EE66A7FD906E092 -:10362000040EE66E010EE66E79D901E1000C010C84 -:10363000F2DF0009FDE0120051DBEBD956DAB9D90F -:103640004DEF1DF06DDAF8DA4EDB49C018F04AC0D4 -:1036500019F04BC01AF04CC01BF012008ADA55EC7E -:1036600014F0E552E552E55212004AC04FF04BC04B -:1036700050F04CC051F04DC052F01200FDD90C0E6C -:10368000DBCF06F00D0EDBCF07F00E0EDBCF08F020 -:103690000F0EDBCF09F081DA06C04AF007C04BF00D -:1036A00008C04CF009C04DF041EC25F04BDA2BDAA4 -:1036B000FDD9C9DC0A6E060EE15E0A50C7D1F70ECD -:1036C000DBCF4BF0F80E09EF1DF0000E186C191E41 -:1036D00019221A1E1A221B1E1B2218C0E6FF19C02F -:1036E000E6FF1AC0E6FF1BC0E6FF12001C0EDBCF90 -:1036F0004FF01D0EDBCF50F01E0EDBCF51F01F0E32 -:1037000059EF1EF0E66E35DAB4EF1DF0D5D94BC097 -:10371000DEFF4CC0DDFF9AD14AC000F04BC001F083 -:103720004CC002F04DC003F01200EE58096E06C006 -:1037300049F007C04AF008C04BF04C6E3EEC24F054 -:1037400001DA7ADAEEEC24F0BEDA4BC0F3FF4CC0BB -:10375000F4FF040EE15C120031DAE76E1200C7DA02 -:103760004DC0E6FF1200E126D9CFE9FFDACFEAFF... [truncated message content] |
From: Jérémie D. <Ba...@us...> - 2010-02-20 23:07:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "krobot". The branch, master has been updated via 88a46a02c10984a60294ece535b3fcbad4e2fe89 (commit) from 77d57ce86871b5b3a5a8f9557efd383a9ebc9def (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 88a46a02c10984a60294ece535b3fcbad4e2fe89 Author: Olivier BICHLER <oli...@en...> Date: Sun Feb 21 00:06:51 2010 +0100 [commands] fix left/right ----------------------------------------------------------------------- Changes: diff --git a/PC_Mainboard/driver/commands.ml b/PC_Mainboard/driver/commands.ml index e29aaf6..71db61c 100644 --- a/PC_Mainboard/driver/commands.ml +++ b/PC_Mainboard/driver/commands.ml @@ -233,9 +233,9 @@ struct let turn card ~angle ~speed ~acc = if angle < 0 then - backend Protocol.traj_tl card (-angle) speed acc + backend Protocol.traj_tr card (-angle) speed acc else - backend Protocol.traj_tr card angle speed acc + backend Protocol.traj_tl card angle speed acc let goto card ~x ~y ~speed ~acc ~mode ~bypass_dist = let data = Card.make_buffer () in hooks/post-receive -- krobot |