|
From: Jérémie D. <Ba...@us...> - 2010-02-15 20:58:55
|
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 fdb6a0d68539867257a8498a43564647205aa20e (commit)
via 1def6218a057d6844c344042d595424dd891f396 (commit)
from a4b90752699e95c28994bd8db6da99995798d984 (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 fdb6a0d68539867257a8498a43564647205aa20e
Author: Jérémie Dimino <je...@di...>
Date: Mon Feb 15 21:57:08 2010 +0100
Do not inverse directions in joy_control
commit 1def6218a057d6844c344042d595424dd891f396
Author: Olivier BICHLER <oli...@en...>
Date: Mon Feb 15 21:54:26 2010 +0100
Inverse directions for the right motor.
-----------------------------------------------------------------------
Changes:
diff --git a/PC_Mainboard/clients/joy_control.ml b/PC_Mainboard/clients/joy_control.ml
index b36a9de..8c01b87 100644
--- a/PC_Mainboard/clients/joy_control.ml
+++ b/PC_Mainboard/clients/joy_control.ml
@@ -132,7 +132,7 @@ let parent_loop krobot pipe =
return ()
| JoyRAxis n ->
if not !rstop then
- lwt () = try_call "set-speed-right" (fun () -> Krobot.set_speed krobot ~motor:`Right ~speed:((-n) * axis_coef) ~acc:acceleration) in
+ lwt () = try_call "set-speed-right" (fun () -> Krobot.set_speed krobot ~motor:`Right ~speed:(n * axis_coef) ~acc:acceleration) in
loop ()
else
loop ()
diff --git a/PC_Mainboard/driver/commands.ml b/PC_Mainboard/driver/commands.ml
index 5404b77..c298091 100644
--- a/PC_Mainboard/driver/commands.ml
+++ b/PC_Mainboard/driver/commands.ml
@@ -93,9 +93,11 @@ struct
backend Protocol.traj_tr card angle speed acc
(* Values comming from lm629.h *)
- let int_of_direction = function
- | `Forward -> 1
- | `Backward -> -1
+ let int_of_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
@@ -113,7 +115,7 @@ struct
RW.set_uint8 data 1 (int_of_motor motor);
RW.set_int16 data 2 speed;
RW.set_int16 data 4 acc;
- RW.set_uint8 data 6 (int_of_direction dir);
+ 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 =
@@ -121,7 +123,7 @@ struct
RW.set_uint8 data 0 Protocol.traj_change_velocity;
RW.set_uint8 data 1 (int_of_motor motor);
RW.set_int16 data 2 speed;
- RW.set_uint8 data 4 (int_of_direction dir);
+ RW.set_uint8 data 4 (int_of_direction motor dir);
Card.send_command card Protocol.cmd_traj data
let traj_start card ~motor =
hooks/post-receive
--
krobot
|