From f8506e55841f86ef2c385eac31aa8cdb53349b8a Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Fri, 22 May 2009 07:14:25 +0200 Subject: * digital/io/src: - fix angle for clean distributor position, - when we do not need to stop move FSM to go somewhere else, do not stop it. --- digital/io/src/top_cb.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'digital/io/src/top_cb.c') diff --git a/digital/io/src/top_cb.c b/digital/io/src/top_cb.c index 3dd7bafe..ce6d6db4 100644 --- a/digital/io/src/top_cb.c +++ b/digital/io/src/top_cb.c @@ -78,7 +78,7 @@ top__WAIT_INIT_TO_FINISH__init_match_is_started (void) * already_six_pucks_or_no_next_position_and_no_puck => GET_PUCK_FROM_DISTRIBUTOR * close cylinder. * get the next distributor position and launch move FSM to go there. - * already_six_pucks_or_no_next_position_and_some_puck => STOP_TO_GO_TO_UNLOAD_AREA + * already_six_pucks_or_no_next_position_and_some_puck => GO_TO_UNLOAD_AREA * close cylinder. * get the next distributor position and launch move FSM to go there. * next_position_exists => GET_PUCK_FROM_THE_GROUND @@ -107,8 +107,6 @@ top__GET_PUCK_FROM_THE_GROUND__move_fsm_succeed (void) } else { - /* Go there. */ - move_start (position, ASSERV_BACKWARD); /* Go to distributor. */ top_get_next_position_to_get_distributor (&position, &front_position); /* Go there. */ @@ -126,7 +124,7 @@ top__GET_PUCK_FROM_THE_GROUND__move_fsm_succeed (void) /* * GET_PUCK_FROM_THE_GROUND =move_fsm_failed=> - * => STOP_TO_GO_TO_UNLOAD_AREA + * => GO_TO_UNLOAD_AREA * close cylinder. * we have failed to do a move, go the distributor (get next distributor and go * there with move FSM). @@ -134,14 +132,14 @@ top__GET_PUCK_FROM_THE_GROUND__move_fsm_succeed (void) fsm_branch_t top__GET_PUCK_FROM_THE_GROUND__move_fsm_failed (void) { - asserv_position_t position; - /* Ensure cylinder is close. */ cylinder_close_order = 1; /* Flush cylinder. */ cylinder_flush_order = 1; - top_get_next_position_to_get_puck_on_the_ground (&position, 0); + asserv_position_t position; + /* Go to unload area. */ + top_get_next_position_to_unload_puck (&position); /* Go there. */ - move_start (position, 0); + move_start (position, ASSERV_BACKWARD); return top_next (GET_PUCK_FROM_THE_GROUND, move_fsm_failed); } @@ -155,8 +153,6 @@ top__GET_PUCK_FROM_THE_GROUND__bot_is_full_of_pucks (void) { /* Ensure cylinder is close. */ cylinder_close_order = 1; - /* Flush cylinder. */ - cylinder_flush_order = 1; /* Stop move FSM. */ move_stop (); return top_next (GET_PUCK_FROM_THE_GROUND, bot_is_full_of_pucks); @@ -178,13 +174,8 @@ top__GET_PUCK_FROM_THE_GROUND__state_timeout (void) cylinder_close_order = 1; if (top_puck_inside_bot) { - /* Flush cylinder. */ - cylinder_flush_order = 1; - asserv_position_t position; - /* Go to unload area. */ - top_get_next_position_to_unload_puck (&position); - /* Go there. */ - move_start (position, ASSERV_BACKWARD); + /* Stop move FSM. */ + move_stop (); return top_next_branch (GET_PUCK_FROM_THE_GROUND, state_timeout, some_pucks); } else -- cgit v1.2.3