From: Jérémie D. <Ba...@us...> - 2011-03-31 12:13: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 f7aa980b1984ec97e06982b24182553a41a30b33 (commit) from eab5614a83d28245df080d44ea6b1464a83d2173 (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 f7aa980b1984ec97e06982b24182553a41a30b33 Author: Jérémie Dimino <je...@di...> Date: Thu Mar 31 14:12:36 2011 +0200 [krobot_viewer] use the corrent wheels axe center ----------------------------------------------------------------------- Changes: diff --git a/info/control2011/src/lib/krobot_config.ml b/info/control2011/src/lib/krobot_config.ml index 05e699d..acb9ff9 100644 --- a/info/control2011/src/lib/krobot_config.ml +++ b/info/control2011/src/lib/krobot_config.ml @@ -12,3 +12,4 @@ let world_width = 3. let robot_size = 0.3 let wheels_diameter = 0.098 let wheels_distance = 0.259 +let wheels_position = 0.045 diff --git a/info/control2011/src/lib/krobot_config.mli b/info/control2011/src/lib/krobot_config.mli index 7876fdd..bf336d5 100644 --- a/info/control2011/src/lib/krobot_config.mli +++ b/info/control2011/src/lib/krobot_config.mli @@ -23,3 +23,7 @@ val wheels_diameter : float val wheels_distance : float (** The distance between the two wheels. *) + +val wheels_position : float + (** The distance between the axe of the wheels and the back of the + robot. *) diff --git a/info/control2011/src/tools/krobot_viewer.ml b/info/control2011/src/tools/krobot_viewer.ml index 66e4b73..2834f20 100644 --- a/info/control2011/src/tools/krobot_viewer.ml +++ b/info/control2011/src/tools/krobot_viewer.ml @@ -363,16 +363,17 @@ module Board = struct (* Draw the robot *) Cairo.translate ctx board.state.x board.state.y; Cairo.rotate ctx board.state.theta; - Cairo.rectangle ctx (-. robot_size /. 2.) (-. robot_size /. 2.) robot_size robot_size; + Cairo.rectangle ctx (-. wheels_position) (-. robot_size /. 2.) robot_size robot_size; set_color ctx White; Cairo.fill ctx; (* Draw an arrow on the robot *) - Cairo.move_to ctx (-. robot_size /. 4.) 0.; - Cairo.line_to ctx (robot_size /. 4.) 0.; - Cairo.line_to ctx 0. (-. robot_size /. 4.); - Cairo.line_to ctx 0. (robot_size /. 4.); - Cairo.line_to ctx (robot_size /. 4.) 0.; + let d = robot_size /. 2. -. wheels_position in + Cairo.move_to ctx (d -. robot_size /. 4.) 0.; + Cairo.line_to ctx (d +. robot_size /. 4.) 0.; + Cairo.line_to ctx d (-. robot_size /. 4.); + Cairo.line_to ctx d (robot_size /. 4.); + Cairo.line_to ctx (d +. robot_size /. 4.) 0.; set_color ctx Black; Cairo.stroke ctx; @@ -605,7 +606,7 @@ lwt () = ignore_result ( Krobot_message.send bus (Unix.gettimeofday (), - Set_odometry(0.2, 1.9, -0.5 *. pi)) + Set_odometry(0.2, 1.9 +. Krobot_config.robot_size /. 2. -. Krobot_config.wheels_position, -0.5 *. pi)) ); false)); @@ -616,7 +617,7 @@ lwt () = ignore_result ( Krobot_message.send bus (Unix.gettimeofday (), - Set_odometry(Krobot_config.world_width -. 0.2, 1.9, -0.5 *. pi)) + Set_odometry(Krobot_config.world_width -. 0.2, 1.9 +. Krobot_config.robot_size /. 2. -. Krobot_config.wheels_position, -0.5 *. pi)) ); false)); hooks/post-receive -- krobot |