]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
(old) fsmact, roboevent: some cleanup made during work on my bachelor's thesis
authorFilip Jareš <filipjares@post.cz>
Wed, 10 Mar 2010 10:51:24 +0000 (11:51 +0100)
committerFilip Jareš <filipjares@post.cz>
Wed, 10 Mar 2010 10:55:42 +0000 (11:55 +0100)
src/robofsm/fsmact.c
src/robofsm/roboevent.py

index fdc2ab1addb2e93368d938c3b93d6c21aa3939a6..f38aeefeb39dc5049d6d12faaa9bfdbb32c7f8c7 100644 (file)
@@ -23,8 +23,6 @@ typedef enum {
        HIGH = LIFT_TRAVEL_POS,
 } BASIC_LIFT_POSITION;
 
-BASIC_LIFT_POSITION basic_lift_position = HIGH;
-
 // number of pucks loaded is stored in robot.pucks_inside variable
 bool lintel_present = 1;
 int floor_to_unload;
@@ -92,15 +90,7 @@ FSM_STATE(wait_for_command)
                        act_chelae(CHELA_TIGHT, CHELA_TIGHT);
                }
                act_holder(HOLDER_TIGHT); //act_holder(HOLDER_LOOSE);
-               act_lift(basic_lift_position);
-               switch(basic_lift_position) {
-               case (LOW):
-                       printf("basic lift position set to LOW\n");
-                       break;
-               case (HIGH):
-                       printf("basic lift position set to HIGH\n");
-                       break;
-               }
+               act_lift(HIGH);
                act_pusher(PUSHER_INSIDE);
                act_hokuyo(HOKUYO_PITCH_HORIZONTAL);
                break;
@@ -299,7 +289,6 @@ FSM_STATE(store_pucks_in_holder)
                act_holder(HOLDER_OPENED);
                if (robot.pucks_inside > 2) {
                        robot.pucks_inside++; // FIXME: (?) change this variable only here in this state?
-                       basic_lift_position = HIGH;
                        FSM_TRANSITION(wait_for_command);
                        FSM_SIGNAL(MAIN, EV_ACTION_DONE, NULL);
                } else {
@@ -313,7 +302,6 @@ FSM_STATE(store_pucks_in_holder)
                case 0: */
                        act_holder(HOLDER_TIGHT);
                        robot.pucks_inside++; // FIXME: (?) change this variable in EV_ENTRY and only in one place?
-                       basic_lift_position = HIGH;
                        FSM_TRANSITION(wait_for_command);
                        FSM_SIGNAL(MAIN, EV_ACTION_DONE, NULL);
                        break;
@@ -557,8 +545,10 @@ FSM_STATE(dummy_pucks_unload)
                        FSM_TIMER(2000);
                break;
        case EV_FREE_SPACE:
-               if (dummy_unload_status == 2)
+               if (dummy_unload_status == 2) {
                        FSM_TIMER(1000);
+                       FSM_TRANSITION(wait_for_command);
+               }
                break;
        case EV_LIFT_IN_POS:
        case EV_PUSHER_IN_POS:
index 3958a8bb75e5ffb21bc612505b1d114f88c1c225..fc2c888f53f72560f5a7af19b80e3bf639da7b9d 100644 (file)
@@ -1,7 +1,7 @@
 events = {
     "main" : {
         "EV_START" : "Changed state of start connector.",
-        # solved differently "EV_SHORT_TIME_TO_END" : "Time to go for the deposition regarless of what do we have.",
+        # solved differently "EV_SHORT_TIME_TO_END" : "Time to go for the deposition regardless of what do we have.",
        "EV_LASER_POWER" : "",          # FIXME: what's this? (F.J.)
 
        "EV_ACTION_DONE"        : "ACT FSM signals that the requested action has finished successfully",