clankeRS is a Rust SDK for robotics teams on ROS 2 and PyTorch. Build memory-safe robot nodes, run ONNX inference in Rust, replay MCAP logs in tests, and ship with confidence — without replacing your existing stack.
Install
# Cargo.toml
= "0.1"
Requirements: Rust stable. First build downloads the ONNX Runtime binary automatically (network required).
For scaffolding and tooling, install the CLI separately (clankers new bundles templates — no clone required):
Quick example
A minimal perception node: subscribe to camera frames, run ONNX with zero-copy inputs, publish detections.
use *;
async
Replay-test against a recorded MCAP log:
use *;
async
What you get
One dependency pulls in the full SDK surface:
| Module | Highlights |
|---|---|
clankers::ros2 |
RobotNode, pub/sub, ImageMsg, DetectionArray, QoS profiles |
clankers::ml |
Optimized Model inference, backends, validation |
clankers::tensor |
TensorView zero-copy views, ImageTensor preprocessing |
clankers::data |
MCAP Replay, logging, inspection |
clankers::recording |
McapRecorder — tape node I/O to MCAP via [logging] record_mcap |
clankers::testing |
ReplayContext, replay assertions |
clankers::runtime |
RobotRuntime, metrics, scheduling |
clankers::geometry |
TfBuffer frame lookups, Isometry, Pose, Twist |
clankers::prelude |
Common imports for everyday node code |
The workflow
PyTorch model
│
▼
ONNX export ──► reference outputs (offline)
│
▼
Rust ONNX inference (clankers-ml)
│
▼
MCAP replay test (clankers-testing)
│
▼
deploy as a ROS 2 node
Honest scope (v0.1.6)
- Sim pub/sub works out of the box — no ROS 2 install required for development and tests.
- Recording is real —
[logging] record_mcap = true(orclankers record) tapes configured topics to a replayable MCAP, finalized on exit or Ctrl-C. - Real DDS /
rclrsis available from the GitHub repo as colcon packages underros2/(ROS 2 Humble). It does not ship through this crate. - C++ inference —
clankers-ffi+cpp/wrap the sameInferenceEngineas Rust. An rclcpp perception node is planned next. - APIs are early — expect changes before v1.0.
Learn more
License
MIT — see LICENSE.