#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>
/* 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");
}
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;
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:
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;
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;