You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rustypot is yet another communication library for robotis Dynamixel motors. It is currently used in the [Reachy project](https://www.pollen-robotics.com/reachy/).
13
+
Rustypot is a communication library for Dynamixel/Feetech motors. It is used in the [Reachy project](https://www.pollen-robotics.com/reachy/). More types of servo can be added in the future.
14
14
15
15
## Feature Overview
16
16
@@ -20,9 +20,19 @@ Rustypot is yet another communication library for robotis Dynamixel motors. It i
20
20
* Easy support for new type of motors (register definition through macros). Currently support for dynamixel XL320, XL330, XL430, XM430, MX*, Orbita 2D & 3D.
21
21
* Pure Rust
22
22
23
+
To add new servo, please refer to the [Servo documentation](./servo/README.md).
24
+
25
+
## APIs
26
+
27
+
It exposes two APIs:
28
+
*`DynamixelProtocolHandler`: low-level API. It handles the serial communication and the Dynamixel protocol parsing. It can be used for fine-grained control of the shared bus with other communication.
29
+
*`Controller`: high-level API for the Dynamixel protocol. Simpler and cleaner API but it takes full ownership of the io (it can still be shared if wrapped with a mutex for instance).
Copy file name to clipboardExpand all lines: src/lib.rs
+30-4Lines changed: 30 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,26 @@
1
-
//! Yet another communication library for robotis Dynamixel motors.
1
+
//! A low-level communication library for servo (Dynamixel and Feetech motors).
2
2
//!
3
3
//! ## Feature Overview
4
4
//!
5
5
//! * Relies on [serialport] for serial communication
6
-
//! * Support for dynamixel protocol v1 and v2 (can also use both on the same io)
6
+
//! * Support for dynamixel protocol v1 and v2 (both can be used on the same io)
7
7
//! * Support for sync read and sync write operations
8
8
//! * Easy support for new type of motors (register definition through macros)
9
9
//! * Pure Rust
10
10
//!
11
-
//! *Note: this version use std and Vec extensively.*
11
+
//! ## APIs
12
+
//!
13
+
//! It exposes two APIs:
14
+
//! * `DynamixelProtocolHandler`: low-level API. It handles the serial communication and the Dynamixel protocol parsing. It can be used for fine-grained control of the shared bus with other communication.
15
+
//! * `Controller`: high-level API for the Dynamixel protocol. Simpler and cleaner API but it takes full ownership of the io (it can still be shared if wrapped with a mutex for instance).
16
+
//!
17
+
//! See the examples below for usage.
12
18
//!
13
19
//! ## Examples
20
+
//!
21
+
//! ### With the low-level API
14
22
//! ```no_run
15
-
//! use rustypot::{DynamixelProtocolHandler, device::mx};
23
+
//! use rustypot::{DynamixelProtocolHandler, servo::dynamixel::mx};
16
24
//! use std::time::Duration;
17
25
//!
18
26
//! let mut serial_port = serialport::new("/dev/ttyACM0", 1_000_000)
> ⚠️ **Warning:** This documentation is only intended for servos that communicate via the Dynamixel Protocol (v1 or v2), such as the Robotis Dynamixel or Feetech servos.
4
+
5
+
* Create a new file in the service folder (or a subfolder such as feetech or dynamixel), for instance [sts3215.rs](./servo/feetech/sts3215.rs) in the feetech folder. Make sure to add its declaration in the parent module (for instance in [./servo/feetech/mod.rs]) as they must be explicitly declared in Rust. Something like this:
6
+
```rust
7
+
pubmodsts3215.rs
8
+
```
9
+
10
+
* Add the servo definition in the new file. You can use the [XL430](./servo/dynamixel/xl430.rs) as a template. The macro should defined the `name` of the servo, the `protocol version` used and then a list of all registers with their name, address, access and type.
11
+
12
+
* Finally, add the servo registration in the servo root module [./servo/mod.rs]. You can specify all variants supported by your servo definition. This registration allows for the scan function to detect your new kind of servo.
0 commit comments