Project

General

Profile

Statistics
| Revision:

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

History | View | Annotate | Download (773 Bytes)

1 436 jknichel
/**
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 447 emarinel
#include <map>
13 436 jknichel
#include <vision.h>
14 449 jknichel
using namespace std;
15 436 jknichel
16
#define MAX_POSITIONS 20
17 458 jknichel
#define MAX_DISTANCE 5
18 436 jknichel
19 447 emarinel
using namespace std;
20
21 436 jknichel
class PositionMonitor {
22
 public:
23 447 emarinel
  PositionMonitor(void);
24
  ~PositionMonitor(void);
25 436 jknichel
26 508 emarinel
  void run(void);
27 447 emarinel
  int stopMonitoring(void);
28
  int updatePositions(void);
29 453 emarinel
30 455 emarinel
  int assignRealId(int old_id, int real_id);
31 447 emarinel
  map<int, VisionPosition> getAllRobotPositions(void);
32 443 emarinel
  int getRobotPosition(int robot_id, int* xbuf, int* ybuf);
33
34 436 jknichel
 private:
35 449 jknichel
  map<int, VisionPosition> positionMap;
36 458 jknichel
  bool isProbablySameRobot(VisionPosition p1, VisionPosition p2);
37
  int newIdToAssign;
38 508 emarinel
  pthread_mutex_t position_map_lock;
39 436 jknichel
};
40
41
#endif