From 7b88777104715c74cdf0e295591dfa8416234969 Mon Sep 17 00:00:00 2001 From: Filip Jares Date: Fri, 24 Apr 2009 22:04:53 +0200 Subject: [PATCH] actuator variables initialization moved to the init state, obsolete, previously commented out code removed --- src/robofsm/competition.cc | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/robofsm/competition.cc b/src/robofsm/competition.cc index e701a35d..58b07b5c 100644 --- a/src/robofsm/competition.cc +++ b/src/robofsm/competition.cc @@ -49,11 +49,9 @@ typedef enum { LOAD_SUCCESS = 0, LOAD_FAIL, - //LOOK_AROUND_SUCCESS, // obsolete, no sharp sensor - //LOOK_AROUND_FAIL // obsolete, no sharp sensor -} SUBFSM_RET_VAL; +} subfsm_ret_val; -#define FSM_EVENT_RET_VAL ((SUBFSM_RET_VAL)FSM_EVENT_INT) +#define FSM_EVENT_RET_VAL ((subfsm_ret_val)FSM_EVENT_INT) /************************************************************************ * Trajectory constraints used, are initialized in the init state @@ -65,7 +63,9 @@ struct TrajectoryConstraints tcFast, tcSlow; * Variables related to puck collecting ************************************************************************/ -int free_puck_to_try_to_get_next = 0; // next free puck number (index of the free_puck_pick_up_sequence array) to pick up +int free_puck_to_try_to_get_next; // next free puck number (index of the free_puck_pick_up_sequence array) to pick up +int pucks_at_once; // number of pucks to load at once (maximum number of pucks we want to have in robot) + /************************************************************************ * Definition of particular "free pucks pick up sequences" @@ -281,6 +281,8 @@ FSM_STATE(init) { switch (FSM_EVENT) { case EV_ENTRY: + free_puck_to_try_to_get_next = 0; // next free puck number (index of the free_puck_pick_up_sequence array) to pick up + pucks_at_once = 2; // number of pucks to load at once (maximum number of pucks we want to have in robot) tcFast = trajectoryConstraintsDefault; //tcFast.maxv = 1.5; tcSlow = trajectoryConstraintsDefault; @@ -376,11 +378,6 @@ FSM_STATE(collect_free_pucks) break; case EV_RETURN: switch(FSM_EVENT_RET_VAL) { - /* obsolete, no sharp sensor present - case LOOK_AROUND_SUCCESS: // FIXME: test number of pucks loaded!! - printf(">>>>>> Look around succeeded\n"); - SUBFSM_TRANSITION(load_the_puck, NULL); - break; */ case LOAD_SUCCESS: printf(">>>>>> Loading the puck succeeded\n"); if(free_puck_to_try_to_get_next<4) { @@ -388,11 +385,6 @@ FSM_STATE(collect_free_pucks) robot_goto_next_puck_in_sequence(lot, free_puck_to_try_to_get_next); } break; - /* obsolete, no sharp sensor present - case LOOK_AROUND_FAIL: - printf(">>>>>> Looking around for the puck FAILED\n"); - break; // FIXME: remove the break - */ case LOAD_FAIL: printf(">>>>>> Loading the puck FAILED\n"); if(free_puck_to_try_to_get_next<6) { // FIXME: test number of pucks loaded!! -- 2.39.2