Expand description
Sensorimotor Weave — hardware I/O abstraction for embodied AI.
Provides a framework for connecting sensors and actuators to the cognitive substrate via a unified trait interface. Inspired by:
- copper-rs: deterministic Rust robotics with sub-microsecond IPC
- dora-rs: dataflow-oriented robotic architecture (Zenoh SHM)
- v1 WhiteMagic: embodiment.py HarmonyMonitor, physical_metrics.py
Architecture: Sensor → SensorReading → SensorimotorBus → ActuatorCommand → Actuator
The SensorDevice and ActuatorDevice traits are designed to be
implementable via C-ABI FFI (feature-gated hardware feature) so that
real hardware drivers can be linked without polluting the core crate.
When the hardware feature is disabled, all operations are stubbed
with sensible defaults — the framework is fully testable on any machine.
Structs§
- Actuator
Command - A command to an actuator.
- CpuFreq
Sensor - Sensor that reads CPU frequency from
/sys/devices/system/cpu. - CpuUsage
Sensor - Sensor that reads CPU usage percentage from
/proc/stat. - Disk
Usage Sensor - Sensor that reads disk usage percentage for a given mount point.
- Network
Throughput Sensor - Sensor that reads network throughput from
/proc/net/dev. - Procfs
Sensor - Sensor that reads a value from a
/procfilesystem file by parsing a key-value format. - Reflex
Loop - A reflex loop manager that evaluates rules against sensor readings.
- Reflex
Rule - A simple reflex loop that polls sensors and triggers actuator commands when sensor values cross thresholds.
- Sensor
Reading - A single sensor reading with timestamp.
- Sensorimotor
Bus - The central bus connecting sensors and actuators to the cognitive system.
- Stub
Actuator - Stub actuator that accepts all commands. Used for testing.
- Stub
Sensor - Stub sensor that returns a fixed value. Used for testing and when
the
hardwarefeature is disabled. - Sysfs
Actuator - Actuator that writes a value to a
/sysfilesystem file. - Sysfs
Sensor - Sensor that reads a single value from a
/sysfilesystem path.
Enums§
- Actuator
Kind - Type of actuator output.
- Sensor
Kind - Type of sensor reading.
Traits§
- Actuator
Device - Trait for actuator devices.
- Sensor
Device - Trait for sensor devices.
Functions§
- discover_
battery_ sensors - Auto-discover battery sensors on Linux.
- discover_
fan_ actuators - Auto-discover fan PWM controllers on Linux.
- discover_
led_ actuators - Auto-discover LED controllers on Linux.
- discover_
thermal_ sensors - Auto-discover available thermal zones on Linux.
- linux_
hardware_ bus - Create a
SensorimotorBuspre-populated with all discovered Linux hardware sensors.
Type Aliases§
- Sensor
Parser - Parser function type for extracting a sensor value from file contents.