Skip to content

Commit 7c74248

Browse files
Merge pull request #5 from jupyter-robotics/dev
Modify socket imports
2 parents 63e5aab + a44a5ce commit 7c74248

File tree

11 files changed

+58
-21
lines changed

11 files changed

+58
-21
lines changed

content/introduction.ipynb

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@
77
"# Introduction"
88
]
99
},
10+
{
11+
"cell_type": "code",
12+
"execution_count": null,
13+
"metadata": {},
14+
"outputs": [],
15+
"source": [
16+
"%pip install ipynao==0.1.1"
17+
]
18+
},
1019
{
1120
"cell_type": "code",
1221
"execution_count": null,
@@ -36,7 +45,7 @@
3645
},
3746
"outputs": [],
3847
"source": [
39-
"w.connect()"
48+
"w.connect(\"nao.local\", port=\"80\")"
4049
]
4150
},
4251
{
@@ -184,7 +193,7 @@
184193
"name": "python",
185194
"nbconvert_exporter": "python",
186195
"pygments_lexer": "ipython3",
187-
"version": "3.11.3"
196+
"version": "3.11.4"
188197
}
189198
},
190199
"nbformat": 4,
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
/*!
2+
* socket.io-node
3+
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
4+
* MIT Licensed
5+
*/
6+
17
/*! Socket.IO.js build:0.9.17, development. Copyright(c) 2011 LearnBoost <dev@learnboost.com> MIT Licensed */

examples/introduction.ipynb

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,27 @@
99
},
1010
{
1111
"cell_type": "code",
12-
"execution_count": null,
12+
"execution_count": 1,
1313
"metadata": {
1414
"tags": []
1515
},
16-
"outputs": [],
16+
"outputs": [
17+
{
18+
"data": {
19+
"application/vnd.jupyter.widget-view+json": {
20+
"model_id": "cd58f8dba0e641c1b849c4aa111ab0d3",
21+
"version_major": 2,
22+
"version_minor": 0
23+
},
24+
"text/plain": [
25+
"NaoRobotWidget()"
26+
]
27+
},
28+
"execution_count": 1,
29+
"metadata": {},
30+
"output_type": "execute_result"
31+
}
32+
],
1733
"source": [
1834
"import ipynao\n",
1935
"\n",
@@ -30,7 +46,7 @@
3046
},
3147
{
3248
"cell_type": "code",
33-
"execution_count": null,
49+
"execution_count": 2,
3450
"metadata": {
3551
"tags": []
3652
},
@@ -184,7 +200,7 @@
184200
"name": "python",
185201
"nbconvert_exporter": "python",
186202
"pygments_lexer": "ipython3",
187-
"version": "3.11.3"
203+
"version": "3.11.4"
188204
}
189205
},
190206
"nbformat": 4,

ipynao/_frontend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
"""
1010

1111
module_name = "ipynao"
12-
module_version = "^0.1.0"
12+
module_version = "^0.1.1"

ipynao/nao_robot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ async def go_sleep(self, tSeconds=2):
8383
return self.wait_for_change("synco")
8484

8585

86-
def connect(self, ip_address="nao.local"):
86+
def connect(self, ip_address="nao.local", port="80"):
8787
data = {}
8888
data["command"] = str("connect")
8989
data["ipAddress"] = str(ip_address)
90+
data["port"] = str(port)
9091
self.send(data)
9192

9293

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ipynao",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "A widget library for controlling Nao",
55
"keywords": [
66
"jupyter",
@@ -51,7 +51,7 @@
5151
},
5252
"dependencies": {
5353
"@jupyter-widgets/base": "^1.1.10 || ^2 || ^3 || ^4 || ^5 || ^6",
54-
"nao-socket.io": "^1.0.2"
54+
"nao-socket.io": "1.0.3"
5555
},
5656
"devDependencies": {
5757
"@babel/core": "^7.5.0",

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ classifiers = [
3434
dependencies = [
3535
"ipywidgets>=7.0.0",
3636
]
37-
version = "0.1.0"
37+
version = "0.1.1"
3838

3939
[project.optional-dependencies]
4040
docs = [
@@ -104,7 +104,7 @@ file = [
104104
]
105105

106106
[tool.tbump.version]
107-
current = "0.1.0"
107+
current = "0.1.1"
108108
regex = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)((?P<channel>a|b|rc|.dev)(?P<release>\\d+))?"
109109

110110
[tool.tbump.git]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ ipympl>=0.8.2
2727
ipycanvas>=0.9.1
2828

2929
# Python: ipynao library for Nao robot
30-
ipynao>=0.1.0
30+
ipynao>=0.1.1

src/nao-socket.io.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module 'nao-socket.io';

src/qimessaging.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,23 @@
66
** - Laurent LEC <llec@aldebaran-robotics.com>
77
**
88
*/
9-
import { io } from "nao-socket.io";
9+
import io from "nao-socket.io";
1010

1111
export class QiSession {
1212
connected: Boolean = false;
1313
disconnected: any;
1414
host: any;
1515
service: any;
1616

17-
constructor(ipAddress: any = "nao.local") {
18-
// console.log("DBG Emile qim about to connect w/17"); REMOVE
17+
constructor(ipAddress: string = "nao.local", port: string = "80") {
18+
console.log("DBG Emile qim about to connect w/17");
19+
// @ts-ignore
20+
window["oioi"] = io;
1921
let _socket = io.connect(
20-
"nao:nao@" + ipAddress + ":80",
22+
"nao:nao@" + ipAddress + ":" + port,
2123
{ resource: "libs/qimessaging/2/socket.io",
2224
'force new connection': true });
23-
// console.log("DBG Emile qim connecting.."); REMOVE
25+
// console.log("DBG Emile qim connecting..");
2426
let _dfd = new Array();
2527
let _sigs = new Array();
2628
let _idm = 0;

0 commit comments

Comments
 (0)