-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLookForBall.h
50 lines (41 loc) · 853 Bytes
/
LookForBall.h
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
/** This option lets the robot look for the ball. */
option(LookForBall, (float)(0.38f) tilt, (float)(0.5f) pan)
{
initial_state(lookRight)
{
transition
{
if(action_done)
goto lookLeft;
}
action
{
Stand();
SetHeadPanTilt(-pan, tilt, 45_deg);
}
}
state(lookLeft)
{
transition
{
if(action_done){
HeadControlMode(HeadControl::lookForward);
goto moveBody;
}
}
action
{
SetHeadPanTilt(pan, tilt, 45_deg);
}
}
state(moveBody){
transition{
if(state_time > 2000)
goto lookRight;
}
action{
HeadControlMode(HeadControl::lookForward);
WalkAtRelativeSpeed(Pose2f(1.f, 0.f, 0.f));
}
}
}