From 011fd3e4e4d252d02df156a7679c6156cdc72c6a Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Mon, 14 Apr 2008 12:04:01 +0200 Subject: * digital/io/src * asserv - add an goto_angle (not implemented yet). * get sample FSM - the get sample FSM will not call any other FSM (like the move). Instead, it assumes we are already at the right place, we just ensure the angle is correct ; - update the first state in consequences ; - add an angle as parameters (maybe we can remove the X/Y). * general defines - add define to ease the opening of the input hole. --- digital/io/src/getsamples_cb.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'digital/io/src/getsamples_cb.c') diff --git a/digital/io/src/getsamples_cb.c b/digital/io/src/getsamples_cb.c index 0de105e4..5e963ce6 100644 --- a/digital/io/src/getsamples_cb.c +++ b/digital/io/src/getsamples_cb.c @@ -33,6 +33,19 @@ #include "giboulee.h" /* BOT_ */ #include "playground.h" /* PG_* */ +/* + * FACE_DISTRIBUTOR =bot_move_succeed=> + * => OPEN_INPUT_HOLE + * move the arm to open the input hole + */ +fsm_branch_t +getsamples__FACE_DISTRIBUTOR__bot_move_succeed (void) +{ + /* Move the arm to open the input hole to be able to take some samples */ + asserv_move_arm (-BOT_ARM_MIN_TO_OPEN, BOT_ARM_SPEED); + return getsamples_next (FACE_DISTRIBUTOR, bot_move_succeed); +} + /* * OPEN_INPUT_HOLE =arm_move_succeed=> * => APPROACH_DISTRIBUTOR @@ -59,19 +72,6 @@ getsamples__CLOSE_INPUT_HOLE__arm_move_succeed (void) return getsamples_next (CLOSE_INPUT_HOLE, arm_move_succeed); } -/* - * GO_IN_FRONT_OF_DISTRIBUTOR =bot_move_succeed=> - * => OPEN_INPUT_HOLE - * move the arm to open the input hole - */ -fsm_branch_t -getsamples__GO_IN_FRONT_OF_DISTRIBUTOR__bot_move_succeed (void) -{ - /* Move the arm to open the input hole to be able to take some samples */ - asserv_close_input_hole (); - return getsamples_next (GO_IN_FRONT_OF_DISTRIBUTOR, bot_move_succeed); -} - /* * TAKE_SAMPLES =arm_pass_noted_position=> * no_more => MOVE_AWAY_FROM_DISTRIBUTOR @@ -102,15 +102,14 @@ getsamples__TAKE_SAMPLES__arm_pass_noted_position (void) /* * IDLE =start=> - * => GO_IN_FRONT_OF_DISTRIBUTOR - * start going in front of the desired distributor + * => FACE_DISTRIBUTOR + * do a goto angle to make the bot facing the distributor */ fsm_branch_t getsamples__IDLE__start (void) { - /* Move to the desired distributor */ - move_start (getsamples_data.distributor_x, - getsamples_data.distributor_y); + /* Face the distributor */ + asserv_goto_angle (getsamples_data.distributor_angle); return getsamples_next (IDLE, start); } -- cgit v1.2.3