Skip to content

Commit 6c9f91f

Browse files
author
Emile Kroeger
committed
Update introduction.ipynb to use "nao" instead of "w", and to use the syntactic sugar for service calls
1 parent 6d9503c commit 6c9f91f

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

content/introduction.ipynb

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
},
4141
"outputs": [],
4242
"source": [
43-
"w = ipynao.NaoRobotWidget()\n",
44-
"w"
43+
"nao = ipynao.NaoRobotWidget()\n",
44+
"nao"
4545
]
4646
},
4747
{
@@ -60,7 +60,7 @@
6060
},
6161
"outputs": [],
6262
"source": [
63-
"w.connect(\"192.168.1.115\", port=\"80\")"
63+
"nao.connect(\"192.168.1.115\", port=\"80\")"
6464
]
6565
},
6666
{
@@ -79,7 +79,7 @@
7979
},
8080
"outputs": [],
8181
"source": [
82-
"w"
82+
"nao"
8383
]
8484
},
8585
{
@@ -90,7 +90,7 @@
9090
},
9191
"outputs": [],
9292
"source": [
93-
"tts = w.service(\"ALTextToSpeech\")"
93+
"tts = nao.ALTextToSpeech"
9494
]
9595
},
9696
{
@@ -112,7 +112,7 @@
112112
},
113113
"outputs": [],
114114
"source": [
115-
"eyes = w.service(\"ALLeds\")"
115+
"leds = nao.service(\"ALLeds\")"
116116
]
117117
},
118118
{
@@ -123,16 +123,15 @@
123123
},
124124
"outputs": [],
125125
"source": [
126-
"eyes.rasta(3)"
126+
"leds.rasta(3)"
127127
]
128128
},
129129
{
130130
"attachments": {},
131131
"cell_type": "markdown",
132132
"metadata": {},
133133
"source": [
134-
"### Retrieve data from the robot\n",
135-
"Prefix method names with `async_` to be able to wait for returns"
134+
"### Retrieve data from the robot\n"
136135
]
137136
},
138137
{
@@ -143,7 +142,7 @@
143142
},
144143
"outputs": [],
145144
"source": [
146-
"w"
145+
"nao"
147146
]
148147
},
149148
{
@@ -154,7 +153,7 @@
154153
},
155154
"outputs": [],
156155
"source": [
157-
"motion = w.service(\"ALMotion\")"
156+
"motion = nao.ALMotion"
158157
]
159158
},
160159
{
@@ -209,7 +208,7 @@
209208
},
210209
"outputs": [],
211210
"source": [
212-
"w"
211+
"nao"
213212
]
214213
},
215214
{
@@ -220,7 +219,7 @@
220219
},
221220
"outputs": [],
222221
"source": [
223-
"posture = w.service(\"ALRobotPosture\")"
222+
"posture = nao.service(\"ALRobotPosture\")"
224223
]
225224
},
226225
{
@@ -263,9 +262,9 @@
263262
},
264263
"outputs": [],
265264
"source": [
266-
"eyes.fade(\"AllLedsBlue\", 1.0, 2)\n",
267-
"eyes.fade(\"AllLedsRed\", 1.0, 2)\n",
268-
"eyes.fade(\"AllLedsGreen\", 0, 2)"
265+
"leds.fade(\"AllLedsBlue\", 1.0, 2)\n",
266+
"leds.fade(\"AllLedsRed\", 1.0, 2)\n",
267+
"leds.fade(\"AllLedsGreen\", 0, 2)"
269268
]
270269
},
271270
{
@@ -284,7 +283,7 @@
284283
},
285284
"outputs": [],
286285
"source": [
287-
"w"
286+
"nao"
288287
]
289288
},
290289
{
@@ -295,7 +294,7 @@
295294
},
296295
"outputs": [],
297296
"source": [
298-
"vid = w.service(\"ALVideoDevice\")"
297+
"vid = nao.ALVideoDevice"
299298
]
300299
},
301300
{
@@ -402,7 +401,7 @@
402401
},
403402
"outputs": [],
404403
"source": [
405-
"w"
404+
"nao"
406405
]
407406
},
408407
{
@@ -413,7 +412,7 @@
413412
},
414413
"outputs": [],
415414
"source": [
416-
"animate = w.service(\"ALAnimationPlayer\")"
415+
"animate = nao.service(\"ALAnimationPlayer\")"
417416
]
418417
},
419418
{
@@ -457,8 +456,8 @@
457456
},
458457
"outputs": [],
459458
"source": [
460-
"w.disconnect()\n",
461-
"w"
459+
"nao.disconnect()\n",
460+
"nao"
462461
]
463462
},
464463
{
@@ -470,7 +469,7 @@
470469
"outputs": [],
471470
"source": [
472471
"out = Output()\n",
473-
"res = w.service(\"ALLeds\", out).rasta(\"gibberish\")\n",
472+
"res = nao.service(\"ALLeds\", out).rasta(\"gibberish\")\n",
474473
"out"
475474
]
476475
},

0 commit comments

Comments
 (0)