Skip to content

Commit 10bcc4a

Browse files
committed
rename SyncController into PyController
1 parent 6a75e6d commit 10bcc4a

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustypot"
3-
version = "1.0.0"
3+
version = "1.1.0"
44
edition = "2021"
55
license = "Apache-2.0"
66
authors = ["Pollen Robotics"]

python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ The Python bindings exposes the same API as the Controller API in the rust crate
2323
You first need to create a Controller object. For instance, to communicate with a serial port to Feetech STS3215 motors, you can do the following:
2424

2525
```python
26-
from rustypot.servo import Sts3215SyncController
26+
from rustypot.servo import Sts3215PyController
2727

28-
c = Sts3215SyncController(serial_port='/dev/ttyUSB0', baudrate=100000, timeout=0.1)
28+
c = Sts3215PyController(serial_port='/dev/ttyUSB0', baudrate=100000, timeout=0.1)
2929
```
3030

3131

python/examples/feetech_sinus.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import time
22
import numpy as np
33

4-
from rustypot.servo import Sts3215SyncController
4+
from rustypot.servo import Sts3215PyController
55

66
def main():
77
c = Sts3215SyncController(
8-
serial_port='/dev/tty.usbmodem58FA0822621',
9-
baudrate=1000000,
8+
serial_port='/dev/tty.usbmodem58FA0822621',
9+
baudrate=1000000,
1010
timeout=0.1,
1111
)
1212

@@ -24,4 +24,4 @@ def main():
2424
time.sleep(0.01)
2525

2626
if __name__ == '__main__':
27-
main()
27+
main()

src/servo/servo_macro.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ macro_rules! generate_servo {
3131

3232
#[cfg(feature = "python")]
3333
#[pyo3::pyclass(frozen)]
34-
pub struct [<$servo_name:camel SyncController>](std::sync::Mutex<[<$servo_name:camel Controller>]>);
34+
pub struct [<$servo_name:camel PyController>](std::sync::Mutex<[<$servo_name:camel Controller>]>);
3535
}
3636

3737
#[cfg(feature = "python")]
@@ -62,7 +62,7 @@ macro_rules! generate_protocol_constructor {
6262
}
6363
#[cfg(feature = "python")]
6464
#[pymethods]
65-
impl [<$servo_name:camel SyncController>] {
65+
impl [<$servo_name:camel PyController>] {
6666
#[new]
6767
pub fn new(serial_port: &str, baudrate: u32, timeout: f32) -> PyResult<Self> {
6868
let serial_port = serialport::new(serial_port, baudrate)
@@ -93,7 +93,7 @@ macro_rules! generate_protocol_constructor {
9393
}
9494
#[cfg(feature = "python")]
9595
#[pymethods]
96-
impl [<$servo_name:camel SyncController>] {
96+
impl [<$servo_name:camel PyController>] {
9797
#[new]
9898
pub fn new(serial_port: &str, baudrate: u32, timeout: f32) -> PyResult<Self> {
9999
let serial_port = serialport::new(serial_port, baudrate)
@@ -165,7 +165,7 @@ macro_rules! generate_addr_read_write {
165165

166166
#[cfg(feature = "python")]
167167
#[pymethods]
168-
impl [<$servo_name:camel SyncController>] {
168+
impl [<$servo_name:camel PyController>] {
169169
pub fn read_raw_data(
170170
&self,
171171
py: Python,
@@ -309,7 +309,7 @@ macro_rules! generate_reg_read {
309309

310310
#[cfg(feature = "python")]
311311
#[pymethods]
312-
impl [<$servo_name:camel SyncController>] {
312+
impl [<$servo_name:camel PyController>] {
313313
pub fn [<sync_read_ $reg_name>](
314314
&self,
315315
py: Python,
@@ -328,7 +328,7 @@ macro_rules! generate_reg_read {
328328

329329
#[cfg(feature = "python")]
330330
#[pymethods]
331-
impl [<$servo_name:camel SyncController>] {
331+
impl [<$servo_name:camel PyController>] {
332332
pub fn [<read_ $reg_name>](
333333
&self,
334334
py: Python,
@@ -462,7 +462,7 @@ macro_rules! generate_reg_read {
462462

463463
#[cfg(feature = "python")]
464464
#[pymethods]
465-
impl [<$servo_name:camel SyncController>] {
465+
impl [<$servo_name:camel PyController>] {
466466
#[doc = concat!("Sync read raw register *", stringify!($name), "* (addr: ", stringify!($addr), ", type: ", stringify!($reg_type), ")")]
467467
pub fn [<sync_read_raw_ $reg_name>](
468468
&self,
@@ -590,7 +590,7 @@ macro_rules! generate_reg_write {
590590

591591
#[cfg(feature = "python")]
592592
#[pymethods]
593-
impl [<$servo_name:camel SyncController>] {
593+
impl [<$servo_name:camel PyController>] {
594594
#[doc = concat!("Sync write register *", stringify!($name), "* (addr: ", stringify!($addr), ", type: ", stringify!($reg_type), ")")]
595595
pub fn [<sync_write_ $reg_name>](
596596
&self,
@@ -736,7 +736,7 @@ macro_rules! generate_reg_write {
736736

737737
#[cfg(feature = "python")]
738738
#[pymethods]
739-
impl [<$servo_name:camel SyncController>] {
739+
impl [<$servo_name:camel PyController>] {
740740
#[doc = concat!("Sync write raw register *", stringify!($name), "* (addr: ", stringify!($addr), ", type: ", stringify!($reg_type), ")")]
741741
pub fn [<sync_write_raw_ $reg_name>](
742742
&self,
@@ -871,7 +871,7 @@ macro_rules! register_servo {
871871
let child_module = PyModule::new(parent_module.py(), "servo")?;
872872

873873
$(
874-
child_module.add_class::<$group::[<$servo:lower>]::[<$servo:camel SyncController>]>()?;
874+
child_module.add_class::<$group::[<$servo:lower>]::[<$servo:camel PyController>]>()?;
875875
)+
876876

877877
parent_module.add_submodule(&child_module)?;

0 commit comments

Comments
 (0)