]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
Merge branch 'master' of sojka@rtime.felk.cvut.cz:/var/git/eurobot
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 2 May 2008 13:43:50 +0000 (15:43 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 2 May 2008 13:43:50 +0000 (15:43 +0200)
1  2 
src/robofsm/eb2008/robot_orte.c

index fe0a2b588c56c193f583c678d3a4fe8a6c4618b9,f2356b6ff739cda26eba6f94db676eaa77957622..750309b5e980443038d2290d5794f174eea72cbe
@@@ -19,7 -19,6 +19,7 @@@
  #include <laser-nav.h>
  #include "map_handling.h"
  #include <oledlib.h>
 +#include <string.h>
  /* ---------------------------------------------------------------------- 
   * PUBLISHER CALLBACKS - GENERIC
   * ---------------------------------------------------------------------- */
@@@ -166,6 -165,25 +166,25 @@@ void rcv_pwr_ctrl_cb(const ORTERecvInf
        }
  }
  
+ void rcv_robot_cmd_cb(const ORTERecvInfo *info, void *vinstance,
+                       void *recvCallBackParam)
+ {
+       struct robot_cmd_type *instance = (struct robot_cmd_type *)vinstance;
+       static unsigned char start_received = 0;
+       switch (info->status) {
+               case NEW_DATA:
+                       if (instance->start && !start_received) {
+                               FSM_SIGNAL(MAIN, EV_START, NULL);
+                               start_received = 1;
+                       }
+                       break;
+               case DEADLINE:
+                       DBG("ORTE deadline occurred - pwr_ctrl receive\n");
+                       break;
+       }
+ }
  /* ---------------------------------------------------------------------- 
   * SUBSCRIBER CALLBACKS - EB2008
   * ---------------------------------------------------------------------- */
@@@ -236,7 -254,7 +255,7 @@@ void rcv_cmu_cb(const ORTERecvInfo *inf
                        void *recvCallBackParam)
  {
        struct cmu_type *instance = (struct cmu_type *)vinstance;
 -      static last_color = NO_BALL;
 +      static enum ball_color last_color = NO_BALL;
        static unsigned char first = 1;
  
        switch (info->status) {
@@@ -327,6 -345,7 +346,7 @@@ void robot_init_orte(
        generic_subscriber_joy_data_create(&robot.gorte, rcv_joy_data_cb, &robot.gorte);
        generic_subscriber_pwr_voltage_create(&robot.gorte, rcv_pwr_voltage_cb, &robot.gorte);
        generic_subscriber_pwr_ctrl_create(&robot.gorte, rcv_pwr_ctrl_cb, &robot.gorte);
+       generic_subscriber_robot_cmd_create(&robot.gorte, rcv_robot_cmd_cb, &robot.gorte);
  
        /* create eb2008 subscribers */
        eb2008_subscriber_servos_create(&robot.orte, rcv_servos_cb, &robot.orte);