-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
61 lines (54 loc) · 1.02 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include <stdio.h>
#include "Robot.h"
#include "calib.h"
//Ö´Ðпª¹Ø
#define SOCKETBOT 0
#define CALIB 0
#define ROBOTTEST 0
#define BALLTEST 0
#define WORLD_COORD_ADJUST 0
int main()
{
#if SOCKETBOT
Robot robot;
robot.radarOn();
char ipStr[50];
strcpy(ipStr, "101.5.145.226");
int host = 9999;
int socket_fd = robot.init_socket(ipStr, host);
if(socket_fd == 0){
printf("connect failed!");
return 0;
}
if(socket_fd){
robot.listenAndAct();
}
#endif
#if ROBOTTEST
Robot robot;
robot.radarOn();
robot.drawMap();
robot.keepGoal();
//robot.findBall();
//for(int i = 0; i < 5; i++)
//robot.shoot();
//robot.findBall();
//robot.shoot();
//robot.spin();
//robot.moveRotate(true, 65, M_PI / 2);
//robot.radarOff();
#endif
#if CALIB
calib(true);//@parm:isRight
#endif
#if BALLTEST
int cnt = 0;\
ptInit();
while (true) {
getPhoto();
printf("%d\n", cnt++);
usleep(500000);
}
#endif
return 0;
}