Skip to main content

Crate can_motor_control

Crate can_motor_control 

Source
Expand description

Cross-platform robot control for CAN motors using the target’s native hardware transport.

This crate is intentionally vendor-agnostic above the codec seam: it depends only on the [motor_codec] trait crate, never on a specific vendor codec.

Re-exports§

pub use bus::Bus;
pub use bus::RouteKey;
pub use config::CodecFactory;
pub use config::CodecRegistry;
pub use config::MotorTypeParser;
pub use error::Error;
pub use group::Arm;
pub use group::Generic;
pub use group::Gripper;
pub use group::GroupKind;
pub use group::MitCmd;
pub use group::MotorGroup;
pub use group::PosForceCmd;
pub use group::PosVelCmd;
pub use group::VelCmd;
pub use motor::FaultCode;
pub use motor::Motor;
pub use robot::Robot;
pub use robot::RobotBuilder;
pub use spec::GripperOpeningSpec;
pub use spec::GroupSpecKind;
pub use spec::MotorSpec;
pub use spec::OpeningDirection;
pub use transport::SocketCanBus;
pub use transport::BusPoller;
pub use transport::CanBus;
pub use transport::MockCanBus;
pub use transport::MockRecordedCall;
pub use transport::TransportError;

Modules§

bus
Bus = transport + codec + per-bus recv-id routing table.
config
TOML config schema, loader, and vendor codec registry.
error
Layered error type for the can-motor-control crate.
group
Group types: MotorGroup base + Arm, Gripper, Generic newtypes and the GroupKind dispatcher.
motor
Per-motor identity and state cache.
robot
Robot and RobotBuilder.
spec
Builder input types.
transport
CAN transport abstraction.

Structs§

BusCapabilities
Runtime feature set of a CAN transport.
CanFrame
Unified CAN frame: covers both classical CAN (8-byte payload) and CAN-FD (up to 64-byte payload).
FrameFlags
Metadata bits attached to every CanFrame.
Limits
Per-motor-type physical limits used to scale MIT commands and unscale state replies.
MotorRef
Borrowed view of a motor’s identity, suitable for passing into codec encode methods without taking ownership of the motor’s mutable state.

Enums§

CodecError
Errors returned by MotorCodec implementations.
Command
A control command directed at a single motor.
CommandKind
Tagged discriminant of Command, suitable for error-reporting “this codec does not support mode X”.
Event
A decoded inbound message from a motor.
FrameError
Errors that can arise constructing a CanFrame.
MotorTypeId
Vendor-tagged motor type identifier.
ParamValue
Union of value encodings used by vendor parameter sub-protocols.

Traits§

MotorCodec
The vendor-agnostic codec contract.