Crate rustypot

Source
Expand description

Yet another communication library for robotis Dynamixel motors.

§Feature Overview

  • Relies on serialport for serial communication
  • Support for dynamixel protocol v1 and v2 (can also use both on the same bus)
  • Support for sync read and sync write operations
  • Easy support for new type of motors (register definition through macros)
  • Pure Rust

Note: this version use std and Vec extensively.

§Examples

use rustypot::{DynamixelSerialIO, device::mx};
use std::time::Duration;

let mut serial_port = serialport::new("/dev/ttyACM0", 1_000_000)
    .timeout(Duration::from_millis(10))
    .open()
    .expect("Failed to open port");

let io = DynamixelSerialIO::v1();

let pos =
    mx::read_present_position(&io, serial_port.as_mut(), 11).expect("Communication error");
println!("Motor 11 present position: {:?}", pos);

Modules§

device
High-level register access functions for a specific dynamixel device

Macros§

reg_read_only
Generates read and sync_read functions for given register
reg_read_write
Generates read, sync_read, write and sync_write functions for given register
reg_read_write_fb
reg_write_only
Generates write and sync_write functions for given register
reg_write_only_fb
Generates write and sync_write functions with feedback for given register

Structs§

DynamixelSerialIO
Raw dynamixel communication messages controller (protocol v1 or v2)

Enums§

CommunicationErrorKind
Dynamixel Communication Error