Project

General

Profile

Statistics
| Branch: | Revision:

scoutos / scout / libscout / src / behaviors / Scheduler.h @ 3f72678f

History | View | Annotate | Download (746 Bytes)

1
#ifndef _SCHEDULER_
2
#define _SCHEDULER_
3

    
4
#include "../helper_classes/PQWrapper.h"
5
#include "../helper_classes/Order.h"
6
#include "../Behavior.h"
7

    
8
#define NUM_TASKS 5
9

    
10
typedef struct{
11
  std::string name;
12
  ros::Subscriber topic;
13
} Robot;
14

    
15
class Scheduler : Behavior {
16
  std::vector<Robot> robots;
17
  PQWrapper* unassignedOrders;
18
        std::vector<Order> assignedOrders;
19
        std::queue<Robot> waitingRobots;
20

    
21
        void create_orders();
22

    
23
        void waiting_dance();
24

    
25
  void msg_callback(const std_msgs::String::ConstPtr& msg);
26

    
27
public:
28
  Scheduler(std::string scoutname);
29
        ~Scheduler();
30
        
31
        void get_task(int robot);
32
        
33
        void task_complete(Order o);
34
        void task_failed(Order o);
35
        
36
        
37
        Order get_next_item();
38
        
39
        void run();
40

    
41
  ros::Publisher sched_to_robot;
42
    
43
};
44
#endif