From: Jérémie D. <Ba...@us...> - 2011-03-28 23:21: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 a2b6a8fdf2fde7a3df6bfbc187d2b6fe6babe349 (commit) via b83b2f61af4e53a1be00ca12acf4af47ba239a55 (commit) via 14d2b497db894d53b3bbcf04dfe2f42b60357d1d (commit) from 78319e20cdca5e7f40a071a8881e9307a0a79edd (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 a2b6a8fdf2fde7a3df6bfbc187d2b6fe6babe349 Author: Jérémie Dimino <je...@di...> Date: Tue Mar 29 00:56:48 2011 +0200 [info] typo in error messages for the can commit b83b2f61af4e53a1be00ca12acf4af47ba239a55 Author: Jérémie Dimino <je...@di...> Date: Tue Mar 29 00:47:22 2011 +0200 [info] do not redraw when not needed in the viewer commit 14d2b497db894d53b3bbcf04dfe2f42b60357d1d Author: Jérémie Dimino <je...@di...> Date: Tue Mar 29 00:45:04 2011 +0200 [info] send extend can frame instead of small ones ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/src/can/can_stubs.c b/info/control2011/src/can/can_stubs.c index 9cdc4b3..2b6c711 100644 --- a/info/control2011/src/can/can_stubs.c +++ b/info/control2011/src/can/can_stubs.c @@ -61,7 +61,7 @@ CAMLprim value ocaml_can_recv(value val_fd) if (ret < 0) uerror("recv", Nothing); /* It is an error if we do not receive exactly one frame. */ - if (ret != sizeof(frame)) caml_failwith("recvmsg: invalid size"); + if (ret != sizeof(frame)) caml_failwith("recv: invalid size"); /* Receive the timestamp. */ struct timeval tv; @@ -101,10 +101,10 @@ CAMLprim value ocaml_can_send(value val_fd, value val_frame) /* Send the frame. */ int ret = send(Int_val(val_fd), &frame, sizeof(frame), 0); - if (ret < 0) uerror("sendmsg", Nothing); + if (ret < 0) uerror("send", Nothing); /* It is an error if we do not sent exactly one frame. */ - if (ret != sizeof(frame)) caml_failwith("sendmsg: invalid size"); + if (ret != sizeof(frame)) caml_failwith("send: invalid size"); return Val_unit; } diff --git a/info/control2011/src/lib/krobot_message.ml b/info/control2011/src/lib/krobot_message.ml index ae4fe99..76eccc5 100644 --- a/info/control2011/src/lib/krobot_message.ml +++ b/info/control2011/src/lib/krobot_message.ml @@ -88,7 +88,7 @@ let encode = function ~identifier:100 ~kind:Data ~remote:false - ~format:F11bits + ~format:F29bits ~data | Encoder_position_speed_3(pos, speed) -> let data = String.create 8 in @@ -98,7 +98,7 @@ let encode = function ~identifier:101 ~kind:Data ~remote:false - ~format:F11bits + ~format:F29bits ~data | Encoder_position_speed_4(pos, speed) -> let data = String.create 8 in @@ -108,7 +108,7 @@ let encode = function ~identifier:102 ~kind:Data ~remote:false - ~format:F11bits + ~format:F29bits ~data | Motor_status moving -> let data = String.create 1 in @@ -117,7 +117,7 @@ let encode = function ~identifier:103 ~kind:Data ~remote:false - ~format:F11bits + ~format:F29bits ~data | Odometry(x, y, theta) -> let data = String.create 6 in @@ -128,7 +128,7 @@ let encode = function ~identifier:104 ~kind:Data ~remote:false - ~format:F11bits + ~format:F29bits ~data | Motor_move(dist, speed, acc) -> let data = String.create 8 in @@ -139,7 +139,7 @@ let encode = function ~identifier:201 ~kind:Data ~remote:false - ~format:F11bits + ~format:F29bits ~data | Motor_turn(angle, speed, acc) -> let data = String.create 8 in @@ -150,14 +150,14 @@ let encode = function ~identifier:202 ~kind:Data ~remote:false - ~format:F11bits + ~format:F29bits ~data | Req_motor_status -> frame ~identifier:103 ~kind:Data ~remote:true - ~format:F11bits + ~format:F29bits ~data:"" | Unknown frame -> frame diff --git a/info/control2011/src/tools/krobot_viewer.ml b/info/control2011/src/tools/krobot_viewer.ml index c5561c2..a65f342 100644 --- a/info/control2011/src/tools/krobot_viewer.ml +++ b/info/control2011/src/tools/krobot_viewer.ml @@ -498,8 +498,11 @@ module Board = struct (fun (ts, frame) -> match frame with | Odometry(x, y, theta) -> - board.state <- { x; y; theta }; - queue_draw board + let state = { x; y; theta } in + if state <> board.state then begin + board.state <- state; + queue_draw board + end | _ -> ()) (Krobot_message.recv bus) hooks/post-receive -- krobot |