realman 0.0.2

realman robot Rust sdk
Documentation

睿尔曼机械臂 Rust SDK

Crates.io MIT licensed

这是睿尔曼机械臂的 Rust SDK ,旨在帮助 Rust 开发者更好的对睿尔曼机械臂进行二次开发。

SDK 是根据官网 json 协议开发。官网链接

作者介绍

使用方法

[dependencies]
realman = "0.0.2"
use realman::{
    traits::{ArmStateTrait, IOTrait, ModbusTrait, MotionTrait},
    ArmType, Realman, TrajectoryConnect,
};

fn main() {
    // get default realman
    let realman = Realman::default();

    match realman.connect() {
        Ok(mut socket) => {
            // set end voltage
            socket.set_tool_voltage(realman::VoltageType::Three).ok();

            // set modbus mode
            socket
                .set_modbus_mode(
                    realman::PortType::EndRS485RTUMain,
                    realman::BaudrateType::Baud115200,
                    1,
                )
                .ok();

            let res = socket.get_current_arm_state().unwrap();
            println!("{res:#?}");

            socket
                .movej(
                    ArmType::Gen72([0, -60000, 0, -60000, 0, 0, 0]),
                    50,
                    0,
                    TrajectoryConnect::Now,
                )
                .ok();
        }
        Err(err) => panic!("{err:?}"),
    }
}

License

Copyright (c) 2024-present, Leon 李扬

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.