realman/
lib.rs

1//! # 睿尔曼机械臂 Rust SDK
2//!
3//! [![Crates.io][crates-badge]][crates-url]
4//! [![Docs.rs][doc-badge]][doc-url]
5//! [![MIT licensed][mit-badge]][mit-url]
6//!
7//! [crates-badge]: https://img.shields.io/badge/crates-0.2.1-yellow
8//! [crates-url]: https://crates.io/crates/realman
9//! [doc-badge]: https://img.shields.io/badge/doc-latest-blue
10//! [doc-url]: https://docs.rs/realman
11//! [mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg
12//! [mit-url]: https://opensource.org/licenses/MIT
13//!
14//! 这是睿尔曼机械臂的 `Rust SDK` ,旨在帮助 `Rust` 开发者更好的对睿尔曼机械臂进行二次开发。
15//!
16//! `SDK` 是根据官网 `json` 协议开发。[官网链接](https://develop.realman-robotics.com/robot/json/getStartedJson.html)
17//!
18//! ## 使用方法
19//!
20//! ```toml
21//! [dependencies]
22//! realman = "0.2.1"
23//! ```
24//!
25//! ## 三次点头示例
26//!
27//! ```rust
28//! use realman::{traits::MotionTrait, ArmType, Realman, TrajectoryConnect};
29//!
30//! // get default client
31//! let realman = Realman::default();
32//!
33//! // you can set it manually
34//! // let realman = Realman::new("192.168.1.18", 8080);
35//!
36//! if let Ok(mut socket) = realman.connect() {
37//!     socket.movej(ArmType::Gen72([0; 7]), 50, 0, TrajectoryConnect::Now).ok();
38//!
39//!     for _ in 0..3 {
40//!         socket.set_joint_step(&[6, -15000], 50).ok();
41//!         socket.set_joint_step(&[6, 15000], 50).ok();
42//!     }
43//! }
44//! ```
45
46mod config;
47
48// 错误处理
49mod error;
50/// 错误信息
51pub use error::Error;
52
53/// 指令集 Trait
54pub mod traits;
55
56// 数据类型
57mod types;
58pub use types::*;
59
60mod robot;
61
62// 睿尔曼
63mod realman;
64/// 睿尔曼机械臂
65pub use realman::Realman;
66
67// Transport
68mod transport;
69/// 机械臂传输
70pub use transport::Transport;
71
72/// 结果类型
73pub type Result<T> = std::result::Result<T, error::Error>;