Friday, November 28, 2014

Emotion, fear, reflex

A Lego NXT robot can be given an innate fear of heights using code like:

#define USONIC     IN_1
#define WHEELS    OUT_AC
.....
.....
#define CLIFF_DETECTED (SensorUS(USONIC)>35)
.....
.....
if (CLIFF_DETECTED)
{
   AvoidCliff();
}
.....
.....
sub AvoidCliff()
{
    Off(WHEELS);
    RotateMotorEx(WHEELS,80,550,-100,true,true);
    OffEx(WHEELS,RESET_ALL);
}

I have experimented with 5 mobile robots which were given a fear of heights in order to prevent them from falling down stairs or off of a tabletop.  Of course we can arrange for fear to be modulated by other cognitive processing.

No comments:

Post a Comment