kcan
CAN controller primitives and CLI tools for actuator and motor control.
Status
Published by Trevor Knott, Knott Dynamics.
Keywords: KCAN, CubeMars, RobStride, Scrin, Aisling, Trevor Knott, Knott Dynamics.
Features
- MIT force-control frame packing for supported CubeMars AK actuators.
- CubeMars direct servo command builders.
- Feedback decoding, tuned specs for primary AK models, conservative defaults for other AK names, unit conversions, and safe velocity clamping.
- Generic
CanBustrait for tests, embedded adapters, or Linux SocketCAN. - Optional
serdefeature for serializable actuator configs, snapshots, commands, and feedback. - Optional
socketcanfeature for direct Linux SocketCAN usage. - Optional
tuifeature for a Scrin/Scrin Widgets actuator dashboard, wide actuator pane wall, read-only telemetry analytics, and safe control-intent model. - Cross-family actuator snapshots with derived health labels and protocol-specific dashboard metrics.
- CAN monitor utilities for rolling frame logs, trace CSV export/replay, basic protocol classification, data formatting, and Scrin/Aisling TUI viewing.
kcancommand for model listing and frame generation.
Quick Use
For a beginner cheat sheet, see docs.md.
Build a RobStride status query frame in Rust:
use ;
let frame = robstride_status_query_frame?;
assert_eq!;
assert_eq!;
# Ok::
Build a CubeMars MIT neutral frame in Rust:
use ;
let frame = mit_command_frame?;
assert_eq!;
assert_eq!;
# Ok::
Run the CLI help:
List supported models:
Build a CubeMars direct velocity frame:
Build a RobStride status query frame:
Enable SocketCAN support with:
= { = "0.1", = ["socketcan"] }
Run the sample TUI dashboard with:
List supported CubeMars models and generated frame IDs with:
Print hardware-free CubeMars direct frames:
Print hardware-free RobStride frames:
Run a simulated CAN monitor with:
Run a live SocketCAN monitor with:
Run a live read-only actuator dashboard with CubeMars and RobStride targets: