]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
robofsm: robot_orte - Update format style
authorPetr Silhavik <silhavik.p@gmail.com>
Wed, 23 Jan 2013 10:16:29 +0000 (11:16 +0100)
committerPetr Silhavik <silhavik.p@gmail.com>
Wed, 23 Jan 2013 10:16:29 +0000 (11:16 +0100)
src/robofsm/robot_orte.cc

index 46fbb5b6ecbeb0c10c6fe963bfe317a82ab2cb28..0770983ecface2ce53f91383dab24ab6b4861095 100644 (file)
@@ -23,7 +23,6 @@
 #include <math.h>
 #include <robomath.h>
 #include "map_handling.h"
-//#include "match-timing.h"
 #include <string.h>
 #include <can_msg_def.h>
 #include <actuators.h>
@@ -290,7 +289,6 @@ void rcv_robot_cmd_cb(const ORTERecvInfo *info, void *vinstance,
                                        /* Competition starts when plugged out */
                                        if (instance->start_condition) {
                                                robot.sched.queue_event(robot.MAIN, new evStart());
-                                               //FSM_SIGNAL(MAIN, EV_START, NULL);
                                                robot.start_state = COMPETITION_STARTED;
                                                ul_logmsg("STARTED\n");
                                        }
@@ -390,7 +388,7 @@ void rcv_jaws_status_cb(const ORTERecvInfo *info, void *vinstance,
                        if (instance->response.left != last_response_left &&
                             instance->response.right != last_response_right &&
                            instance->response.left == act.jaw_left_get_last_request() &&
-                           instance->response.left == act.jaw_right_get_last_request())
+                           instance->response.right == act.jaw_right_get_last_request())
                                robot.sched.queue_event(robot.MAIN, new evJawsDone());
                        last_response_left = instance->response.left;
                        last_response_right = instance->response.right;
@@ -417,7 +415,7 @@ void rcv_lift_status_cb(const ORTERecvInfo *info, void *vinstance,
 
                         if (instance->response != last_response &&
                             instance->response == act.lift_get_last_request())
-                         robot.sched.queue_event(robot.MAIN, new evLiftDone());
+                               robot.sched.queue_event(robot.MAIN, new evLiftDone());
                         last_response = instance->response;
                         break;
                 case DEADLINE:
@@ -437,8 +435,8 @@ void rcv_robot_switches_cb(const ORTERecvInfo *info, void *vinstance,
                        robot.team_color = (team_colour)instance->team_color;
 
                        if (!last_strategy && instance->strategy) {
-                                       /* strategy switching */
-                                       robot.sched.queue_event(robot.MAIN, new evSwitchStrategy());
+                               /* strategy switching */
+                               robot.sched.queue_event(robot.MAIN, new evSwitchStrategy());
                        }
                        last_strategy = instance->strategy;
                        break;
@@ -455,15 +453,11 @@ void rcv_robot_bumpers_cb(const ORTERecvInfo *info, void *vinstance,
        switch (info->status) {
                case NEW_DATA:
                        if (instance->bumper_right_across || instance->bumper_left_across || instance->bumper_rear_left || instance->bumper_rear_right)
-robot.sched.queue_event(robot.MOTION, new evObstacleBehind());
-                                               
-                         //                            FSM_SIGNAL(MOTION, EV_OBSTACLE_BEHIND, NULL);
-
-                       if (instance->bumper_left || instance->bumper_right) {
-      robot.sched.queue_event(robot.MOTION, new evObstacleSide());
-                                               
-                         //                            FSM_SIGNAL(MOTION, EV_OBSTACLE_SIDE, NULL);
-                       }
+                               robot.sched.queue_event(robot.MOTION, new evObstacleBehind());
+
+                       if (instance->bumper_left || instance->bumper_right) 
+                               robot.sched.queue_event(robot.MOTION, new evObstacleSide());
+
                        break;
                case DEADLINE:
                        break;