]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
actuator variables initialization moved to the init state, obsolete, previously comme...
authorFilip Jares <filipjares@post.cz>
Fri, 24 Apr 2009 20:04:53 +0000 (22:04 +0200)
committerFilip Jares <filipjares@post.cz>
Fri, 24 Apr 2009 20:04:53 +0000 (22:04 +0200)
src/robofsm/competition.cc

index e701a35d71f5882aceba0d8d52cb7ba489af8b4d..58b07b5cf91dd85fcfe5ef58b2557987bffa4a1c 100644 (file)
 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!!