Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / colonet / server / includes / PositionMonitor.h @ 508

History | View | Annotate | Download (773 Bytes)

1
/**
2
 * @file PositionMonitor.h
3
 *
4
 * @author Jason Knichel
5
 *
6
 * @date 2/4/08
7
 */
8

    
9
#ifndef POSITIONMONITOR_H
10
#define POSITIONMONITOR_H
11

    
12
#include <map>
13
#include <vision.h>
14
using namespace std;
15

    
16
#define MAX_POSITIONS 20
17
#define MAX_DISTANCE 5
18

    
19
using namespace std;
20

    
21
class PositionMonitor {
22
 public:
23
  PositionMonitor(void);
24
  ~PositionMonitor(void);
25

    
26
  void run(void);
27
  int stopMonitoring(void);
28
  int updatePositions(void);
29
  
30
  int assignRealId(int old_id, int real_id);
31
  map<int, VisionPosition> getAllRobotPositions(void);
32
  int getRobotPosition(int robot_id, int* xbuf, int* ybuf);
33

    
34
 private:
35
  map<int, VisionPosition> positionMap;
36
  bool isProbablySameRobot(VisionPosition p1, VisionPosition p2);
37
  int newIdToAssign;
38
  pthread_mutex_t position_map_lock;
39
};
40

    
41
#endif