So, back in January (really??! – where did that time go?!) I met Mat from OhbotRobot at the BETT 2016 show at Excel in London whilst I was helping out on the Raspberry Pi ‘Robot Pod’ – which was really very cool, more details here if you’re interested.
A few weeks later Mat offered to send me an Ohbot to have a go with. The Ohbot runs on a PC with its own Scratch-like interface that allows you to control the robot. I wanted to see if I could convert the robot to run on a Raspberry Pi. I removed the board that came with it and replaced it with the Adafruit 16 Servo Controller board which works very well and runs Ohbot’s 7 servos very nicely. I worked out the maximum and minimum positions for each of the servos which meant I could then control the full range of movement.
Once I’d got the motion sorted, I really wanted to get the bot speaking as this is fairly central to its appeal. I have used the Festival TTS (text to speech) engine on the Pi for some previous projects but this one required a whole lot of learning. So, there are 44 phonemes (sounds) in spoken English, which in itself’ is fascinating I think. These can be mapped to visemes, which is the mouth position for each sound. There are less visemes than phonemes as some sounds use the same mouth shape – try it!
After much searching and head scratching, I found that Festival can generate a viseme file and an associated audio file for any piece of text. I took the visemes returned by Festival, and mapped these to mouth positions for the Ohbot – with some help from Mat it must be said! aplay is then used to play the audio file in synch with the mouth movements. I wrote a simple control script that can take any text and the Ohbot will read it out for you.
I’ve had fun before playing with the Raspberry Pi and different APIs. These give the ability to add some seriously complex functionality with very little programming required. Using the Google Speech API it is possible to do very accurate speech recognition on the Pi at not too slow a pace. This great piece of work was originally reverse engineered from the Chrome API by Gilles Demey. Full project here Further, you can use the Wolfram Alpha API to answer questions programmatically. Those two APIs combined give you the skeleton for a nice AI based chat bot running on the Pi.
Added to the work I have already done on the Ohbot, I am extremely pleased with the results thus far. The round trip time for the ‘Ohbot Oracle’ to answer a question is about 7-8 seconds and the range of information that can be pulled from Wolfram is simply vast.
The Raspberry Pi Ohbot Oracle in action….
I’ve also been working on integrating the Twitter API and make get the OhBot to read out the tweets. This I have also done before using the Tweepy API for Python which is really straightforward to use.
I’ll keep developing this further, I’ll keep you posted!
Ohbot will be coming out to play at the next Cotswold Jam on Saturday 2nd July – hope to see some of you there.
Until next time…