Robot behaviors can be enriched with an emotional component. It cannot rival affective mind architectures, but will provide a wide variety of reliable and less repetitive behaviors. Some emotional systems are based on dimensional theories of emotion, in which affective states are not only represented as discrete labels (like fear or anger), but as points or areas in a space equipped with a coordinate system. Emotions which can be directly represented in this space are called primary (basic). Some theories also introduce secondary emotions which are a mixture of two or more basic ones. The most popular theory in this group is PAD, proposed by Mehrabian and Russell, whose name is an abbreviation of three orthogonal coordinate axes: Pleasure, Arousal, Dominance.


The implementation of dynamic PAD-based model of emotion is centered around the assumption that our emotional state is similar to the response of a dynamic object. Experience suggests that our emotions expire with time, so this dynamic object should be stable. Inputs of emotional system are called attractors. According to the aforementioned intuitions, the module implements emotional system as an inertial first, second or third order element with programmable time constants and gain. All input vectors are linearly transformed to three dimensional PAD space. Output of the module is the robot's mood defined as the integral of all emotional impulses over time.


Module functions - initialize module and load config file if it exists; otherwise load default settings,
UPAD.setPort(portName, paramCnt, matrix) - creates a new port named portName with paramCnt inputs. Matrix describes transform form port input to PAD space (ie. matrix size must be 3 x paramCnt),
UPAD.removePort(portName) - removes port portName,
UPAD.removeAllPorts() - removes all ports,
UPAD.printPortTransform(portName) - prints portName transform matrix on standard output,
UPAD.printPorts() - prints the names of all ports with the number of input parameters on standard output,
UPAD.setStaticPADVerbose() - set PAD module into verbose mode, 
UPAD.setStaticPADQuiet() - set PAD module into quiet mode, 
UPAD.setPortTransform(portName, matrix) - change existing port transform matrix,
UPAD.input(portName, args, time_duration) - gives input parameters for portName port in PAD module,
UPAD.output() - returns current values of PAD emotions of UPAD module instance,
UPAD.outputP - returns current value of Pleasure emotion of UPAD module instance,
UPAD.outputA - returns current value of Arousal emotion of UPAD module instance,
UPAD.outputD - returns current value of Dominance emotion of UPAD module instance,
UPAD.setKeepEmotion(value) - set UPAD into Keep Emotion mode. For value=true emotions are integrated only, for value=false they are normalized (default false),
UPAD.getKeepEmotion() - returns value of keepEmotion parameter,
UPAD.setEmotionLimit(limit) - set limit for PAD values (default =1),
UPAD.getEmotionLimit() - returns value of emotionLimit parameter,
UPAD.setBoredomRatio(ratio) - set boredomRatio which controls how fast emotions are decreased to 0. boredomRatio can be set in [0, 1000) range. Value 0 means that emotion is not changing (=model is not bored in current emotional state), value 999 is set for extremely bored UPAD, default value =100,
UPAD.getBoredomRatio() - returns value of boredRatio parameter,
UPAD.setTimeInterval(intervalInSecs) - set length of time interval for dynamic object calculations,
UPAD.getTimeInterval() - returns value of intervalInSecs parameter,
UPAD.setK(k) - set k parameter for dynamic inertial object,
UPAD.getK() - returns value of k parameter,
UPAD.setT1(T1) - set T1 parameter for dynamic inertial object,
UPAD.getT1() - returns value of T1 parameter,
UPAD.setT2(T1) - set T2 parameter for dynamic inertial object,
UPAD.getT2() - returns value of T2 parameter,
UPAD.setT3(T1) - set T3 parameter for dynamic inertial object,
UPAD.getT3() - returns value of T3 parameter,
UPAD.printState() - prints the state of UPAD parameters on standard output,
UPAD.loadIni(iniFileName) - loads setting from INI file.

Urbiscript example

var Global.pad =;
pad.setPort("ANEW", 3, [[1,0,0],[0,1,0],[0,0,1]]);
pad.setPort("SentiWordNet", 3, [[1,-1,0],[0,0,1],[0,0,0]]);
pad.input("ANEW", [1,2,3]);
tag1:every(5s) {
pad.input("SentiWordNet", [10, -5, 2]);
tag2:every(1s) {





EMYS and FLASH are Open Source and distributed according to the GPL v2.0 © Rev. 0.8.0, 27.04.2016

FLASH Documentation