| Crates.io | odrive-messages |
| lib.rs | odrive-messages |
| version | 0.2.2 |
| created_at | 2025-11-14 13:22:56.131642+00 |
| updated_at | 2025-11-25 13:54:59.465216+00 |
| description | Unofficial ODrive CAN bus message encoding and decoding |
| homepage | |
| repository | https://github.com/raoz/odrive-messages |
| max_upload_size | |
| id | 1932825 |
| size | 40,790 |
This is an unofficial Rust implemenation of the ODrive CAN protocol messages. This is a low-level crate, which only handles decoding and encoding the CAN Frames and does not handle sending them or waiting for responses. A higher-level crate using this one for ergonomic management of ODrives is envisioned.
This crate is not yet finished. While all the ODrive CAN protocol messages are supported, the interface this crate provides is not yet final and may change. In particular, the error handling is currently not particularly good.
no-stdRxSdo and TxSdo messagesThe crate provides top-level methods for generating CAN frames, which can be sent using any can_embedded compatible crate; for example socketcan on Linux. To parse CAN messages, one can use the top-level parse_frame function or messagess::CanMessageWithId::from_frame directly.
Example using socketcan:
let socket = socketcan::CanSocket::open('can0')?;
socket.set_read_timeout(Duration::from_millis(200))?;
socket.write_frame(odrive_messages::query_all_addresses());
loop {
match socket.read_frame() {
Ok(frame) => {
println!("{:?}", odrive_messagess::parse_frame(frame));
}
Err(e) => {
eprintln!("{e:?}");
break;
}
}
}
This crate is published under the MIT License.