IEEE Robotics & Automation Magazine - September 2018 - 53

Passing a memory key as an argument to a branch is in
many respects similar to passing a pointer to a function in the
C++ programming language. During runtime, the code related to the targeted branches may use the key to query the
memory and use the extracted information for self-reconfiguration. As schemes may be pushed and pulled to and from the
memory at high frequencies, this may result in efficient sensory-motor couplings.
In the background, data exchange relies exclusively on
pull/push calls. But in effect, the targeting keyword
results in a flow of information from the memory to all nodes
and evaluations corresponding to the targeted branch. Via the
targeting keyword, these information flows are only
implied by the programmer and implemented transparently
by the system at runtime.
Targeting is Playful's less intuitive concept. It is based on
the triggering system, which we previously implemented in
TDM [5], here extended to behavior trees. For details related
to shared memory, the pull/push data exchange paradigm,
and encapsulation of data into schemes, we invite the reader
to consult [6]. We provide concrete instances in the "Examples" section.
Formal Syntax
Playful's syntax is formally presented in Algorithm 1. Items in
parentheses refer to content that has to be specified by the
developer, and items in brackets indicate optional content. In
bold are the supported statement keywords. Evaluations are
functions that should either return a Boolean (when associated
with whenever or if) or a float (when associated with priority of). A node is defined as a list of nodes associated
with keywords for dynamic reconfiguration and exchange of
memory keys (targeting), evaluations for setting rules of
activation (whenever, switch to), and rules of prioritization (priority of). Leaf nodes are instances of Python
objects, which interact with the middleware. Higher levels of
the tree encode the logic that monitors the leaf nodes' activation
status. They do so through evaluations and resource management (e.g., forbidding two leaf nodes from simultaneously controlling the same robot joints). If no evaluation is used and no
resource conflict is detected, each leaf node runs continuously,
concurrent with all of the other running leaf nodes.
The activation status of a node propagates to all of the
nodes of its subtree, including the leaf nodes. If a given node

is deactivated, all of the nodes in its subtrees are deactivated. If
a node is activated, the monitoring of the activation status of
its underlying nodes is delegated to their evaluations. Thus, a
change in the activation status of a node in the tree implies a
change in the pattern of activation of its underlying leaf
nodes. And because leaf nodes interface with the middleware,
a change in the patterns of activation of the leaf nodes shapes
the behavior performed by the robot.
Python for Evaluations and Leaf Nodes
Evaluations and leaf nodes are to be programmed using
the Python scripting language. Evaluations can be any
arbitrary Python statement that evaluates to either a Boolean (when associated with the keywords whenever or
if ) or a float (when connected with priority to ).
The Playful interpreter also supports simple logic and
arithmetic. For example, an evaluation may consist of the
negation of a Python function (keyword not) or the addition of a function with a number. Leaf nodes correspond
to Python objects, which must implement the specific
interface required for communication with the Playful
engine (e.g., it must implement a run function). Leaf
nodes may be considered our platform's primitives, and
the behavior tree the encoding of the logic used to orchestrate their activation during runtime. Each leaf node is
spawned in a dedicated thread running at its dedicated frequency. Playful provides an API for receiving start or stop
commands from the engine, accessing the shared memory,
and reserving or releasing resources.
Playful's Back End
The scripting language is the front end of the Playful software
platform, which is completed by the engine back end. The latter consists of two parts. First, there is the interpreter, which
creates the behavior tree and relates nodes and evaluations to
their corresponding Python code. Second, there is the engine,
which at runtime
● instantiates new branches when the memory is updated
with a new key, according to the usage of the targeting
keyword
● calls evaluations code, i.e., branches that are conditionally
evaluated as false (whenever keyword) or as not active
(switch to keyword) are sent signals to deactivate;
other nodes are sent signals to activate

Algorithm 1:
(node name):
[
[targeting (memory key):](node name)[, whenever (evaluation)][, priority of
(evaluation) if (evaluation), [...]][, switch to (node name)
if (evaluation), [...]]
[...]
]

september 2018

*

IEEE ROBOTICS & AUTOMATION MAGAZINE

*

53



IEEE Robotics & Automation Magazine - September 2018

Table of Contents for the Digital Edition of IEEE Robotics & Automation Magazine - September 2018

Contents
IEEE Robotics & Automation Magazine - September 2018 - Cover1
IEEE Robotics & Automation Magazine - September 2018 - Cover2
IEEE Robotics & Automation Magazine - September 2018 - Contents
IEEE Robotics & Automation Magazine - September 2018 - 2
IEEE Robotics & Automation Magazine - September 2018 - 3
IEEE Robotics & Automation Magazine - September 2018 - 4
IEEE Robotics & Automation Magazine - September 2018 - 5
IEEE Robotics & Automation Magazine - September 2018 - 6
IEEE Robotics & Automation Magazine - September 2018 - 7
IEEE Robotics & Automation Magazine - September 2018 - 8
IEEE Robotics & Automation Magazine - September 2018 - 9
IEEE Robotics & Automation Magazine - September 2018 - 10
IEEE Robotics & Automation Magazine - September 2018 - 11
IEEE Robotics & Automation Magazine - September 2018 - 12
IEEE Robotics & Automation Magazine - September 2018 - 13
IEEE Robotics & Automation Magazine - September 2018 - 14
IEEE Robotics & Automation Magazine - September 2018 - 15
IEEE Robotics & Automation Magazine - September 2018 - 16
IEEE Robotics & Automation Magazine - September 2018 - 17
IEEE Robotics & Automation Magazine - September 2018 - 18
IEEE Robotics & Automation Magazine - September 2018 - 19
IEEE Robotics & Automation Magazine - September 2018 - 20
IEEE Robotics & Automation Magazine - September 2018 - 21
IEEE Robotics & Automation Magazine - September 2018 - 22
IEEE Robotics & Automation Magazine - September 2018 - 23
IEEE Robotics & Automation Magazine - September 2018 - 24
IEEE Robotics & Automation Magazine - September 2018 - 25
IEEE Robotics & Automation Magazine - September 2018 - 26
IEEE Robotics & Automation Magazine - September 2018 - 27
IEEE Robotics & Automation Magazine - September 2018 - 28
IEEE Robotics & Automation Magazine - September 2018 - 29
IEEE Robotics & Automation Magazine - September 2018 - 30
IEEE Robotics & Automation Magazine - September 2018 - 31
IEEE Robotics & Automation Magazine - September 2018 - 32
IEEE Robotics & Automation Magazine - September 2018 - 33
IEEE Robotics & Automation Magazine - September 2018 - 34
IEEE Robotics & Automation Magazine - September 2018 - 35
IEEE Robotics & Automation Magazine - September 2018 - 36
IEEE Robotics & Automation Magazine - September 2018 - 37
IEEE Robotics & Automation Magazine - September 2018 - 38
IEEE Robotics & Automation Magazine - September 2018 - 39
IEEE Robotics & Automation Magazine - September 2018 - 40
IEEE Robotics & Automation Magazine - September 2018 - 41
IEEE Robotics & Automation Magazine - September 2018 - 42
IEEE Robotics & Automation Magazine - September 2018 - 43
IEEE Robotics & Automation Magazine - September 2018 - 44
IEEE Robotics & Automation Magazine - September 2018 - 45
IEEE Robotics & Automation Magazine - September 2018 - 46
IEEE Robotics & Automation Magazine - September 2018 - 47
IEEE Robotics & Automation Magazine - September 2018 - 48
IEEE Robotics & Automation Magazine - September 2018 - 49
IEEE Robotics & Automation Magazine - September 2018 - 50
IEEE Robotics & Automation Magazine - September 2018 - 51
IEEE Robotics & Automation Magazine - September 2018 - 52
IEEE Robotics & Automation Magazine - September 2018 - 53
IEEE Robotics & Automation Magazine - September 2018 - 54
IEEE Robotics & Automation Magazine - September 2018 - 55
IEEE Robotics & Automation Magazine - September 2018 - 56
IEEE Robotics & Automation Magazine - September 2018 - 57
IEEE Robotics & Automation Magazine - September 2018 - 58
IEEE Robotics & Automation Magazine - September 2018 - 59
IEEE Robotics & Automation Magazine - September 2018 - 60
IEEE Robotics & Automation Magazine - September 2018 - 61
IEEE Robotics & Automation Magazine - September 2018 - 62
IEEE Robotics & Automation Magazine - September 2018 - 63
IEEE Robotics & Automation Magazine - September 2018 - 64
IEEE Robotics & Automation Magazine - September 2018 - 65
IEEE Robotics & Automation Magazine - September 2018 - 66
IEEE Robotics & Automation Magazine - September 2018 - 67
IEEE Robotics & Automation Magazine - September 2018 - 68
IEEE Robotics & Automation Magazine - September 2018 - 69
IEEE Robotics & Automation Magazine - September 2018 - 70
IEEE Robotics & Automation Magazine - September 2018 - 71
IEEE Robotics & Automation Magazine - September 2018 - 72
IEEE Robotics & Automation Magazine - September 2018 - 73
IEEE Robotics & Automation Magazine - September 2018 - 74
IEEE Robotics & Automation Magazine - September 2018 - 75
IEEE Robotics & Automation Magazine - September 2018 - 76
IEEE Robotics & Automation Magazine - September 2018 - 77
IEEE Robotics & Automation Magazine - September 2018 - 78
IEEE Robotics & Automation Magazine - September 2018 - 79
IEEE Robotics & Automation Magazine - September 2018 - 80
IEEE Robotics & Automation Magazine - September 2018 - 81
IEEE Robotics & Automation Magazine - September 2018 - 82
IEEE Robotics & Automation Magazine - September 2018 - 83
IEEE Robotics & Automation Magazine - September 2018 - 84
IEEE Robotics & Automation Magazine - September 2018 - 85
IEEE Robotics & Automation Magazine - September 2018 - 86
IEEE Robotics & Automation Magazine - September 2018 - 87
IEEE Robotics & Automation Magazine - September 2018 - 88
IEEE Robotics & Automation Magazine - September 2018 - 89
IEEE Robotics & Automation Magazine - September 2018 - 90
IEEE Robotics & Automation Magazine - September 2018 - 91
IEEE Robotics & Automation Magazine - September 2018 - 92
IEEE Robotics & Automation Magazine - September 2018 - 93
IEEE Robotics & Automation Magazine - September 2018 - 94
IEEE Robotics & Automation Magazine - September 2018 - 95
IEEE Robotics & Automation Magazine - September 2018 - 96
IEEE Robotics & Automation Magazine - September 2018 - 97
IEEE Robotics & Automation Magazine - September 2018 - 98
IEEE Robotics & Automation Magazine - September 2018 - 99
IEEE Robotics & Automation Magazine - September 2018 - 100
IEEE Robotics & Automation Magazine - September 2018 - 101
IEEE Robotics & Automation Magazine - September 2018 - 102
IEEE Robotics & Automation Magazine - September 2018 - 103
IEEE Robotics & Automation Magazine - September 2018 - 104
IEEE Robotics & Automation Magazine - September 2018 - 105
IEEE Robotics & Automation Magazine - September 2018 - 106
IEEE Robotics & Automation Magazine - September 2018 - 107
IEEE Robotics & Automation Magazine - September 2018 - 108
IEEE Robotics & Automation Magazine - September 2018 - 109
IEEE Robotics & Automation Magazine - September 2018 - 110
IEEE Robotics & Automation Magazine - September 2018 - 111
IEEE Robotics & Automation Magazine - September 2018 - 112
IEEE Robotics & Automation Magazine - September 2018 - 113
IEEE Robotics & Automation Magazine - September 2018 - 114
IEEE Robotics & Automation Magazine - September 2018 - 115
IEEE Robotics & Automation Magazine - September 2018 - 116
IEEE Robotics & Automation Magazine - September 2018 - Cover3
IEEE Robotics & Automation Magazine - September 2018 - Cover4
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2023
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2023
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2023
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2023
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2022
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2022
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2022
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2022
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2021
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2021
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2021
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2021
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2020
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2020
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2020
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2020
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2019
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2019
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2019
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2019
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2018
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2018
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2018
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2018
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2017
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2017
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2017
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2017
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2016
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2016
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2016
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2016
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2015
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2015
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2015
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2015
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2014
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2014
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2014
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2014
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2013
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2013
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2013
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2013
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2012
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2012
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2012
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2012
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2011
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2011
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_june2011
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_march2011
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_december2010
https://www.nxtbook.com/nxtbooks/ieee/roboticsautomation_september2010
https://www.nxtbookmedia.com