From 3a54854defda7b59411b691e0fc0f074edb6e88e Mon Sep 17 00:00:00 2001 From: NĂ©lio Laranjeiro Date: Thu, 17 Apr 2008 23:34:13 +0200 Subject: Update the gutter FSM to only eject the balls from the robot. --- digital/io/src/gutter_cb.c | 43 ++++++++----------------------------------- 1 file changed, 8 insertions(+), 35 deletions(-) (limited to 'digital/io/src/gutter_cb.c') diff --git a/digital/io/src/gutter_cb.c b/digital/io/src/gutter_cb.c index 298a2f26..85b48ef5 100644 --- a/digital/io/src/gutter_cb.c +++ b/digital/io/src/gutter_cb.c @@ -26,24 +26,23 @@ #include "fsm.h" #include "gutter.h" #include "gutter_cb.h" -#include "asserv.h" #include "trap.h" #include "modules/utils/utils.h" -#include "top.h" -#include "top_fsm.h" /* - * START =ok=> - * => GO_TO_GUTTER - * Go to the gutter. + * IDLE =start=> + * => OPEN_COLLECTOR + * Open the collector and wait for a while. */ fsm_branch_t -gutter__START__ok (void) +gutter__IDLE__start (void) { - asserv_go_to_the_wall(); - return gutter_next (START, ok); + // Open the rear panel. + trap_open_rear_panel (); + return gutter_next (IDLE, start); } + /* * CLOSE_COLLECTOR =collector_closed=> * => END @@ -54,35 +53,9 @@ gutter__CLOSE_COLLECTOR__collector_closed (void) { //Close the collector. trap_close_rear_panel(); - // Post an event to the top fsm machine - fsm_handle_event (&top_fsm, TOP_EVENT_gutter_fsm_finished); return gutter_next (CLOSE_COLLECTOR, collector_closed); } -/* - * GO_TO_GUTTER =position_failed=> - * => GO_TO_GUTTER - * The position failed, shall try another path. - */ -fsm_branch_t -gutter__GO_TO_GUTTER__position_failed (void) -{ - return gutter_next (GO_TO_GUTTER, position_failed); -} - -/* - * GO_TO_GUTTER =position_reached=> - * => OPEN_COLLECTOR - * The robo is near the gutter and the door can be opened. - */ -fsm_branch_t -gutter__GO_TO_GUTTER__position_reached (void) -{ - // Open the collector. - trap_open_rear_panel(); - return gutter_next (GO_TO_GUTTER, position_reached); -} - /* * OPEN_COLLECTOR =collector_opened=> * => CLOSE_COLLECTOR -- cgit v1.2.3