Skip to content

Commit 836c256

Browse files
committed
a big rename to poulpe_ehtercat_py
1 parent c128988 commit 836c256

22 files changed

+127
-107
lines changed

.github/workflows/rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
- name: Build Docs
6666
run: |
6767
ETHERCAT_PATH=$(pwd)/ethercat-hg RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps --workspace --lib
68-
ETHERCAT_PATH=$(pwd)/ethercat-hg RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps --package python_client
68+
ETHERCAT_PATH=$(pwd)/ethercat-hg RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps --package poulpe_ethercat_py
6969
mv target/doc docs/api
7070
7171
- name: Upload Rust Docs

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = [
33
"ethercat_controller",
44
"poulpe_ethercat_controller",
55
"poulpe_ethercat_grpc",
6-
"python_client"
6+
"poulpe_ethercat_py"
77
]
88
default-members = [
99
"ethercat_controller",

docs/examples/grpc.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ RUST_LOG=info cargo run --release --example client_sinus # add the slave id (ex.
8686

8787
### Python GRPC client
8888

89-
- The `poulpe_ethercat_grpc` crate has a python client that can be used to connect to the GRPC server and read the states of the poulpe boards connected to the network. The python client is a wrapper around the GRPC client that is generated in the `python_client` crate.
89+
- The `poulpe_ethercat_grpc` crate has a python client that can be used to connect to the GRPC server and read the states of the poulpe boards connected to the network. The python client is a wrapper around the GRPC client that is generated in the `poulpe_ethercat_py` crate.
9090
- The python client uses the `maturin` package to build the python wheel.
91-
- See the [python_client docs](../../installation/python_client) for instructions on how to build the python client.
91+
- See the [poulpe_ethercat_py docs](../../installation/poulpe_ethercat_py) for instructions on how to build the python client.
9292

93-
Once you have your python bindings you can run the examples from the `python_client/scripts` directory or notebooks from the `python_client/notebooks` directory.
93+
Once you have your python bindings you can run the examples from the `poulpe_ethercat_py/scripts` directory or notebooks from the `poulpe_ethercat_py/notebooks` directory.
9494

9595
Or you can write your own python scripts to interact with the poulpe boards connected to the network. For example
9696

9797

9898
```python
99-
from python_client import PyPoulpeRemoteClient
99+
from poulpe_ethercat_py import PyPoulpeRemoteClient
100100
import time
101101
102102
slave_id = 0
@@ -127,8 +127,8 @@ Slave 0 current position: [-0.0011222249595448375, 3.743586057680659e-05, 6.8065
127127
```
128128

129129
NOTE:
130-
- <i class="fa fa-book fa-lg"></i> You can find the complete list of functions in the `python_client` crate in the [python_client docs](../../api/python_client).
131-
- You can find mure examples of useing the python client in the `python_client/notebooks` directory. [See the notebooks](https://github.com/pollen-robotics/poulpe_ethercat_controller/tree/develop/python_client/notebooks)
130+
- <i class="fa fa-book fa-lg"></i> You can find the complete list of functions in the `poulpe_ethercat_py` crate in the [poulpe_ethercat_py docs](../../api/poulpe_ethercat_py).
131+
- You can find mure examples of useing the python client in the `poulpe_ethercat_py/notebooks` directory. [See the notebooks](https://github.com/pollen-robotics/poulpe_ethercat_controller/tree/develop/poulpe_ethercat_py/notebooks)
132132

133133
### Orbita2d and Orbita3d control clients
134134

docs/installation/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ If you are using the python-only version of the code you can install the code di
5959
Make sure to use the tag corresponding to the version of the firmware that you are using. For example, if we use the 1.5.4 tag: (see the [tags](https://github.com/pollen-robotics/poulpe_ethercat_controller/tags))
6060

6161
```shell
62-
pip install git+https://github.com/pollen-robotics/[email protected]#subdirectory=python_client --verbose
62+
pip install git+https://github.com/pollen-robotics/[email protected]#subdirectory=poulpe_ethercat_py --verbose
6363
```
6464

6565
NOTE:
@@ -68,7 +68,7 @@ This install procedure is available from the version 1.5.4 of the `poulpe_etherc
6868
Once this is installed you can use the python client to communicate with the poulpe board.
6969

7070
```python
71-
import python_client
71+
import poulpe_ethercat_py
7272
```
7373

7474
## Installing from source
@@ -90,7 +90,7 @@ git checkout 1.5.x
9090
cargo build --release
9191
```
9292

93-
See how to [install the python bindings](python_client) from the source code.
93+
See how to [install the python bindings](poulpe_ethercat_py) from the source code.
9494

9595

9696

docs/installation/python_client.md renamed to docs/installation/poulpe_ethercat_py.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ parent: Installation and configuration
66

77
# Python GRPC client bindings
88

9-
The `poulpe_ethercat_controller` crate provides a GRPC server and client interface that can be accessed by multiple clients at the same time, either in Rust or Python. The GRPC server is implemented in Rust and the client bindings are generated for both Rust and Python. The python bindings are implemented in `python_client` crate.
9+
The `poulpe_ethercat_controller` crate provides a GRPC server and client interface that can be accessed by multiple clients at the same time, either in Rust or Python. The GRPC server is implemented in Rust and the client bindings are generated for both Rust and Python. The python bindings are implemented in `poulpe_ethercat_py` crate.
1010

1111
The simplest way of obtaining the python client is to pip install the code directly from the git the repository, using the tag corresponding to the version of the firmware that you are using. For example, if we use the 1.5.4 tag: (see the [tags](https://github.com/pollen-robotics/poulpe_ethercat_controller/tags))
1212

1313
```shell
14-
pip install git+https://github.com/pollen-robotics/[email protected]#subdirectory=python_client --verbose
14+
pip install git+https://github.com/pollen-robotics/[email protected]#subdirectory=poulpe_ethercat_py --verbose
1515
```
1616

1717
NOTE:
@@ -23,7 +23,7 @@ This install procedure is available from the version 1.5.4 of the `poulpe_etherc
2323
Provided that you already have the `poulpe_ethercat_controller` crate cloned and built, you can install the python client bindings from the source code. You can find more information on how to build the code in the <a href="../">installation and configuration</a> section.
2424

2525

26-
First place yourself in the `python_client` directory, and then you can build the python client bindings you can use the `maturin` tool.
26+
First place yourself in the `poulpe_ethercat_py` directory, and then you can build the python client bindings you can use the `maturin` tool.
2727

2828
```bash
2929
maturin develop --release
@@ -45,7 +45,7 @@ maturin develop --release
4545
```
4646

4747
This will install the python client in the current environment.
48-
And then you can open the notebooks in the `notebooks` folder and scripts in the `scripts` folder to see how to use the client. See the [notebooks](https://github.com/pollen-robotics/poulpe_ethercat_controller/tree/develop/python_client/notebooks) for more information.
48+
And then you can open the notebooks in the `notebooks` folder and scripts in the `scripts` folder to see how to use the client. See the [notebooks](https://github.com/pollen-robotics/poulpe_ethercat_controller/tree/develop/poulpe_ethercat_py/notebooks) for more information.
4949

5050
The client is a wrapper around the GRPC client generated from the `poulpe_ethercat_grpc/src/client.rs` folder.
5151

@@ -64,7 +64,7 @@ ethercat:
6464
And then you can run the following python script:
6565
6666
```python
67-
from python_client import PyPoulpeRemoteClient, launch_server, get_all_slaves_in_network
67+
from poulpe_ethercat_py import PyPoulpeRemoteClient, launch_server, get_all_slaves_in_network
6868
import time
6969

7070
# launch the server first
@@ -111,5 +111,5 @@ Slave 0 current position: [-0.0011222249595448375, 3.743586057680659e-05, 6.8065
111111
112112
113113
NOTE:
114-
- <i class="fa fa-book fa-lg"></i> You can find the complete list of functions in the `python_client` crate in the [python_client docs](../../api/python_client).
115-
- You can find mure examples of useing the python client in the `python_client/notebooks` directory. [See the notebooks](https://github.com/pollen-robotics/poulpe_ethercat_controller/tree/develop/python_client/notebooks)
114+
- <i class="fa fa-book fa-lg"></i> You can find the complete list of functions in the `poulpe_ethercat_py` crate in the [poulpe_ethercat_py docs](../../api/poulpe_ethercat_py).
115+
- You can find mure examples of useing the python client in the `poulpe_ethercat_py/notebooks` directory. [See the notebooks](https://github.com/pollen-robotics/poulpe_ethercat_controller/tree/develop/poulpe_ethercat_py/notebooks)

docs/software/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ has_children: true
1919
- See more in the [poulpe_ethercat_controller](poulpe_ethercat_controller)
2020
- `poulpe_ethercat_grpc`: This crate uses the `poulpe_ethercat_controller` to allow for reading assynchronously from multiple poulpe boards connected to the same ethercat master. It is based on the `grpc` protocol. It allows for creating a single server that can be accessed by multiple clients.
2121
- See more in the [poulpe_ethercat_grpc](poulpe_ethercat_grpc)
22-
- `python_client`: This is a python wrapper of the `poulpe_ethercat_grpc` crate's client side. It allows for reading from multiple poulpe boards connected to the same ethercat master from python and in that way enables quick prototyping.
23-
- See more in the [python_client](python_client)
22+
- `poulpe_ethercat_py`: This is a python wrapper of the `poulpe_ethercat_grpc` crate's client side. It allows for reading from multiple poulpe boards connected to the same ethercat master from python and in that way enables quick prototyping.
23+
- See more in the [poulpe_ethercat_py](poulpe_ethercat_py)
2424
- `config`: This is a directory that contains the configuration files for the poulpe boards. It contains the eeprom configuration files for the LN9252 chip on the poulpe boards as well as the EtherCAT networks slave configuration yaml files that are used to create the ethercat master.
2525
- See more in the [config](config)
2626
The full stack looks something like this:

docs/software/python_client.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
2-
title: python_client
2+
title: poulpe_ethercat_py
33
layout: default
44
nav_order: 6
55
parent: Crates
66
---
77

88
## Python GRPC client for comunicating with Ethercat Master
99

10-
See more info on installing the client in the [Installation and configuration](../../installation/python_client) docs.
10+
See more info on installing the client in the [Installation and configuration](../../installation/poulpe_ethercat_py) docs.
1111

1212
## Run the GRPC server
1313
Make sure to run the GRPC server before running the client.
@@ -20,7 +20,7 @@ $ cargo run --release ../config/file/here.yaml
2020
## Simple example
2121

2222
```python
23-
from python_client import PyPoulpeRemoteClient
23+
from poulpe_ethercat_py import PyPoulpeRemoteClient
2424
import time
2525

2626
slave_id = 0
@@ -46,4 +46,4 @@ Slave 0 current position: [-0.0011222249595448375, 3.743586057680659e-05, 6.8065
4646

4747

4848
NOTE:
49-
<i class="fa fa-book fa-lg"></i> The full software API can be found [here](../../api/python_client)
49+
<i class="fa fa-book fa-lg"></i> The full software API can be found [here](../../api/poulpe_ethercat_py)
File renamed without changes.
File renamed without changes.

python_client/Cargo.toml renamed to poulpe_ethercat_py/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[package]
2-
name = "python_client"
2+
name = "poulpe_ethercat_py"
33
version = "1.5.0"
44
edition = "2021"
55

@@ -14,6 +14,6 @@ tonic = "0.11"
1414
tokio = { version = "1.21.0", features = ["macros", "rt-multi-thread"] }
1515

1616
[lib]
17-
name = "python_client"
17+
name = "poulpe_ethercat_py"
1818
path = "src/lib.rs"
1919
crate-type = ["cdylib"]

python_client/README.md renamed to poulpe_ethercat_py/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ cargo run --release ../config/file/here.yaml
3030
## Simple example
3131

3232
```python
33-
from python_client import PyPoulpeRemoteClient
33+
from poulpe_ethercat_py import PyPoulpeRemoteClient
3434
import time
3535

3636
slave_id = 0

python_client/notebooks/orbita2d_test_assembly.ipynb renamed to poulpe_ethercat_py/notebooks/orbita2d_test_assembly.ipynb

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,21 @@
3131
"text": [
3232
"POULPE controller ready!\n",
3333
"Devices connected in the network: \n",
34-
"Slave 0: RightShoulderOrbita2d\n"
34+
"Slave 0: LeftWristOrbita3d\n"
3535
]
3636
}
3737
],
3838
"source": [
39-
"import python_client\n",
39+
"from poulpe_ethercat_py import PyEthercatServer\n",
4040
"import time\n",
4141
"\n",
4242
"# launch the server\n",
43-
"address = python_client.launch_server(\"../../config/ethercat.yaml\")\n",
43+
"server = PyEthercatServer()\n",
44+
"server.launch_server(\"../../config/ethercat.yaml\")\n",
4445
"time.sleep(1)\n",
4546
"\n",
4647
"# print all slaves in the network\n",
47-
"devices = python_client.get_all_slaves_in_network(address)\n",
48+
"devices = server.get_all_slaves_in_network()\n",
4849
"print(\"Devices connected in the network: \")\n",
4950
"for i,name in zip(devices[0],devices[1]):\n",
5051
" print(\"Slave {}: {}\".format(i,name))"
@@ -60,26 +61,26 @@
6061
},
6162
{
6263
"cell_type": "code",
63-
"execution_count": 7,
64+
"execution_count": 2,
6465
"id": "c69edec1-3871-44d0-a104-73a40eebb4ee",
6566
"metadata": {},
6667
"outputs": [
6768
{
6869
"name": "stdout",
6970
"output_type": "stream",
7071
"text": [
71-
"([0], ['RightShoulderOrbita2d'])\n"
72+
"([0], ['LeftWristOrbita3d'])\n"
7273
]
7374
}
7475
],
7576
"source": [
76-
"from python_client import PyPoulpeRemoteClient\n",
77+
"from poulpe_ethercat_py import PyPoulpeRemoteClient\n",
7778
"\n",
7879
"slave_id = 0\n",
7980
"n_axis = 2 # 2 or 3\n",
8081
"\n",
8182
"# Create an instance of the client\n",
82-
"client = PyPoulpeRemoteClient(address, [slave_id], 0.001)\n",
83+
"client = PyPoulpeRemoteClient(server.addr, [slave_id], 0.001)\n",
8384
"\n",
8485
"print(client.get_connected_devices())\n",
8586
"\n",

python_client/notebooks/orbita3d_test_assembly.ipynb renamed to poulpe_ethercat_py/notebooks/orbita3d_test_assembly.ipynb

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,31 @@
2121
},
2222
{
2323
"cell_type": "code",
24-
"execution_count": 3,
24+
"execution_count": 5,
2525
"id": "1886418a-95ba-4ea5-8834-8a2c23e3effc",
2626
"metadata": {},
2727
"outputs": [
2828
{
2929
"name": "stdout",
3030
"output_type": "stream",
3131
"text": [
32-
"POULPE controller ready!\n"
32+
"POULPE controller ready!\n",
33+
"Devices connected in the network: \n",
34+
"Slave 0: LeftWristOrbita3d\n"
3335
]
3436
}
3537
],
3638
"source": [
37-
"import python_client\n",
39+
"from poulpe_ethercat_py import PyEthercatServer\n",
3840
"import time\n",
3941
"\n",
4042
"# launch the server\n",
41-
"address = python_client.launch_server(\"../../config/ethercat.yaml\")\n",
43+
"server = PyEthercatServer()\n",
44+
"server.launch_server(\"../../config/ethercat.yaml\")\n",
4245
"time.sleep(1)\n",
4346
"\n",
4447
"# print all slaves in the network\n",
45-
"devices = python_client.get_all_slaves_in_network(address)\n",
48+
"devices = server.get_all_slaves_in_network()\n",
4649
"print(\"Devices connected in the network: \")\n",
4750
"for i,name in zip(devices[0],devices[1]):\n",
4851
" print(\"Slave {}: {}\".format(i,name))"
@@ -66,18 +69,18 @@
6669
"name": "stdout",
6770
"output_type": "stream",
6871
"text": [
69-
"([1], ['RightWristOrbita3d'])\n"
72+
"([0], ['LeftWristOrbita3d'])\n"
7073
]
7174
}
7275
],
7376
"source": [
74-
"from python_client import PyPoulpeRemoteClient\n",
77+
"from poulpe_ethercat_py import PyPoulpeRemoteClient\n",
7578
"\n",
76-
"slave_id = 1\n",
79+
"slave_id = 0\n",
7780
"n_axis = 3# 2 or 3\n",
7881
"\n",
7982
"# Create an instance of the client\n",
80-
"client = PyPoulpeRemoteClient(address, [slave_id], 0.001)\n",
83+
"client = PyPoulpeRemoteClient(server.addr, [slave_id], 0.001)\n",
8184
"\n",
8285
"print(client.get_connected_devices())\n",
8386
"\n",

python_client/notebooks/poulpe_test.ipynb renamed to poulpe_ethercat_py/notebooks/poulpe_test.ipynb

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,31 @@
1818
},
1919
{
2020
"cell_type": "code",
21-
"execution_count": 3,
21+
"execution_count": 1,
2222
"id": "45a55cd9-9ed1-43c7-9f18-63b4499ece82",
2323
"metadata": {},
2424
"outputs": [
2525
{
2626
"name": "stdout",
2727
"output_type": "stream",
2828
"text": [
29-
"POULPE controller ready!\n"
29+
"POULPE controller ready!\n",
30+
"Devices connected in the network: \n",
31+
"Slave 0: LeftWristOrbita3d\n"
3032
]
3133
}
3234
],
3335
"source": [
34-
"import python_client\n",
36+
"from poulpe_ethercat_py import PyEthercatServer\n",
3537
"import time\n",
3638
"\n",
3739
"# launch the server\n",
38-
"address = python_client.launch_server(\"../../config/ethercat.yaml\")\n",
40+
"server = PyEthercatServer()\n",
41+
"server.launch_server(\"../../config/ethercat.yaml\")\n",
3942
"time.sleep(1)\n",
4043
"\n",
4144
"# print all slaves in the network\n",
42-
"devices = python_client.get_all_slaves_in_network(address)\n",
45+
"devices = server.get_all_slaves_in_network()\n",
4346
"print(\"Devices connected in the network: \")\n",
4447
"for i,name in zip(devices[0],devices[1]):\n",
4548
" print(\"Slave {}: {}\".format(i,name))"
@@ -55,7 +58,7 @@
5558
},
5659
{
5760
"cell_type": "code",
58-
"execution_count": 4,
61+
"execution_count": 2,
5962
"id": "c69edec1-3871-44d0-a104-73a40eebb4ee",
6063
"metadata": {},
6164
"outputs": [
@@ -64,20 +67,20 @@
6467
"output_type": "stream",
6568
"text": [
6669
"Connecting to slave 0\n",
67-
"Connected to slaves | ids: [0] , names: ['RightShoulderOrbita2d']\n"
70+
"Connected to slaves | ids: [0] , names: ['LeftWristOrbita3d']\n"
6871
]
6972
}
7073
],
7174
"source": [
72-
"from python_client import PyPoulpeRemoteClient\n",
75+
"from poulpe_ethercat_py import PyPoulpeRemoteClient\n",
7376
"import time\n",
7477
"\n",
7578
"slave_id = 0\n",
7679
"n_axis = 3 # 2 or 3 make sure to set it!!!!!\n",
7780
"\n",
7881
"print(\"Connecting to slave {}\".format(slave_id))\n",
7982
"# Create an instance of the client\n",
80-
"client = PyPoulpeRemoteClient(address, [slave_id], 0.001)\n",
83+
"client = PyPoulpeRemoteClient(server.addr, [slave_id], 0.001)\n",
8184
"# print the connected clients\n",
8285
"devs = client.get_connected_devices()\n",
8386
"print(\"Connected to slaves | ids: {} , names: {}\".format(devs[0],devs[1]) )\n",
@@ -291,7 +294,7 @@
291294
"source": [
292295
"### Some other API functions\n",
293296
"\n",
294-
"- See all functions here: https://pollen-robotics.github.io/poulpe_ethercat_controller/api/python_client/"
297+
"- See all functions here: https://pollen-robotics.github.io/poulpe_ethercat_controller/api/poulpe_ethercat_py/"
295298
]
296299
},
297300
{

0 commit comments

Comments
 (0)