Arkwood was in bits again. Pieces of insecure flesh and bone. And all because Daphne – the plump spotty girl who works down the chippy – had dumped him.
‘She said I was not emotional enough!’ he cried. Apparently, Wayne the deep fat frier is busy filling her spiritual hole. With a fish supper no doubt.
‘Don’t worry,’ I said, ‘my little robots will teach you how to show emotion. You will soon win her back!’
First, the robots must respond with oodles of happiness when I give the friendly Okay hand gesture:
Next, the robots must respond with furious anger when I brandish the hostile Vicky hand gesture:
I updated SaltwashAR, my Python Augmented Reality application, and here’s the results:
Fantastic. Whenever I give a robot the Okay hand gesture it bobs its head up and down with joy, its eyes going all starry with delight. But if I brandish the Vicky hand gesture it spins its head in rage, its eyes a demonic red.
‘You see, Arkwood. If you show Daphne this sort of emotion she’ll soon swoon back into your arms!’
Arkwood agreed, and began to copy the robot’s emotional outbursts. He cranked his head up with happiness. He spun with head in fury. But sadly it only resulted in an ambulance trip to A&E with neck muscle strain.
I added each emotion to my robots by importing 10 frames of Blender animation into SaltwashAR as per my post Blender animation in OpenGL (Mark II).
Here’s the animation being linked into the Rocky Robot class:
self.head_happy_frames = rocky_robot_head_happy_frames(is_animated) self.head_angry_frames = rocky_robot_head_angry_frames(is_animated)
I then integrated emotion into the hand gesture feature introduced in post Augmented Reality with hand gestures.
Here’s the appropriate emotion being triggered for the detected hand gesture:
# respond to hand gesture if is_okay: self._text_to_speech("Hi there, buddy") self._display_emotion(HAPPY) elif is_vicky: self._text_to_speech("Well, there is no need to be so rude!") self._display_emotion(ANGRY)
I ran the code on my Windows 7 PC using Python Tools for Visual Studio.
Any questions, drop me a line.