root / trunk / code / projects / colonet / ColonetServer / PositionMonitor.cpp @ 443
History | View | Annotate | Download (844 Bytes)
1 |
/**
|
---|---|
2 |
* @file PositionMonitor.cpp
|
3 |
*
|
4 |
* @author Jason Knichel
|
5 |
*
|
6 |
* @date 2/4/08
|
7 |
*/
|
8 |
|
9 |
//TODO: make this file asynchronous
|
10 |
|
11 |
#include <PositionMonitor.h> |
12 |
#include <stdlib.h> |
13 |
#include <vision.h> |
14 |
|
15 |
PositionMonitor::PositionMonitor() { |
16 |
//TODO: don't hardcode this file name
|
17 |
//TODO: check for error returned from init
|
18 |
vision_init("/var/www/colonet.jpg");
|
19 |
positions = NULL;
|
20 |
} |
21 |
|
22 |
PositionMonitor::~PositionMonitor() { |
23 |
} |
24 |
|
25 |
int PositionMonitor::startMonitoring() {
|
26 |
return 0; |
27 |
} |
28 |
|
29 |
int PositionMonitor::stopMonitoring() {
|
30 |
return 0; |
31 |
} |
32 |
|
33 |
int PositionMonitor::getPositions() {
|
34 |
if (positions)
|
35 |
free(positions); |
36 |
|
37 |
//TODO: check for error returned
|
38 |
vision_get_robot_positions(&positions); |
39 |
|
40 |
return 0; |
41 |
} |
42 |
|
43 |
int PositionMonitor::getRobotPosition(int robot_id, int* xbuf, int* ybuf) { |
44 |
// TODO - fill this in.
|
45 |
|
46 |
*xbuf = 1;
|
47 |
*ybuf = 1;
|
48 |
|
49 |
return 0; |
50 |
} |