Skip to content

Commit d82207f

Browse files
Merge pull request #79 from pollen-robotics/next-release-1.0
## version 1.0.0 - Cleanup APIs to offer two interfaces: - high-level interface (Controller) with a simple API for the most common use cases. - low-level interface (DynamixelProtocolHandler) for direct access to the protocol and fine-grained control of the bus ownership. - Add Python bindings for the library (controller API). - Add support for the feetech servo. - Define register conversion at the macro level to simplify the code.
2 parents 96c83c5 + 473571e commit d82207f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+2680
-1636
lines changed
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
# This file is autogenerated by maturin v1.8.2
2+
# To update, run
3+
#
4+
# maturin generate-ci github
5+
#
6+
name: python-bindings-upload-ci
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- master
13+
tags:
14+
- '*'
15+
pull_request:
16+
workflow_dispatch:
17+
18+
permissions:
19+
contents: read
20+
21+
jobs:
22+
linux:
23+
runs-on: ${{ matrix.platform.runner }}
24+
strategy:
25+
matrix:
26+
platform:
27+
- runner: ubuntu-22.04
28+
target: x86_64
29+
- runner: ubuntu-22.04
30+
target: x86
31+
- runner: ubuntu-22.04
32+
target: aarch64
33+
- runner: ubuntu-22.04
34+
target: armv7
35+
steps:
36+
- uses: actions/checkout@v4
37+
- uses: actions/setup-python@v5
38+
with:
39+
python-version: 3.x
40+
- name: Build wheels
41+
uses: PyO3/maturin-action@v1
42+
with:
43+
target: ${{ matrix.platform.target }}
44+
args: --release --features python --out dist --find-interpreter
45+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
46+
manylinux: auto
47+
- name: Upload wheels
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: wheels-linux-${{ matrix.platform.target }}
51+
path: dist
52+
53+
musllinux:
54+
runs-on: ${{ matrix.platform.runner }}
55+
strategy:
56+
matrix:
57+
platform:
58+
- runner: ubuntu-22.04
59+
target: x86_64
60+
- runner: ubuntu-22.04
61+
target: x86
62+
- runner: ubuntu-22.04
63+
target: aarch64
64+
- runner: ubuntu-22.04
65+
target: armv7
66+
steps:
67+
- uses: actions/checkout@v4
68+
- uses: actions/setup-python@v5
69+
with:
70+
python-version: 3.x
71+
- name: Build wheels
72+
uses: PyO3/maturin-action@v1
73+
with:
74+
target: ${{ matrix.platform.target }}
75+
args: --release --features python --out dist --find-interpreter
76+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
77+
manylinux: musllinux_1_2
78+
- name: Upload wheels
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: wheels-musllinux-${{ matrix.platform.target }}
82+
path: dist
83+
84+
windows:
85+
runs-on: ${{ matrix.platform.runner }}
86+
strategy:
87+
matrix:
88+
platform:
89+
- runner: windows-latest
90+
target: x64
91+
- runner: windows-latest
92+
target: x86
93+
steps:
94+
- uses: actions/checkout@v4
95+
- uses: actions/setup-python@v5
96+
with:
97+
python-version: 3.x
98+
architecture: ${{ matrix.platform.target }}
99+
- name: Build wheels
100+
uses: PyO3/maturin-action@v1
101+
with:
102+
target: ${{ matrix.platform.target }}
103+
args: --release --features python --out dist --find-interpreter
104+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
105+
- name: Upload wheels
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: wheels-windows-${{ matrix.platform.target }}
109+
path: dist
110+
111+
macos:
112+
runs-on: ${{ matrix.platform.runner }}
113+
strategy:
114+
matrix:
115+
platform:
116+
- runner: macos-13
117+
target: x86_64
118+
- runner: macos-14
119+
target: aarch64
120+
steps:
121+
- uses: actions/checkout@v4
122+
- uses: actions/setup-python@v5
123+
with:
124+
python-version: 3.x
125+
- name: Build wheels
126+
uses: PyO3/maturin-action@v1
127+
with:
128+
target: ${{ matrix.platform.target }}
129+
args: --release --features python --out dist --find-interpreter
130+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
131+
- name: Upload wheels
132+
uses: actions/upload-artifact@v4
133+
with:
134+
name: wheels-macos-${{ matrix.platform.target }}
135+
path: dist
136+
137+
sdist:
138+
runs-on: ubuntu-latest
139+
steps:
140+
- uses: actions/checkout@v4
141+
- name: Build sdist
142+
uses: PyO3/maturin-action@v1
143+
with:
144+
command: sdist
145+
args: --out dist
146+
- name: Upload sdist
147+
uses: actions/upload-artifact@v4
148+
with:
149+
name: wheels-sdist
150+
path: dist
151+
152+
release:
153+
name: Release
154+
runs-on: ubuntu-latest
155+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
156+
needs: [linux, musllinux, windows, macos, sdist]
157+
permissions:
158+
# Use to sign the release artifacts
159+
id-token: write
160+
# Used to upload release artifacts
161+
contents: write
162+
# Used to generate artifact attestation
163+
attestations: write
164+
steps:
165+
- uses: actions/download-artifact@v4
166+
- name: Generate artifact attestation
167+
uses: actions/attest-build-provenance@v1
168+
with:
169+
subject-path: 'wheels-*/*'
170+
- name: Publish to PyPI
171+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
172+
uses: PyO3/maturin-action@v1
173+
env:
174+
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
175+
with:
176+
command: upload
177+
args: --non-interactive --skip-existing wheels-*/*

.github/workflows/python.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# This file is autogenerated by maturin v1.8.2
2+
# To update, run
3+
#
4+
# maturin generate-ci github
5+
#
6+
name: python-bindings-build-ci
7+
8+
on: [pull_request]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
linux:
15+
runs-on: ${{ matrix.platform.runner }}
16+
strategy:
17+
matrix:
18+
platform:
19+
- runner: ubuntu-22.04
20+
target: x86_64
21+
- runner: ubuntu-22.04
22+
target: x86
23+
- runner: ubuntu-22.04
24+
target: aarch64
25+
- runner: ubuntu-22.04
26+
target: armv7
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-python@v5
30+
with:
31+
python-version: 3.x
32+
- name: Build wheels
33+
uses: PyO3/maturin-action@v1
34+
with:
35+
target: ${{ matrix.platform.target }}
36+
args: --release --features python --out dist --find-interpreter
37+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
38+
manylinux: auto
39+
40+
musllinux:
41+
runs-on: ${{ matrix.platform.runner }}
42+
strategy:
43+
matrix:
44+
platform:
45+
- runner: ubuntu-22.04
46+
target: x86_64
47+
- runner: ubuntu-22.04
48+
target: x86
49+
- runner: ubuntu-22.04
50+
target: aarch64
51+
- runner: ubuntu-22.04
52+
target: armv7
53+
steps:
54+
- uses: actions/checkout@v4
55+
- uses: actions/setup-python@v5
56+
with:
57+
python-version: 3.x
58+
- name: Build wheels
59+
uses: PyO3/maturin-action@v1
60+
with:
61+
target: ${{ matrix.platform.target }}
62+
args: --release --features python --out dist --find-interpreter
63+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
64+
manylinux: musllinux_1_2
65+
66+
windows:
67+
runs-on: ${{ matrix.platform.runner }}
68+
strategy:
69+
matrix:
70+
platform:
71+
- runner: windows-latest
72+
target: x64
73+
- runner: windows-latest
74+
target: x86
75+
steps:
76+
- uses: actions/checkout@v4
77+
- uses: actions/setup-python@v5
78+
with:
79+
python-version: 3.x
80+
architecture: ${{ matrix.platform.target }}
81+
- name: Build wheels
82+
uses: PyO3/maturin-action@v1
83+
with:
84+
target: ${{ matrix.platform.target }}
85+
args: --release --features python --out dist --find-interpreter
86+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
87+
88+
macos:
89+
runs-on: ${{ matrix.platform.runner }}
90+
strategy:
91+
matrix:
92+
platform:
93+
- runner: macos-13
94+
target: x86_64
95+
- runner: macos-14
96+
target: aarch64
97+
steps:
98+
- uses: actions/checkout@v4
99+
- uses: actions/setup-python@v5
100+
with:
101+
python-version: 3.x
102+
- name: Build wheels
103+
uses: PyO3/maturin-action@v1
104+
with:
105+
target: ${{ matrix.platform.target }}
106+
args: --release --features python --out dist --find-interpreter
107+
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
108+
109+
sdist:
110+
runs-on: ubuntu-latest
111+
steps:
112+
- uses: actions/checkout@v4
113+
- name: Build sdist
114+
uses: PyO3/maturin-action@v1
115+
with:
116+
command: sdist
117+
args: --out dist

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
/target
22
/Cargo.lock
3+
4+
__pycache__

Cargo.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
[package]
22
name = "rustypot"
3-
version = "0.6.0"
3+
version = "1.0.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
authors = ["Pollen Robotics"]
77
description = "Package to communicate with Dynamixel motors."
88
homepage = "https://www.pollen-robotics.com"
99
repository = "https://github.com/pollen-robotics/rustypot"
1010
readme = "README.md"
11-
keywords = ["robotics", "dynamixel"]
11+
keywords = ["robotics", "dynamixel", "feetech"]
1212
categories = ["science::robotics"]
13-
autoexamples = false #disable auto discovery of examples
1413

14+
[lib]
15+
crate-type = ["lib", "cdylib"]
16+
17+
[features]
18+
default = []
19+
python = ["dep:pyo3", "dep:pyo3-log"]
1520

1621
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1722

1823
[dependencies]
1924
log = "0.4.17"
2025
paste = "1.0.10"
21-
serialport = "4.2.0"
26+
serialport = { version = "4.2.0", default-features = false}
2227
clap = { version = "4.0.32", features = ["derive"] }
2328
proc-macro2 = { version = "1.0", features=["default", "proc-macro"] }
2429
signal-hook = "0.3.4"
2530
num_enum = "0.7.3"
31+
pyo3 = { version = "0.24.1", optional = true, features = ["multiple-pymethods", "extension-module"] }
32+
pyo3-log = { version = "0.12.3", optional = true }
2633

2734
[dev-dependencies]
2835
env_logger = "0.10.0"

Changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## version 1.0.0
2+
3+
- Cleanup APIs to offer two interfaces:
4+
- high-level interface (Controller) with a simple API for the most common use cases.
5+
- low-level interface (DynamixelProtocolHandler) for direct access to the protocol and fine-grained control of the bus ownership.
6+
- Add Python bindings for the library (controller API).
7+
- Add support for the feetech servo.
8+
- Define register conversion at the macro level to simplify the code.
9+
110
## Version 0.6.0
211

312
- Add dxl XL330 support

0 commit comments

Comments
 (0)