feagi-sensorimotor
Peripheral Nervous System (PNS) - Data processing, caching, and neuron voxel encoding for FEAGI agents
Overview
feagi-sensorimotor provides the foundational components for building FEAGI connector agents. This crate includes data processing pipelines, caching mechanisms, and neuron voxel encoding/decoding for various data types. It serves as the "Peripheral Nervous System" layer, handling sensory input processing and motor output encoding.
Features
- Data Processing Pipelines: Composable stages for transforming sensory data
- Caching Systems: Efficient per-channel stream caches for sensory and motor data
- XYZP Encoding/Decoding: Convert between data types and neuron voxel representations
- Image Processing: Segmentation, transformation, and quick-diff algorithms
- Multiple Encoding Schemes: Linear and exponential encoding for 1D-4D data
- Type-Safe Pipeline: Strongly-typed pipeline stages with validation
Installation
Add this to your Cargo.toml:
[]
= "2.0.0"
= "0.0.1-beta.1"
= "0.0.1-beta.1"
Usage
Data Processing Pipeline
use PipelineStage;
// Create a pipeline for image processing
let pipeline = vec!;
// Process data through the pipeline
for stage in &pipeline
XYZP Encoding
use Percentage1DLinear;
use Percentage;
// Encode a percentage value as neuron voxels
let encoder = new;
let percentage = new?;
let voxels = encoder.encode;
Sensory Device Cache
use SensoryChannelStreamCaches;
// Create a cache for sensory data streams
let mut cache = new;
// Cache data for a sensor
cache.update;
// Retrieve cached data
let data = cache.get?;
Image Segmentation
use SegmentedImageFrame;
// Segment an image into regions
let segmented = from_image_frame?;
// Access individual segments
for segment in segmented.segments
Supported Encodings
Linear Encodings
- 1D: Single value → voxel line
- 2D: (x, y) coordinates → voxel plane
- 3D: (x, y, z) coordinates → voxel cube
- 4D: (x, y, z, intensity) → voxel hypercube
Exponential Encodings
- Higher resolution near zero
- Suitable for non-linear sensory data
- Available for 1D through 4D
Specialized Encodings
- Boolean: On/off states
- Cartesian Plane: 2D position tracking
- Gaze Properties: Eye tracking data
- Misc Data: Generic key-value pairs
Pipeline Stages
Available pipeline stages:
- Identity: Pass-through (no transformation)
- ImageSegmentor: Divide image into grid segments
- QuickDiff: Motion detection via frame differencing
- ImageTransformer: Scale, rotate, crop operations (disabled)
- Ranges: Value range mapping (disabled)
- RollingWindows: Temporal aggregation (disabled)
Documentation
For detailed API documentation, visit docs.rs/feagi-sensorimotor.
Examples
See the examples/ directory for complete examples:
segmented_video_stream.rs: Video processing with segmentation
Part of FEAGI Ecosystem
This crate is part of the FEAGI project:
- Main Project: feagi
- Data Structures: feagi-data-structures
- Data Serialization: feagi-serialization
- Agent SDK: feagi-agent
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Contributing
Contributions are welcome! Please see the main repository for contribution guidelines.
Links
- Homepage: https://feagi.org
- Repository: https://github.com/feagi/feagi-core
- Documentation: https://docs.rs/feagi-sensorimotor
- Issue Tracker: https://github.com/feagi/feagi-core/issues