-
Notifications
You must be signed in to change notification settings - Fork 2
/
example.gpp
127 lines (107 loc) · 2.17 KB
/
example.gpp
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
number fluent position_outcome() {
initially:
() = 0;
}
action detect_position(string obj) {
senses:
position_outcome()
mapping:
"/yolo_obj_detection_position_server"{
to_detected_obj = obj
}
}
action say(string str){
mapping:
"/naoqi_say_server/naoqi_say" {
say_string = str
}
}
bool fluent bumper_state() {
initially:
() = false;
}
exog_action bumper(bool pressed) {
mapping:
"/pepper_robot/naoqi_driver/bumper" {
pressed = pressed
}
effect:
bumper_state() = pressed;
}
string fluent dialog_outcome() {
initially:
()= "";
}
action dialog(string topicfile) {
senses:
dialog_outcome()
mapping:
"/naoqi_dialog_server" {
topic_file = topicfile
}
}
string fluent web_name() {
initially:
() = "";
}
action openWebsite (string url, bool waitForWebCommand){
senses:
web_name()
mapping:
"/naoqi_openWebsite_server/openWebsite"{
url = url,
waitForWebCommand = waitForWebCommand
}
}
bool fluent touch_sensor_state() {
initially:
() = false;
}
exog_action touch(bool pressed) {
mapping:
"/pepper_robot/naoqi_driver/head_touch" {
pressed = pressed
}
effect:
touch_sensor_state() = pressed;
}
bool fluent name_state() {
initially:
() = false;
}
string fluent name() {
initially:
() = "";
}
action LearnFace (string name){
mapping:
"/face_recognition_trainer_actionserver"{
learn_name = name
}
}
number fluent confidence_val() {
initially:
() = 0;
}
exog_action recog_name(string name, number confidence) {
mapping:
"/face_recognition/output" {
name = name,
confidence = confidence
}
effect:
name_state() = true;
name() = name;
confidence_val() = confidence;
}
{
openWebsite("http://192.168.1.200:3412/examples/html/pepper_keyboard/keyboard.html?ros=true", true);
//end(openWebsite("http://192.168.1.200:3412/examples/html/pepper_keyboard/keyboard.html?ros=true", true));
say(web_name());
say("Hallo");
start(openWebsite("http://192.168.1.200:3412/examples/html/pepper_videostream.html?ros=true", false));
//LearnFace("max");
test(name_state() & confidence_val() > 3000);
say("test");
say(name());
}