Crates.io | dynamixel_ct |
lib.rs | dynamixel_ct |
version | 0.1.1 |
source | src |
created_at | 2024-11-20 02:02:43.459484 |
updated_at | 2024-11-20 05:56:41.284482 |
description | A crate for working with the control tables of Dynamixel servos |
homepage | |
repository | https://github.com/omelia-iliffe/dynamixel_ct |
max_upload_size | |
id | 1454185 |
size | 32,284 |
dP oo dP dP
88 88 88
.d888b88 dP dP 88d888b. .d8888b. 88d8b.d8b. dP dP. .dP .d8888b. 88 .d8888b. d8888P
88' `88 88 88 88' `88 88' `88 88'`88'`88 88 `8bd8' 88ooood8 88 88888888 88' `"" 88
88. .88 88. .88 88 88 88. .88 88 88 88 88 .d88b. 88. ... 88 88. ... 88
`88888P8 `8888P88 dP dP `88888P8 dP dP dP dP dP' `dP `88888P' dP `88888P' dP
.88
d8888P
The goal of this library is to provide the information for each register in the control table of a Dynamixel servo.
This library is intended to be used with an additional library that provides the communication protocol to the Dynamixel servo.
The data for register is currently limited to address and size (length), however expanding this to include the data type and access level is planned.
The current implementation uses static hashmaps of registers internally so is not currently no_std
compatible.
The library can be used to return a control table when the model number is not known at compile time, allowing for a more dynamic approach to working with servos.
If the servo model doesn't implement a register, the control table will return `` for the register.
Currently supported servos include:
with more to be added in the future.
use dynamixel_ct::{models, Register::*};
fn main() {
let xm430 = models::XM430::new();
let goal_pos_register = xm430.get(goal_position);
println!("Goal Position Register: {:?}", goal_pos_register);
/// Output: Ok(RegisterData { address: 116, length: 4 })
}
use dynamixel_ct::{models, ControlTable, Register::*};
fn main() {
// ping the motor to get the correct model number
let model_num: u16 = 1030;
let model = Model::try_from(model_num).unwrap();
let motor = ControlTable::new(model).unwrap();
println!("{:?}", motor.get(goal_position));
/// Output: Ok(RegisterData { address: 116, length: 4 })
}
A few different libraries exist for communicating with Dynamixel servos in Rust: