Wow - discovered that every GoPiGo3 has a C. Elegans worm in its brain!
Well, in the GoPiGo3/Projects/Connectome folder, and we can put the code into our GoPiGo3 robot’s “brain” to run a (sequential) neural net simulating the “mind of the C. Elegans worm”.
I added speech and Dave immediately began annoying me with his “worm thoughts”.
The original was written when only the Raspberry Pi B+, single core processor was available, and the CEO/Pres of DexterIndustries attempted an “experimentalOptimization”, which indeed has a faster cycle time, but Dave mainly sits announcing the amount of food in his virtual stomach more than pleasant to hear or watch.
When Dave’s “worm brain” first finds the food, it seems to pound Dave’s nose into the food (wall) risking a motor stall, so I have to keep “pulling the worm out of his brain”.
If he keeps this up Dave’s head is going to have worms coming out like Carl’s has been for the last eight years:
FYI, Dalhousie University in Halifax, Canada, has been using the Jupyter Notebook version with their Masters students. Well, I dont know if they still do, but they did for a couple of years at least.
I’m going to have to resurrect my mock_easygopigo3.py module from 2016-2017. I used it with my RugWarriorPro robot before I bought my first GoPiGo3. The “worm” only uses the distance sensor read() and a few motor calls. I can simulate the motor calls, and ask for a distance sensor reading, I think, and the “worm” will never know it isn’t running on a GoPiGo3.
The program has a “Comment sections out to run without GoPiGo3” but I prefer not to mess with the code until I can see it running.
Same behavior: When it touches some food (dist < 100 or 200cm), it stops for a few “bites or smells”, then slowly starts toward the food, and then races forward jamming its nose against the food. Might work for a worm, but very disturbing robot behavior!
Actually I haven’t the slightest idea what the outputs are saying, or what the worm is “thinking”.
And when the worm is given a 0 distance, it reads one more time, and if again 0, the worm explodes!
Little terrorists they are.
OBSTACLE (Nose Touch) dist:15.0
Left Eye on (40, 10, 10) Right Eye On (40, 10, 10)
Left: 0 Right: 0 Speed: 150
Left Eye on (5, 5, 5) Right Eye On (5, 5, 5)
My analysis of the Connectome C. Elegans simulation with the GoPiGo3 robot.
First we should define the expected behaviors (Google Search edited for applicability):
C. elegans is a millimeter-long soil nematode with a remarkably simple, mapped nervous system (302 neurons). Its behavioral repertoire is highly stereotyped, primarily consisting of sinusoidal locomotion, foraging, feeding, and basic sensory responses. [1, 2, 3, 4, 5]
Explore its specific behaviors in greater detail:
Locomotion and Movement
Sinusoidal Crawling:C. elegans moves by propagating rhythmic, dorsoventral muscle contractions along its body, resulting in an “S-shaped” or sinusoidal wave pattern. [1, 2, 3]
Foraging: When searching for food, the worm exhibits ** klinotaxis**, sweeping its head from side to side to detect chemical gradients, before turning sharply to adjust direction. [1, 2, 3, 4, 5]
Reversal and Omega Turns: Upon encountering aversive stimuli, it initiates an “omega turn” (bending into a sharp U-shape) or a reversal (backing up) to change its heading. [1]
Sensory and Avoidance Responses
Chemosensation & Olfaction: Its primary senses are chemical and olfactory. It relies on these to find nutrient-rich bacterial patches and to navigate away from noxious chemicals or pathogens. [1, 2]
Mechanosensation: The worm responds to touch. A gentle tap on the head causes it to reverse, while a tap on the tail prompts forward acceleration. It also exhibits proprioception, sensing its own body position. [1, 2, 3, 4, 5]
Feeding Behaviors
Pharyngeal Pumping: The worm feeds on bacteria by using a muscular organ called the pharynx. It utilizes “pumping” (rapid suction and relaxation) to draw liquid and bacteria into its mouth, grinding the food before passing it to the intestine. [1, 2]
Quiescence: When food is plentiful, the worm will eventually become satiated, slowing or halting its pumping and locomotion in a sleeplike state
The GoPiGo3 Simulation:
A great simulation of C. Elegans with the GoPiGo3 robot
would use a panning servo mounted distance sensor to simulate the scanning motion of the head
would perhaps differentiate food from obstacles/adversaries (when satiated/not moving):
small sweep angle distance constant = obstacle
small sweep angle distance decreasing = adversary
large sweep angle distance constant = food field
would simulate forward motion by forward motion by arcing slowly
The existing code runs on a basic GoPiGo3 with a Distance Sensor (not servo mounted).
The Connectome code appears to try to simulate the moving phase (not well), and the satiated phase (very boring, and not sure what behaviors can be triggered). I cannot understand the nose touch being a long distance, and cannot figure out the emerging behaviors from sensor input.
I’m tempted to increase or maybe even remove the time limits on the motion commands, and see if the robot will simulate the undulating worm motion. I need to time the computation loop, to see how the robot would be driving blind. It seems like the motion time limits are way too short.
(I also cannot copy out the Jupyter print output more than the run window height even though it is scrollable and the text is selectable, I cannot copy the selected output to the clipboard.)
Reviewing the original GoPiGo code, explains the “boring” aspect. The original code was all about moving, while the GoPiGo3 code has a stop() everywhere there is a “go thought” making the loop time 4 seconds long.
I’m going to leave further explorations into “thinking like a worm” to the next person to “dig the nematodes out of the dirt”.