A fundamental property of the future autonomous robots will be their ability to interact with humans. They will have to respond naturally to different forms of communication.
In this tutorial, you will learn how to handle another typical form of interaction with Robobo, by touching the smartphone’s screen (Robobo face), showing, in this case, how it gets angry with you.
The challenge is the creation of an angry Robobo!
Before starting this challenge, we recommend you to read the following sections of the Robobo programming manual:
CHALLENGE: ANGRY ROBOBO
Creating a program that makes Robobo react to touches on its face (Smartphone’s screen). If you touch its eye (tap), Robobo will throw its head back to escape your hand. At the same time, it will look angry and tell you not to touch the eye.
One possible solution to this challenge is the following, although there are many others. Which one is yours?
from Robobo import Robobo from utils.Emotions import Emotions robobo = Robobo('10.113.36.163') robobo.connect() robobo.resetTapSensor() robobo.setEmotionTo(Emotions.NORMAL) robobo.moveTiltTo(75 ,15) while True: robobo.wait(0.01) tap = robobo.readTapSensor(); if tap.zone == 'eye': robobo.setEmotionTo(Emotions.ANGRY) robobo.moveTiltTo(60,15) robobo.sayText('Don't touch my eye') robobo.wait(1) robobo.resetTapSensor() robobo.setEmotionTo(Emotions.NORMAL) robobo.moveTiltTo(75,15)
When you have completed the “Angry Robobo” challenge, we propose you this a new one where we complicate a little the robot reactions. The objective is to create a program in which Robobo shows different emotions depending on the area of the face you touch it (tap on the screen), for example, it should laugh if you touch the mouth, or show a surprise face if you touch the chin, saying “you tickle me”.