How shadowc707/chong-fly works
Chong Fly builds biologically grounded drone autopilots from a Drosophila connectome, then evaluates and targets them for flight. The primary workflow extracts or synthesizes circuit topology, reduces it into deployable matrices, constructs a CfC policy, and closes the loop through simulated sensors, flight dynamics, and PWM control. Optimization and edge export are supporting branches. The README documents broader circuit and deployment capabilities; some implementations were not sampled, so uncertain wiring is omitted.
Main entry points: drone_env.py Drone environment · policy.py Sensor-to-PWM policy · evaluate.py Behavior evaluator · circuit_extractor.py Circuit extraction
Components 24
Circuit modeling
- Circuit extraction
generator/circuit_extractor.py - Cell mapping
configs/cell_mapping.json - Connectome topology
data/raw_connectome - Graph reduction
generator/graph_reducer.py - Reduced matrices
data/reduced_models
Neural autopilot
- Biological CfC core
core/models.py - Sensor-to-PWM policy
simulation/policy.py
Flight simulation
- Optical flow sensor
simulation/pmw3901_emulator.py - Drone environment
simulation/drone_env.py - PID flight control
simulation/avionics_filter.py - Drone interface
simulation/drone_interface.py - Flight memory
simulation/memory.py - Flight metrics
simulation/metrics.py - Simulation HUD
simulation/isaac_hud.py
Optimization
- Behavior evaluator
optimizer/evaluate.py - CMA-ES tuner
optimizer/cma_es_tuner.py - Optuna tuner
optimizer/optuna_tuner.py - Policy pretraining
optimizer/pretrain.py
Edge deployment
- ONNX exporter
edge/exporter/export_onnx.py - Model quantizer
edge/exporter/quantizer.py - C code generator
edge/exporter/codegen_c.py - Embedded runtimes
edge/embedded
Other components
- Engineer / operator
- FlyWire CAVE
Connections 29
- Engineer / operator → Circuit extraction: starts extraction
- Circuit extraction → Cell mapping: reads config
- Circuit extraction → Connectome topology: writes topology
- FlyWire CAVE → Circuit extraction: supplies connectome
- Engineer / operator → Graph reduction: runs reduction
- Graph reduction → Connectome topology: reads topology
- Graph reduction → Reduced matrices: writes matrices
- Engineer / operator → Sensor-to-PWM policy: selects policy
- Sensor-to-PWM policy → Reduced matrices: loads model metadata
- Sensor-to-PWM policy → Biological CfC core: runs neural core
- Optical flow sensor → Sensor-to-PWM policy: provides flow
- Drone environment → Optical flow sensor: provides flight state
- Sensor-to-PWM policy → Drone environment: sends PWM
- Drone environment → PID flight control: uses flight control
- Drone environment → Drone interface: exposes drone interface
- Drone environment → Flight memory: records state
- Drone environment → Flight metrics: reports outcomes
- Drone environment → Simulation HUD: renders simulation
- Engineer / operator → Behavior evaluator: requests evaluation
- Behavior evaluator → Drone environment: evaluates in simulation
- Behavior evaluator → Sensor-to-PWM policy: runs policy
- CMA-ES tuner → Behavior evaluator: scores candidates
- Optuna tuner → Behavior evaluator: scores trials
- Policy pretraining → Sensor-to-PWM policy: trains policy
- Engineer / operator → ONNX exporter: exports model
- Engineer / operator → Model quantizer: quantizes model
- Engineer / operator → C code generator: generates C
- ONNX exporter → Embedded runtimes: targets runtime
- C code generator → Embedded runtimes: targets runtime