Skip to content

Commit 341cd88

Browse files
committed
Add content for JupyterLite
1 parent 5cbfc3e commit 341cd88

File tree

1 file changed

+192
-0
lines changed

1 file changed

+192
-0
lines changed

content/introduction.ipynb

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Introduction"
8+
]
9+
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {
14+
"tags": []
15+
},
16+
"outputs": [],
17+
"source": [
18+
"import ipynao\n",
19+
"\n",
20+
"w = ipynao.NaoRobotWidget()\n",
21+
"w"
22+
]
23+
},
24+
{
25+
"cell_type": "markdown",
26+
"metadata": {},
27+
"source": [
28+
"### Test connection"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": null,
34+
"metadata": {
35+
"tags": []
36+
},
37+
"outputs": [],
38+
"source": [
39+
"w.connect()"
40+
]
41+
},
42+
{
43+
"cell_type": "markdown",
44+
"metadata": {},
45+
"source": [
46+
"### Test services"
47+
]
48+
},
49+
{
50+
"cell_type": "code",
51+
"execution_count": null,
52+
"metadata": {
53+
"tags": []
54+
},
55+
"outputs": [],
56+
"source": [
57+
"tts = w.service(\"ALTextToSpeech\")"
58+
]
59+
},
60+
{
61+
"cell_type": "code",
62+
"execution_count": null,
63+
"metadata": {},
64+
"outputs": [],
65+
"source": [
66+
"tts.say(\"how is it going?\")"
67+
]
68+
},
69+
{
70+
"cell_type": "code",
71+
"execution_count": null,
72+
"metadata": {
73+
"tags": []
74+
},
75+
"outputs": [],
76+
"source": [
77+
"eyes = w.service(\"ALLeds\")"
78+
]
79+
},
80+
{
81+
"cell_type": "code",
82+
"execution_count": null,
83+
"metadata": {
84+
"tags": []
85+
},
86+
"outputs": [],
87+
"source": [
88+
"eyes.rasta(10)"
89+
]
90+
},
91+
{
92+
"cell_type": "code",
93+
"execution_count": null,
94+
"metadata": {
95+
"tags": []
96+
},
97+
"outputs": [],
98+
"source": [
99+
"motion = w.service(\"ALMotion\")"
100+
]
101+
},
102+
{
103+
"cell_type": "code",
104+
"execution_count": null,
105+
"metadata": {
106+
"tags": []
107+
},
108+
"outputs": [],
109+
"source": [
110+
"motion.wakeUp()"
111+
]
112+
},
113+
{
114+
"cell_type": "code",
115+
"execution_count": null,
116+
"metadata": {
117+
"tags": []
118+
},
119+
"outputs": [],
120+
"source": [
121+
"motion.rest()"
122+
]
123+
},
124+
{
125+
"cell_type": "code",
126+
"execution_count": null,
127+
"metadata": {
128+
"tags": []
129+
},
130+
"outputs": [],
131+
"source": [
132+
"posture = w.service(\"ALRobotPosture\")"
133+
]
134+
},
135+
{
136+
"cell_type": "code",
137+
"execution_count": null,
138+
"metadata": {
139+
"tags": []
140+
},
141+
"outputs": [],
142+
"source": [
143+
"posture.goToPosture(\"StandInit\", 0.5)"
144+
]
145+
},
146+
{
147+
"cell_type": "code",
148+
"execution_count": null,
149+
"metadata": {
150+
"tags": []
151+
},
152+
"outputs": [],
153+
"source": [
154+
"motion.rest()"
155+
]
156+
},
157+
{
158+
"cell_type": "code",
159+
"execution_count": null,
160+
"metadata": {
161+
"tags": []
162+
},
163+
"outputs": [],
164+
"source": [
165+
"eyes.fade(\"AllLedsBlue\", 1.0, 2)\n",
166+
"eyes.fade(\"AllLedsRed\", 1.0, 2)\n",
167+
"eyes.fade(\"AllLedsGreen\", 0, 2)"
168+
]
169+
}
170+
],
171+
"metadata": {
172+
"kernelspec": {
173+
"display_name": "Python 3 (ipykernel)",
174+
"language": "python",
175+
"name": "python3"
176+
},
177+
"language_info": {
178+
"codemirror_mode": {
179+
"name": "ipython",
180+
"version": 3
181+
},
182+
"file_extension": ".py",
183+
"mimetype": "text/x-python",
184+
"name": "python",
185+
"nbconvert_exporter": "python",
186+
"pygments_lexer": "ipython3",
187+
"version": "3.11.3"
188+
}
189+
},
190+
"nbformat": 4,
191+
"nbformat_minor": 4
192+
}

0 commit comments

Comments
 (0)