I should have expected Carl to be confused when I started telling him “Marvin Be Quiet”, and “Marvin You Can Talk Now”. (The Nyumaya hotword engine only recognizes “Marvin”, “Sheila”, “Firefox”, or “Alexa” so I chose “Marvin” until the “Hey Carl” model arrives.)
Turns out Carl has full fledged Multiple Personality Disorder.
First came the issue of backing onto the dock with the drive_cm() method not returning. Several times I found Carl on his dock, but he was totally unresponsive. It turned out I needed a drive_cm() with a timeout. I created a custom my_easygopigo3.drive_cm(distance, timeout=60) that would always return even if the last encoder tic of backing onto the doc was blocked.
Carl’s life would have been fine if I had not wanted to add an Inertial Measurement Unit to him. For that I had to create a thread safe my_safe_inertial_measurement_unit.py and my_inertial_management_unit.py package.
And since the IMU maintains state I also needed to create a “no initialization” feature so that a second process could read the IMU without re-initializing it out from under the first process’s configuration.
Next came wanting to leave the battery and docking management process running 24/7, but be able to run other processes during Carl’s playtime. Well Carl likes his speed to be a constant 150 degrees per second where his 180 degree turns are most accurate, but when a second process initializes its EasyGoPiGo3 object, the speed gets reset back to 300 DPS, even if that process only plans to check the battery voltage and quit.
The answer was to create a special noinit_easygopigo3.py and noinit_gopigo3.py with the option noinit=True in the EasyGoPiGo3 and GoPiGo3 class initializations, just like I had done for the IMU.
And finally while testing my Braitenberg Vehicles with the EasyPiCamSensor class I created, I discovered that the easygopigo3.EasyGoPiGo3().steer(left_percent, right_percent) had a defect, so I created another easygopigo3.py with only that change.
Today when I was working on my voice command program and wanted to change the eyes color to indicate that Carl was waiting for the “Marvin” hotword (light blue), or waiting for a voice command (bright blue), or didn’t understand the command (light red), or actually did understand (light green), I needed to choose one of the four easygopigo3 versions:
- Dexter/ModRobotics official easygopigo3
- my_easygopigo3 - with drive_cm timeout
- noinit_easygopigo3 - with noinit=True feature
- Projects/EasyPiCamSensor/easygopigo3 - with fixed steer function
The best choice was noinit_easygopigo3 so the voice commander would not reset Carl’s docking speed setting, and that is how I coded it.
Of course, after I got it recognizing the “Marvin” hotword, recognizing some voice commands, and showing the pretty colors, I wanted to make the voice commands actually do some Carl functions. Oops, the “easygopigo3” init_servo() method is objecting with “TypeError: Us a GoPiGo3 object for the gpg parameter” in easysensors.py
Carl is confused. I’m confused. This was supposed to be “Easy(GoPiGo3)”.
And Carl needs a therapist for his multiple personality disorder!