Skip to main content

Module sensorimotor

Module sensorimotor 

Source
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§

ActuatorCommand
A command to an actuator.
CpuFreqSensor
Sensor that reads CPU frequency from /sys/devices/system/cpu.
CpuUsageSensor
Sensor that reads CPU usage percentage from /proc/stat.
DiskUsageSensor
Sensor that reads disk usage percentage for a given mount point.
NetworkThroughputSensor
Sensor that reads network throughput from /proc/net/dev.
ProcfsSensor
Sensor that reads a value from a /proc filesystem file by parsing a key-value format.
ReflexLoop
A reflex loop manager that evaluates rules against sensor readings.
ReflexRule
A simple reflex loop that polls sensors and triggers actuator commands when sensor values cross thresholds.
SensorReading
A single sensor reading with timestamp.
SensorimotorBus
The central bus connecting sensors and actuators to the cognitive system.
StubActuator
Stub actuator that accepts all commands. Used for testing.
StubSensor
Stub sensor that returns a fixed value. Used for testing and when the hardware feature is disabled.
SysfsActuator
Actuator that writes a value to a /sys filesystem file.
SysfsSensor
Sensor that reads a single value from a /sys filesystem path.

Enums§

ActuatorKind
Type of actuator output.
SensorKind
Type of sensor reading.

Traits§

ActuatorDevice
Trait for actuator devices.
SensorDevice
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 SensorimotorBus pre-populated with all discovered Linux hardware sensors.

Type Aliases§

SensorParser
Parser function type for extracting a sensor value from file contents.