From: Pierre C. <Ba...@us...> - 2012-04-21 22:11:22
|
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 87263167c3172b765e0232d7e424ded68d057c95 (commit) via cacf9f3521bc38807280c350216b64dcabdbe595 (commit) from 2fc328b74df14a0b11be0c3964e5afa7b8ae0a06 (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 87263167c3172b765e0232d7e424ded68d057c95 Author: chicco <cha...@cr...> Date: Sun Apr 22 00:10:55 2012 +0200 [info] add protocol definition commit cacf9f3521bc38807280c350216b64dcabdbe595 Author: chicco <cha...@cr...> Date: Sun Apr 22 00:04:36 2012 +0200 [info] * can_viewer: stuffs * can: add packet motor_bezier_limits * viewer: add box to control the speed ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/_tags b/info/control2011/_tags index 79de459..7a89fb3 100644 --- a/info/control2011/_tags +++ b/info/control2011/_tags @@ -1,8 +1,8 @@ -<**/*.ml>: syntax_camlp4o +<**/*.ml{,i}>: syntax_camlp4o <src/interfaces/*.ml>: -syntax_camlp4o # OASIS_START -# DO NOT EDIT (digest: 4e49eb45e4c273e67ec75220ea03b734) +# DO NOT EDIT (digest: fb711b43f944541635b3a5ea56a5681e) # Ignore VCS directories, you can use the same kind of rule outside # OASIS_START/STOP if you want to exclude directories that contains # useless stuff for the build process @@ -29,19 +29,43 @@ "src/can": include <src/can/krobot-can.{cma,cmxa}>: use_libkrobot-can <src/can/*.ml{,i}>: use_krobot +<src/can/*.ml{,i}>: pkg_sexplib.syntax +<src/can/*.ml{,i}>: pkg_sexplib <src/can/*.ml{,i}>: pkg_lwt.unix <src/can/*.ml{,i}>: pkg_lwt.syntax <src/can/*.ml{,i}>: pkg_lwt.react +<src/can/*.ml{,i}>: pkg_bitstring "src/can/can_stubs.c": use_krobot +"src/can/can_stubs.c": pkg_sexplib.syntax +"src/can/can_stubs.c": pkg_sexplib "src/can/can_stubs.c": pkg_lwt.unix "src/can/can_stubs.c": pkg_lwt.syntax "src/can/can_stubs.c": pkg_lwt.react +"src/can/can_stubs.c": pkg_bitstring # Executable dump-can <examples/dump_can.{native,byte}>: use_krobot-can <examples/dump_can.{native,byte}>: use_krobot +<examples/dump_can.{native,byte}>: pkg_sexplib.syntax +<examples/dump_can.{native,byte}>: pkg_sexplib <examples/dump_can.{native,byte}>: pkg_lwt.unix <examples/dump_can.{native,byte}>: pkg_lwt.syntax <examples/dump_can.{native,byte}>: pkg_lwt.react +<examples/dump_can.{native,byte}>: pkg_bitstring +# Executable krobot-can-display +<src/tools/krobot_can_display.{native,byte}>: use_krobot-can +<src/tools/krobot_can_display.{native,byte}>: use_krobot +<src/tools/krobot_can_display.{native,byte}>: pkg_sexplib.syntax +<src/tools/krobot_can_display.{native,byte}>: pkg_sexplib +<src/tools/krobot_can_display.{native,byte}>: pkg_lwt.unix +<src/tools/krobot_can_display.{native,byte}>: pkg_lwt.syntax +<src/tools/krobot_can_display.{native,byte}>: pkg_lwt.react +<src/tools/krobot_can_display.{native,byte}>: pkg_lwt.glib +<src/tools/krobot_can_display.{native,byte}>: pkg_cairo.lablgtk2 +<src/tools/krobot_can_display.{native,byte}>: pkg_bitstring +<src/tools/*.ml{,i}>: use_krobot-can +<src/tools/*.ml{,i}>: pkg_sexplib.syntax +<src/tools/*.ml{,i}>: pkg_sexplib +<src/tools/*.ml{,i}>: pkg_bitstring # Executable krobot-calibrate-sharps <src/tools/krobot_calibrate_sharps.{native,byte}>: use_krobot <src/tools/krobot_calibrate_sharps.{native,byte}>: pkg_lwt.unix @@ -92,14 +116,20 @@ # Executable send-can <examples/send_can.{native,byte}>: use_krobot-can <examples/send_can.{native,byte}>: use_krobot +<examples/send_can.{native,byte}>: pkg_sexplib.syntax +<examples/send_can.{native,byte}>: pkg_sexplib <examples/send_can.{native,byte}>: pkg_lwt.unix <examples/send_can.{native,byte}>: pkg_lwt.syntax <examples/send_can.{native,byte}>: pkg_lwt.react +<examples/send_can.{native,byte}>: pkg_bitstring <examples/*.ml{,i}>: use_krobot-can <examples/*.ml{,i}>: use_krobot +<examples/*.ml{,i}>: pkg_sexplib.syntax +<examples/*.ml{,i}>: pkg_sexplib <examples/*.ml{,i}>: pkg_lwt.unix <examples/*.ml{,i}>: pkg_lwt.syntax <examples/*.ml{,i}>: pkg_lwt.react +<examples/*.ml{,i}>: pkg_bitstring # Executable krobot-vm <src/tools/krobot_vm.{native,byte}>: use_krobot <src/tools/krobot_vm.{native,byte}>: pkg_lwt.unix @@ -163,12 +193,18 @@ # Executable krobot-driver <src/driver/krobot_driver.{native,byte}>: use_krobot-can <src/driver/krobot_driver.{native,byte}>: use_krobot +<src/driver/krobot_driver.{native,byte}>: pkg_sexplib.syntax +<src/driver/krobot_driver.{native,byte}>: pkg_sexplib <src/driver/krobot_driver.{native,byte}>: pkg_lwt.unix <src/driver/krobot_driver.{native,byte}>: pkg_lwt.syntax <src/driver/krobot_driver.{native,byte}>: pkg_lwt.react +<src/driver/krobot_driver.{native,byte}>: pkg_bitstring <src/driver/*.ml{,i}>: use_krobot-can <src/driver/*.ml{,i}>: use_krobot +<src/driver/*.ml{,i}>: pkg_sexplib.syntax +<src/driver/*.ml{,i}>: pkg_sexplib <src/driver/*.ml{,i}>: pkg_lwt.unix <src/driver/*.ml{,i}>: pkg_lwt.syntax <src/driver/*.ml{,i}>: pkg_lwt.react +<src/driver/*.ml{,i}>: pkg_bitstring # OASIS_STOP diff --git a/info/control2011/krobot-api.odocl b/info/control2011/krobot-api.odocl index e19a38b..09b1b3d 100644 --- a/info/control2011/krobot-api.odocl +++ b/info/control2011/krobot-api.odocl @@ -1,5 +1,5 @@ # OASIS_START -# DO NOT EDIT (digest: 7edbd90b2355975a6b906edaa0a69b3e) +# DO NOT EDIT (digest: d7dcb726ba6a88520ef6021e2c4dec89) src/lib/Krobot_can src/lib/Krobot_bus src/lib/Krobot_message @@ -10,4 +10,7 @@ src/lib/Krobot_config src/lib/Krobot_path src/lib/Krobot_action src/can/Krobot_can_bus +src/can/Krobot_can_decoder +src/can/Krobot_can_desc_lexer +src/can/Krobot_can_desc_parser # OASIS_STOP diff --git a/info/control2011/myocamlbuild.ml b/info/control2011/myocamlbuild.ml index 5fd4717..2cfed59 100644 --- a/info/control2011/myocamlbuild.ml +++ b/info/control2011/myocamlbuild.ml @@ -1,7 +1,7 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: d2e269dc4718223067ec6884e511c44b) *) +(* DO NOT EDIT (digest: 4d333a06e10a6d542b31a757ed455f80) *) module OASISGettext = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISGettext.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISGettext.ml" let ns_ str = str @@ -24,7 +24,7 @@ module OASISGettext = struct end module OASISExpr = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISExpr.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISExpr.ml" @@ -115,7 +115,7 @@ end module BaseEnvLight = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseEnvLight.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseEnvLight.ml" module MapString = Map.Make(String) @@ -212,7 +212,7 @@ end module MyOCamlbuildFindlib = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" +# 21 "/media/data/ocaml/oasis/src/plugins/ocamlbuild/MyOCamlbuildFindlib.ml" (** OCamlbuild extension, copied from * http://brion.inria.fr/gallium/index.php/Using_ocamlfind_with_ocamlbuild @@ -321,7 +321,7 @@ module MyOCamlbuildFindlib = struct end module MyOCamlbuildBase = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" +# 21 "/media/data/ocaml/oasis/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" (** Base functions for writing myocamlbuild.ml @author Sylvain Le Gall @@ -336,7 +336,7 @@ module MyOCamlbuildBase = struct type name = string type tag = string -# 55 "/home/dim/sources/oasis-0.2.1~alpha1/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" +# 55 "/media/data/ocaml/oasis/src/plugins/ocamlbuild/MyOCamlbuildBase.ml" type t = { @@ -461,6 +461,7 @@ let package_default = let dispatch_default = MyOCamlbuildBase.dispatch_default package_default;; +# 465 "myocamlbuild.ml" (* OASIS_STOP *) open Ocamlbuild_plugin diff --git a/info/control2011/protocol/krobot_can_config.cfg b/info/control2011/protocol/krobot_can_config.cfg new file mode 100644 index 0000000..bc2908c --- /dev/null +++ b/info/control2011/protocol/krobot_can_config.cfg @@ -0,0 +1,35 @@ +odometry { x "x" "min" min value "max" max ; y "y" value; thetha "thetha" value } +ghost { + x value; + y value; + theta value; + u value; + state value; +} +adc_values_1 { val1 value; val2 value; val3 value; val4 value; } +adc_values_2 { val1 value; val2 value; val3 value; val4 value; } +status { is_moving value } +switch_status_1 { + sw1 value; sw2 value; sw3 value; sw4 value; + sw5 value; sw6 value; sw7 value; sw8 value; +} +switch_status_2 { + sw1 value; sw2 value; sw3 value; sw4 value; + sw5 value; sw6 value; sw7 value; sw8 value; +} + +motor3 { + position value; + speed value; +} + +motor4 { + position value; + speed value; +} + +bezier_limits { + v_max value; + a_tan_max value; + a_rad_max value; +} diff --git a/info/control2011/protocol/krobot_can_messages.kmd b/info/control2011/protocol/krobot_can_messages.kmd new file mode 100644 index 0000000..fba51cb --- /dev/null +++ b/info/control2011/protocol/krobot_can_messages.kmd @@ -0,0 +1,170 @@ +encoders34 100 { + encoder1_pos int unsigned 16; + encoder2_pos int unsigned 16; + encoder1_dir int unsigned 8; + encoder2_dir int unsigned 8; +} + +motor3 101 { + position float; + speed float; +} + +motor4 102 { + position float; + speed float; +} + +status 103 { + is_moving int unsigned 8; +} + +odometry 104 { + x int signed 16 "in mm"; + y int signed 16 "in mm"; + theta int signed 16 "in 1/10000 radians"; +} + +ghost 105 { + x int signed 16 "in mm"; + y int signed 16 "in mm"; + theta int signed 16 "in 1/10000 radians"; + u int unsigned 8 "proportion of the spline between 0 and 255"; + state int unsigned 8 "1 if trajectory in progress, else 0"; +} + +move 201 { + distance int signed 32 "in mm"; + speed int unsigned 16 "in mm/s"; + acceleration int unsigned 16 "in mm/s^2"; +} + +turn 202 { + angle int signed 32 "in 1/10000 radians"; + speed int unsigned 16 "in 1/1000 rad/s"; + acceleration int unsigned 16 "in 1/1000 rad/s^2" +} + +odometry_set 203 { + x int signed 16 "in mm"; + y int signed 16 "in mm"; + theta int signed 16 "in 1/10000 radians"; +} + +stop 204 { + lin_acc float; + rot_acc float; +} + +controller_mode 205 { + mode int unsigned 8; +} + +bezier_add 206 { + x_end int unsigned 12 "in mm"; + y_end int unsigned 12 "in mm"; + d1 int signed 9 "in cm"; + d2 int unsigned 10 "in cm"; + theta_end int signed 12 "in 1/100 rad"; + v_end int unsigned 1; +} + +bezier_limits 207 { + v_max int unsigned 16 "in mm"; + a_tan_max int unsigned 16 "in mm/s^2"; + a_rad_max int unsigned 16 "in mm/s^2"; +} + +beacon_position 301 { + angle int unsigned 16 "in 1/10000 radians"; + distance int unsigned 16 "in mm"; + period int unsigned 16 "in 1/10000 s"; +} + +beacon_lowlevel_position 302 { + angle int unsigned 16 "in 1/10000 radians"; + width int unsigned 16 "in 1/100000 radians"; + period int unsigned 32 "in timer ticks"; +} + +breacon_calibration 303 { + width int unsigned 16 "in 1/100000 rad"; + distance int unsigned 16 "in mm"; +} + +switch_status_1 311 { + sw1 int unsigned 8; + sw2 int unsigned 8; + sw3 int unsigned 8; + sw4 int unsigned 8; + sw5 int unsigned 8; + sw6 int unsigned 8; + sw7 int unsigned 8; + sw8 int unsigned 8; +} + +switch_status_2 312 { + sw1 int unsigned 8; + sw2 int unsigned 8; + sw3 int unsigned 8; + sw4 int unsigned 8; + sw5 int unsigned 8; + sw6 int unsigned 8; + sw7 int unsigned 8; + sw8 int unsigned 8; +} + +switch_set 313 { + num int unsigned 8; + state int unsigned 8; +} + +adc_values_1 321 { + val1 int unsigned 16; + val2 int unsigned 16; + val3 int unsigned 16; + val4 int unsigned 16; +} + +adc_values_2 322 { + val1 int unsigned 16; + val2 int unsigned 16; + val3 int unsigned 16; + val4 int unsigned 16; +} + +battery_status_1 331 { + elem1 int unsigned 16 "in 1/10000 V"; + elem2 int unsigned 16 "in 1/10000 V"; + elem3 int unsigned 16 "in 1/10000 V"; + elem4 int unsigned 16 "in 1/10000 V"; +} + +battery_status_2 332 { + elem1 int unsigned 16 "in 1/10000 V"; + elem2 int unsigned 16 "in 1/10000 V"; + elem3 int unsigned 16 "in 1/10000 V"; + elem4 int unsigned 16 "in 1/10000 V"; +} + +ax12_state 341 { + address int unsigned 8; + position int unsigned 16; + speed int unsigned 16; + torque int unsigned 16; +} + +ax12_request_state 342 { + address int unsigned 8; +} + +ax12_goto 343 { + address int unsigned 8; + position int unsigned 16; + speed int unsigned 16; +} + +ax12_set_torque_enable 345 { + address int unsigned 8; + enable int unsigned 8; +} diff --git a/info/control2011/setup.ml b/info/control2011/setup.ml index 4f9b978..8a23328 100644 --- a/info/control2011/setup.ml +++ b/info/control2011/setup.ml @@ -1,14 +1,14 @@ (* setup.ml generated for the first time by OASIS v0.2.0~alpha1 *) (* OASIS_START *) -(* DO NOT EDIT (digest: 2fa81b2af9e6c805314db247864ab4e1) *) +(* DO NOT EDIT (digest: 300912e61b966bc3109c698735347ca1) *) (* Regenerated by OASIS v0.2.1~alpha1 Visit http://oasis.forge.ocamlcore.org for more information and documentation about functions used in this file. *) module OASISGettext = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISGettext.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISGettext.ml" let ns_ str = str @@ -31,7 +31,7 @@ module OASISGettext = struct end module OASISContext = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISContext.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISContext.ml" open OASISGettext @@ -43,10 +43,11 @@ module OASISContext = struct type t = { - verbose: bool; - debug: bool; - ignore_plugins: bool; - printf: level -> string -> unit; + verbose: bool; + debug: bool; + ignore_plugins: bool; + ignore_unknown_fields: bool; + printf: level -> string -> unit; } let printf lvl str = @@ -62,10 +63,11 @@ module OASISContext = struct let default = ref { - verbose = true; - debug = false; - ignore_plugins = false; - printf = printf; + verbose = true; + debug = false; + ignore_plugins = false; + ignore_unknown_fields = false; + printf = printf; } let quiet = @@ -86,7 +88,7 @@ module OASISContext = struct end module OASISUtils = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISUtils.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISUtils.ml" module MapString = Map.Make(String) @@ -225,7 +227,7 @@ module OASISUtils = struct end module PropList = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/PropList.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/PropList.ml" open OASISGettext @@ -260,7 +262,7 @@ module PropList = struct let clear t = Hashtbl.clear t -# 66 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/PropList.ml" +# 66 "/media/data/ocaml/oasis/src/oasis/PropList.ml" end module Schema = @@ -501,7 +503,7 @@ module PropList = struct end module OASISMessage = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISMessage.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISMessage.ml" open OASISGettext @@ -550,7 +552,7 @@ module OASISMessage = struct end module OASISVersion = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISVersion.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISVersion.ml" open OASISGettext @@ -738,7 +740,7 @@ module OASISVersion = struct end module OASISLicense = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISLicense.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISLicense.ml" (** License for _oasis fields @author Sylvain Le Gall @@ -771,7 +773,7 @@ module OASISLicense = struct end module OASISExpr = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISExpr.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISExpr.ml" @@ -861,7 +863,7 @@ module OASISExpr = struct end module OASISTypes = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISTypes.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISTypes.ml" @@ -938,7 +940,7 @@ module OASISTypes = struct type plugin_data = (all_plugin * plugin_data_purpose * (unit -> unit)) list -# 102 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISTypes.ml" +# 102 "/media/data/ocaml/oasis/src/oasis/OASISTypes.ml" type 'a conditional = 'a OASISExpr.choices @@ -1095,7 +1097,7 @@ module OASISTypes = struct end module OASISUnixPath = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISUnixPath.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISUnixPath.ml" type unix_filename = string type unix_dirname = string @@ -1174,7 +1176,7 @@ module OASISUnixPath = struct end module OASISSection = struct -# 1 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISSection.ml" +# 1 "/media/data/ocaml/oasis/src/oasis/OASISSection.ml" open OASISTypes let section_kind_common = @@ -1228,12 +1230,12 @@ module OASISSection = struct end module OASISBuildSection = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISBuildSection.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISBuildSection.ml" end module OASISExecutable = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISExecutable.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISExecutable.ml" open OASISTypes @@ -1264,7 +1266,7 @@ module OASISExecutable = struct end module OASISLibrary = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISLibrary.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISLibrary.ml" open OASISTypes open OASISUtils @@ -1555,33 +1557,33 @@ module OASISLibrary = struct end module OASISFlag = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISFlag.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISFlag.ml" end module OASISPackage = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISPackage.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISPackage.ml" end module OASISSourceRepository = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISSourceRepository.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISSourceRepository.ml" end module OASISTest = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISTest.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISTest.ml" end module OASISDocument = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/oasis/OASISDocument.ml" +# 21 "/media/data/ocaml/oasis/src/oasis/OASISDocument.ml" end module BaseEnvLight = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseEnvLight.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseEnvLight.ml" module MapString = Map.Make(String) @@ -1678,7 +1680,7 @@ end module BaseContext = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseContext.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseContext.ml" open OASISContext @@ -1689,7 +1691,7 @@ module BaseContext = struct end module BaseMessage = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseMessage.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseMessage.ml" (** Message to user, overrid for Base @author Sylvain Le Gall @@ -1710,7 +1712,7 @@ module BaseMessage = struct end module BaseFilePath = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseFilePath.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseFilePath.ml" open Filename @@ -1742,7 +1744,7 @@ module BaseFilePath = struct end module BaseEnv = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseEnv.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseEnv.ml" open OASISGettext open OASISUtils @@ -2197,7 +2199,7 @@ module BaseEnv = struct end module BaseExec = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseExec.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseExec.ml" open OASISGettext open OASISUtils @@ -2257,7 +2259,7 @@ module BaseExec = struct end module BaseFileUtil = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseFileUtil.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseFileUtil.ml" open OASISGettext @@ -2435,7 +2437,7 @@ module BaseFileUtil = struct end module BaseArgExt = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseArgExt.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseArgExt.ml" open OASISUtils open OASISGettext @@ -2463,7 +2465,7 @@ module BaseArgExt = struct end module BaseCheck = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseCheck.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseCheck.ml" open BaseEnv open BaseMessage @@ -2589,7 +2591,7 @@ module BaseCheck = struct end module BaseOCamlcConfig = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseOCamlcConfig.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseOCamlcConfig.ml" open BaseEnv @@ -2699,7 +2701,7 @@ module BaseOCamlcConfig = struct end module BaseStandardVar = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseStandardVar.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseStandardVar.ml" open OASISGettext @@ -2958,7 +2960,7 @@ module BaseStandardVar = struct end module BaseFileAB = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseFileAB.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseFileAB.ml" open BaseEnv open OASISGettext @@ -3006,7 +3008,7 @@ module BaseFileAB = struct end module BaseLog = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseLog.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseLog.ml" open OASISUtils @@ -3125,7 +3127,7 @@ module BaseLog = struct end module BaseBuilt = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseBuilt.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseBuilt.ml" open OASISTypes open OASISGettext @@ -3272,7 +3274,7 @@ module BaseBuilt = struct end module BaseCustom = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseCustom.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseCustom.ml" open BaseEnv open BaseMessage @@ -3322,7 +3324,7 @@ module BaseCustom = struct end module BaseDynVar = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseDynVar.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseDynVar.ml" open OASISTypes @@ -3366,7 +3368,7 @@ module BaseDynVar = struct end module BaseTest = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseTest.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseTest.ml" open BaseEnv open BaseMessage @@ -3448,7 +3450,7 @@ module BaseTest = struct end module BaseDoc = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseDoc.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseDoc.ml" open BaseEnv open BaseMessage @@ -3478,7 +3480,7 @@ module BaseDoc = struct end module BaseSetup = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseSetup.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseSetup.ml" open BaseEnv open BaseMessage @@ -3896,7 +3898,7 @@ module BaseSetup = struct end module BaseDev = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/base/BaseDev.ml" +# 21 "/media/data/ocaml/oasis/src/base/BaseDev.ml" @@ -3954,7 +3956,7 @@ end module InternalConfigurePlugin = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/plugins/internal/InternalConfigurePlugin.ml" +# 21 "/media/data/ocaml/oasis/src/plugins/internal/InternalConfigurePlugin.ml" (** Configure using internal scheme @author Sylvain Le Gall @@ -4170,7 +4172,7 @@ module InternalConfigurePlugin = struct end module InternalInstallPlugin = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/plugins/internal/InternalInstallPlugin.ml" +# 21 "/media/data/ocaml/oasis/src/plugins/internal/InternalInstallPlugin.ml" (** Install using internal scheme @author Sylvain Le Gall @@ -4574,7 +4576,7 @@ end module OCamlbuildCommon = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/plugins/ocamlbuild/OCamlbuildCommon.ml" +# 21 "/media/data/ocaml/oasis/src/plugins/ocamlbuild/OCamlbuildCommon.ml" (** Functions common to OCamlbuild build and doc plugin *) @@ -4674,7 +4676,7 @@ module OCamlbuildCommon = struct end module OCamlbuildPlugin = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/plugins/ocamlbuild/OCamlbuildPlugin.ml" +# 21 "/media/data/ocaml/oasis/src/plugins/ocamlbuild/OCamlbuildPlugin.ml" (** Build using ocamlbuild @author Sylvain Le Gall @@ -4846,7 +4848,7 @@ module OCamlbuildPlugin = struct end module OCamlbuildDocPlugin = struct -# 21 "/home/dim/sources/oasis-0.2.1~alpha1/src/plugins/ocamlbuild/OCamlbuildDocPlugin.ml" +# 21 "/media/data/ocaml/oasis/src/plugins/ocamlbuild/OCamlbuildDocPlugin.ml" (* Create documentation using ocamlbuild .odocl files @author Sylvain Le Gall @@ -5029,7 +5031,10 @@ let setup_t = bs_build_depends = [ InternalLibrary "krobot"; - FindlibPackage ("lwt.syntax", None) + FindlibPackage ("lwt.syntax", None); + FindlibPackage ("sexplib", None); + FindlibPackage ("sexplib.syntax", None); + FindlibPackage ("bitstring", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_c_sources = ["can_stubs.c"]; @@ -5042,7 +5047,13 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])]; }, { - lib_modules = ["Krobot_can_bus"]; + lib_modules = + [ + "Krobot_can_bus"; + "Krobot_can_decoder"; + "Krobot_can_desc_lexer"; + "Krobot_can_desc_parser" + ]; lib_internal_modules = []; lib_findlib_parent = Some "krobot"; lib_findlib_name = Some "can"; @@ -5105,6 +5116,48 @@ let setup_t = }); Executable ({ + cs_name = "krobot-can-display"; + cs_data = PropList.Data.create (); + cs_plugin_data = []; + }, + { + bs_build = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "gtk", true) + ]; + bs_install = + [ + (OASISExpr.EBool true, false); + (OASISExpr.EFlag "gtk", true) + ]; + bs_path = "src/tools"; + bs_compiled_object = Best; + bs_build_depends = + [ + InternalLibrary "krobot-can"; + FindlibPackage ("lwt.syntax", None); + FindlibPackage ("sexplib", None); + FindlibPackage ("sexplib.syntax", None); + FindlibPackage ("cairo.lablgtk2", None); + FindlibPackage ("lwt.glib", None) + ]; + bs_build_tools = [ExternalTool "ocamlbuild"]; + bs_c_sources = []; + bs_data_files = []; + bs_ccopt = [(OASISExpr.EBool true, [])]; + bs_cclib = [(OASISExpr.EBool true, [])]; + bs_dlllib = [(OASISExpr.EBool true, [])]; + bs_dllpath = [(OASISExpr.EBool true, [])]; + bs_byteopt = [(OASISExpr.EBool true, [])]; + bs_nativeopt = [(OASISExpr.EBool true, [])]; + }, + { + exec_custom = false; + exec_main_is = "krobot_can_display.ml"; + }); + Executable + ({ cs_name = "krobot-calibrate-sharps"; cs_data = PropList.Data.create (); cs_plugin_data = []; @@ -5754,5 +5807,6 @@ let setup_t = let setup () = BaseSetup.setup setup_t;; +# 5811 "setup.ml" (* OASIS_STOP *) let () = setup ();; diff --git a/info/control2011/src/can/krobot-can.mllib b/info/control2011/src/can/krobot-can.mllib index 198bccd..e2d02bd 100644 --- a/info/control2011/src/can/krobot-can.mllib +++ b/info/control2011/src/can/krobot-can.mllib @@ -1,4 +1,7 @@ # OASIS_START -# DO NOT EDIT (digest: 05e2413cff140c2f298af6bff05bd866) +# DO NOT EDIT (digest: fe3b1f11910d1f7667123fd3f2470bb1) Krobot_can_bus +Krobot_can_decoder +Krobot_can_desc_lexer +Krobot_can_desc_parser # OASIS_STOP diff --git a/info/control2011/src/can/krobot_can_decoder.ml b/info/control2011/src/can/krobot_can_decoder.ml index bf98edc..60e234b 100644 --- a/info/control2011/src/can/krobot_can_decoder.ml +++ b/info/control2011/src/can/krobot_can_decoder.ml @@ -149,12 +149,19 @@ let result_to_string = function | R_float f -> string_of_float f | R_char c -> Printf.sprintf "%c" c +let result_to_float = function + | R_bit b -> None + | R_hex i -> Some (float i) + | R_int i -> Some (float i) + | R_float f -> Some f + | R_char c -> None (* configuration *) type cap = | Value | Min | Max + | C_text of string let cap_of_string = function | "min" -> Min diff --git a/info/control2011/src/can/krobot_can_decoder.mli b/info/control2011/src/can/krobot_can_decoder.mli index b2cfe9e..a440982 100644 --- a/info/control2011/src/can/krobot_can_decoder.mli +++ b/info/control2011/src/can/krobot_can_decoder.mli @@ -53,12 +53,15 @@ val set_description : decode_table -> description -> unit val result_to_string : result_field -> string +val result_to_float : result_field -> float option + (* configuration file *) type cap = | Value | Min | Max + | C_text of string val cap_of_string : string -> cap diff --git a/info/control2011/src/can/krobot_can_desc_parser.mly b/info/control2011/src/can/krobot_can_desc_parser.mly index d2b2e51..fbcbacd 100644 --- a/info/control2011/src/can/krobot_can_desc_parser.mly +++ b/info/control2011/src/can/krobot_can_desc_parser.mly @@ -64,6 +64,8 @@ config : config_field : | IDENT LCBRACKET options RCBRACKET { { frame = $1; options = $3 } } + | IDENT LCBRACKET RCBRACKET + { { frame = $1; options = [] } } options : | option { [$1] } @@ -80,5 +82,6 @@ caps : cap : | IDENT { cap_of_string $1 } + | DESCRIPTION { C_text $1 } %% diff --git a/info/control2011/src/lib/META b/info/control2011/src/lib/META index dfccb8d..1b2ac8d 100644 --- a/info/control2011/src/lib/META +++ b/info/control2011/src/lib/META @@ -1,5 +1,5 @@ # OASIS_START -# DO NOT EDIT (digest: 3dcfd084b393896010b17f3aac3a6423) +# DO NOT EDIT (digest: ae78269c0645eb8dc894e1c1955a6e56) version = "1.0" description = "The [Kro]bot library" requires = "lwt.unix lwt.react" @@ -9,7 +9,7 @@ exists_if = "krobot.cma" package "can" ( version = "1.0" description = "CAN interface using SocketCAN" - requires = "krobot" + requires = "krobot sexplib bitstring" archive(byte) = "krobot-can.cma" archive(native) = "krobot-can.cmxa" exists_if = "krobot-can.cma" diff --git a/info/control2011/src/lib/krobot_message.ml b/info/control2011/src/lib/krobot_message.ml index a300948..4addf15 100644 --- a/info/control2011/src/lib/krobot_message.ml +++ b/info/control2011/src/lib/krobot_message.ml @@ -41,6 +41,7 @@ type t = | Motor_turn of float * float * float | Motor_bezier of float * float * float * float * float * float | Motor_stop of float * float + | Motor_bezier_limits of float * float * float | Odometry of float * float * float | Odometry_ghost of float * float * float * int * bool | Set_odometry of float * float * float @@ -159,6 +160,10 @@ let to_string = function sprintf "Motor_stop(%f, %f)" lin_acc rot_acc + | Motor_bezier_limits(v_max, a_tan_max, a_rad_max) -> + sprintf + "Motor_bezier_limits(%f, %f, %f)" + v_max a_tan_max a_rad_max | Odometry(x, y, theta) -> sprintf "Odometry(%f, %f, %f)" @@ -485,6 +490,20 @@ let encode = function ~remote:false ~format:F29bits ~data + | Motor_bezier_limits(v_max, a_tan_max, a_rad_max) -> + let v_max = v_max *. 1000. in + let a_tan_max = a_tan_max *. 1000. in + let a_rad_max = a_rad_max *. 1000. in + let data = String.create 6 in + put_uint16 data 0 (int_of_float v_max); + put_uint16 data 2 (int_of_float a_tan_max); + put_uint16 data 4 (int_of_float a_rad_max); + frame + ~identifier:207 + ~kind:Data + ~remote:false + ~format:F29bits + ~data | Set_controller_mode b -> frame ~identifier:205 @@ -606,6 +625,11 @@ let decode frame = float d2 /. 100., float theta /. 100., float v /. 1000.) + | 207 -> + Motor_bezier_limits + (float (get_uint16 frame.data 0) /. 1000., + float (get_uint16 frame.data 2) /. 1000., + float (get_uint16 frame.data 4) /. 1000.) | 231 -> Elevator(get_float32 frame.data 0, get_float32 frame.data 4) diff --git a/info/control2011/src/lib/krobot_message.mli b/info/control2011/src/lib/krobot_message.mli index 7a46699..f111d23 100644 --- a/info/control2011/src/lib/krobot_message.mli +++ b/info/control2011/src/lib/krobot_message.mli @@ -72,6 +72,11 @@ type t = - [lin_acc] in m/s^2 - [rot_acc] in rad/s^2 *) + | Motor_bezier_limits of float * float * float + (** [Motor_bezier_limits(v_max, a_tan_max, a_rad_max)] + - [v_max] in m/s + - [a_tan_max] in m/s^2 + - [a_rad_max] in m/s^2 *) | Odometry of float * float * float (** [Odometry(x, y, theta)] the position of the robot on the table. *) diff --git a/info/control2011/src/tools/krobot_can_display.ml b/info/control2011/src/tools/krobot_can_display.ml index 3372904..e3532f6 100644 --- a/info/control2011/src/tools/krobot_can_display.ml +++ b/info/control2011/src/tools/krobot_can_display.ml @@ -88,17 +88,57 @@ end module StringMap = Map.Make(String) +class basic_field ~packing = +object + val widget = GMisc.label ~packing () + method clear () = widget#set_label "" +end + +class value_field ~packing = +object + inherit basic_field ~packing + method set_result result = + widget#set_label (result_to_string result) +end + +class text_field ~packing text = +object + inherit basic_field ~packing + method set_result (result:result_field) = + widget#set_label text + method! clear () = () +end + +class filter_field ~packing filter = + let old_v = ref None in +object + inherit basic_field ~packing + method set_result result = + match result_to_float result with + | None -> () + | Some f -> + let new_v = + match !old_v with + | None -> f + | Some old -> filter old f in + old_v := Some new_v; + widget#set_label (string_of_float new_v) +end + +let cap_field ~packing = function + | Value -> new value_field ~packing + | C_text t -> new text_field ~packing t + | Min -> new filter_field ~packing min + | Max -> new filter_field ~packing max + class field_info ~packing field_name caps = let box = GPack.hbox ~packing () in let _ = GMisc.label ~packing:box#add ~text:field_name () in - let result_widgets = List.map (fun cap -> cap, GMisc.label ~packing:box#add ()) caps in + let result_widgets = List.map (cap_field ~packing:box#add) caps in object method set_result result = - List.iter (fun (cap, widget) -> - match cap with - | Value -> widget#set_label (result_to_string result) - | Min | Max -> failwith "TODO min/max display") result_widgets - method clear () = List.iter (fun (_,widget) -> widget#set_label "") result_widgets + List.iter (fun widget -> widget#set_result result) result_widgets + method clear () = List.iter (fun widget -> widget#clear ()) result_widgets end class kind_info ~packing type_ (options:Krobot_can_decoder.opt list) = @@ -194,12 +234,14 @@ end let decode_table = ref None let iface = ref None let config_file = ref None +let use_krobot_bus = ref false let parse_arg () = let desc = [ "-p", Arg.String (fun s -> decode_table := Some s), "file containing the protocol"; "-c", Arg.String (fun s -> config_file := Some s), "file containing the configuration"; - "-i", Arg.String (fun s -> iface := Some s), "can interface";] in + "-i", Arg.String (fun s -> iface := Some s), "can interface"; + "-b", Arg.Set use_krobot_bus, "use krobot bus"; ] in Arg.parse desc (function "" -> () | _ -> Arg.usage desc ""; exit 2) "" let report_error f s e lexbuf = @@ -243,7 +285,7 @@ let load_conf f = with | e -> report_error f "while parsing configuration" e lexbuf -let loop ui bus = +let loop_can bus ui = let rec aux () = lwt (timestamp, frame) = Krobot_can_bus.recv bus in lwt () = ui#add_packet timestamp frame in @@ -251,8 +293,18 @@ let loop ui bus = in aux () -let init iface = - lwt bus = Krobot_can_bus.open_can iface in +let loop_krobot_bus bus ui = + let ev = Krobot_bus.recv bus in + Lwt_react.E.keep + (Lwt_react.E.map_s + (function + | timestamp, Krobot_bus.CAN (_, frame) -> + ui#add_packet timestamp frame + | _ -> return ()) ev); + let s,_ = Lwt.wait () in + s + +let init loop = ignore (GMain.init ~setlocale:false ()); Lwt_glib.install (); let ui = new ui () in @@ -270,16 +322,23 @@ let init iface = ui#window#show (); pick [waiter; - loop ui bus] + loop ui] lwt () = parse_arg (); - let iface = - match !iface with - | None -> "slcan0" - | Some s -> s in try_lwt - init iface - with Unix.Unix_error(error, func, arg) -> - Lwt_log.error_f "'%s' failed with: %s" func (Unix.error_message error) - + if !use_krobot_bus + then + lwt bus = Krobot_bus.get () in + init (loop_krobot_bus bus) + else + let iface = + match !iface with + | None -> "slcan0" + | Some s -> s in + lwt bus = Krobot_can_bus.open_can iface in + init (loop_can bus) + with + | Unix.Unix_error(error, func, arg) -> + Lwt_log.error_f "'%s' failed with: %s" func (Unix.error_message error) + | exn -> Lwt_log.error_f ~exn "Uncaught exception" diff --git a/info/control2011/src/tools/krobot_dump.ml b/info/control2011/src/tools/krobot_dump.ml index 4b75d21..a734159 100644 --- a/info/control2011/src/tools/krobot_dump.ml +++ b/info/control2011/src/tools/krobot_dump.ml @@ -77,8 +77,11 @@ lwt () = return () in Lwt_io.printl "" + | Trajectory_go -> + Lwt_io.printf "trajectory_go" | _ -> - return ()) + Lwt_io.printf "truc" + (*return ()*)) (Krobot_bus.recv bus)); fst (wait ()) diff --git a/info/control2011/src/tools/krobot_run.ml b/info/control2011/src/tools/krobot_run.ml index 910d1b8..1ecfb55 100644 --- a/info/control2011/src/tools/krobot_run.ml +++ b/info/control2011/src/tools/krobot_run.ml @@ -1,5 +1,6 @@ #require "krobot" +open Lwt open Lwt_react open Krobot_message open Krobot_bus @@ -42,8 +43,8 @@ let handle_message state_ref (timestamp, message) = let state = !state_ref in let state = (match message with - | Trajectory_moving b -> - { state with moving = b } +(* | Trajectory_moving b -> + { state with moving = b } *) | Objects objects -> { state with objects = objects } | CAN (_,f) -> @@ -118,8 +119,8 @@ let rewrite_action bus = function [ Can [Elevator (0.,-.1.)] ] | Lift_up -> [ Can [Elevator (1.,-.1.)] ] - | Goto v -> - [ Bus [Trajectory_goto v]] +(* | Goto v -> + [ Bus [Trajectory_goto v]] *) | Move_to_pawn -> [ ] | Close_grip_low -> diff --git a/info/control2011/src/tools/krobot_viewer.ml b/info/control2011/src/tools/krobot_viewer.ml index 743f320..7d4b629 100644 --- a/info/control2011/src/tools/krobot_viewer.ml +++ b/info/control2011/src/tools/krobot_viewer.ml @@ -617,4 +617,25 @@ lwt () = ); false)); + + let send_motor_limit () = + let v_max = ui#v_max#adjustment#value in + let a_tan_max = ui#a_tan_max#adjustment#value in + let a_rad_max = ui#a_rad_max#adjustment#value in + ignore (Krobot_bus.send viewer.bus + (Unix.gettimeofday (), + CAN (Info, + Krobot_message.encode + (Motor_bezier_limits (v_max, a_tan_max, a_rad_max))))) in + + ignore + (ui#v_max#connect#value_changed + (fun () -> send_motor_limit ())); + ignore + (ui#a_tan_max#connect#value_changed + (fun () -> send_motor_limit ())); + ignore + (ui#a_rad_max#connect#value_changed + (fun () -> send_motor_limit ())); + waiter hooks/post-receive -- krobot |