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
* 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"
{
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;
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) {
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!!