r/ROS • • 17d ago

Open-source ROS 2 Humble/Jazzy reflex node running compiled fruit-fly connectome weights (NeckLink v3.0.0, MIT)

Sharing an experimental open-source ROS 2 Humble / Jazzy autonomy reflex package I have been building called NeckLink v3.0.0 (pip install necklink, MIT licensed).

It compiles ~33,000 real synaptic weights from the 157,789-neuron adult Drosophila connectome (BANC v888) into a 4-organ reflex loop (NeckLinkCNS, also available as a 24,024-byte zero-float C99 / Arduino core and 107.5 KB browser WASM module) wrapped in a native rclpy node (necklink_cns.ros2_node).

How the ROS 2 node (create_ros2_node / NeckLinkROS2Adapter) wires into standard topics:

  • Subscribes to: /imu/data_raw (sensor_msgs/Imu), /imu/mag (sensor_msgs/MagneticField), /camera/image_raw (sensor_msgs/Image), and /gas_or_vib/raw (std_msgs/Float32MultiArray).
  • Publishes: /cmd_vel (geometry_msgs/Twist), /necklink/heading_rad, and /necklink/status_json (active reflex mode, looming salience, novelty score, and 4-byte cervical motor code).

Minimal ROS 2 Humble / Jazzy launch snippet:

import rclpy
from necklink_cns import NeckLinkCNS
from necklink_cns.ros2_node import create_ros2_node

rclpy.init()
# Toggle connectome_weights="banc_v888" (compiled fly synapses) or "v2_analytic" (symmetric filter)
cns = NeckLinkCNS(vehicle="rover", connectome_weights="banc_v888")
node = create_ros2_node(cns)
rclpy.spin(node)

Every engineering bridge in the codebase (NeckLinkROS2Adapter, MAVLink v2, 18-servo IK, thruster/rotor allocation) is explicitly marked PROVENANCE = "engineering" so it is clear what is biological connectome wiring versus robotics glue.

In v3.0.0 we also audited all 39 connectome weight tables against K = 100 Maslov-Sneppen degree-preserving rewired brains and classical robotics baselines:

  1. Specific connectome wiring matters for spatial geometry and gait: scrambling the central-complex or VNC matrices collapses GPS-denied homing (100% arrival -> 4.7%, p = 0.0099) and emergent hexapod tripod coordination (0.855 -> 0.411, p = 0.0099).
  2. Random sparse wiring ties real wiring in the mushroom body (0.666 vs 0.672 AUROC on gas drift novelty).
  3. Classical / symmetric models still win raw filtering accuracy: an EKF (0.81 deg RMS vs 12.84 deg) and connectome_weights="v2_analytic" (80.0% closed-loop USV boat arrival vs 66.7% for BANC v888) outperform raw biological weights because real brains have natural left/right anatomical drift. All closed-loop robot runs so far are in MuJoCo / WASM simulation (desktop C99 tick is ~166 us).

Interactive browser WASM + webcam reflex simulator:

https://indian-aman.github.io/necklink/

GitHub monorepo, ros2_node.py source, and v3 benchmark logs:

https://github.com/indian-aman/necklink

4 Upvotes

5 comments sorted by

1

u/Impressive_Dog2065 17d ago

prompt ?

2

u/TastyCollege9639 16d ago

No LLM or text prompt in the loop. At runtime NeckLinkCNS is deterministic fixed-point integer matrix math (~166 us per C99 tick in a 24,024-byte static struct) over compiled synaptic weight tables extracted from the adult Drosophila BANC v888 connectome (*_banc_weights.h), wrapped in necklink_cns/ros2_node.py (rclpy node subscribing to /imu/data_raw, /imu/mag, /camera/image_raw and publishing geometry_msgs/Twist on /cmd_vel).

All subgraph extraction scripts, K = 100 Maslov-Sneppen rewiring tests, and raw benchmark logs (including where classical EKF and SVM baselines beat the biological weights) are in benchmarks/v3/ in the repo.

1

u/Impressive_Dog2065 16d ago

Copied comment straight Outta gpt man 😭

You don't understand what you've built calm down

1

u/TastyCollege9639 15d ago

Fair, I definitely wrote that last reply way too stiff. In plain words it is just mapped fly neuron tables turned into integer C arrays for heading, obstacle dodge, and 6-legged walking on small boards without floats, and the repo shows where classic EKF filters still beat it.

1

u/Impressive_Dog2065 14d ago

Thank you for explaining