Worm Brain Simulator

Simulate a worm brain with the GoPiGo or GoPiGo3 and a Raspberry Pi.

7. The Code

The above section is all boiled down into a simple Python2 program that can be found on github.

For the GoPiGo3 and Python3 version using Raspbian for Robots, the program is to be found on your SD card in /home/pi/Dexter/GoPiGo3/Projects/Connectome and is named GoPIGo3Connectome.py. It is possible you will need to refresh your SD card (detailed in step 9) It is also available on github and there is also a jupyter notebook version for DexterOS.

The Python program uses a Postsynaptic dictionary based on the C. Elegans Connectome Model. The code (or model if you will) starts with almost 5000 lines of definitions of neurons.

These definitions make up the brain library, and simulate what each neuron is doing, when. The “neurons” are all interconnected.

As the GoPiGo wheels around, the Ultrasonic Sensor is checked for distance. If food is detected, this counts as a simulation.

Note that the GoPiGo2 uses an ultrasonic Sensor and the GoPiGo3 uses the distance sensor.



Tags: