IEEE Robotics & Automation Magazine - September 2018 - 54

Algorithm 2:
ball_chase, switch to sit if
battery_low
sit, switch to ball_chase if battery_high
ball_chase:
ball_detection | out=ball
targeting ball: following, whenever time_ago<2, priority of 2
searching, priority of 1
following:
looking
walk_to, whenever far
looking:
look_at, whenever time_ago<1, priority of 2
head_search, priority of 1
searching:
turning
head_search

memory
sit

ball_chase
following
ball_detection
looking
walk_to
look_at

searching
turning head_search

head_search

Figure 1. A tree representation of the script presented in
Algorithm 2. Nodes in blue correspond to leaf nodes.

●

sorts activated leaf nodes (based on the priority of
keyword and the tree structure), and grants or revokes
access to resources based on this order.

Examples
Algorithm 2 shows a Playful script for a toy example corresponding to a dynamic ball-searching and following behavior.
The corresponding tree representation is displayed in Figure 1. We implemented this script in Nao, a small humanoid
robot commercialized by Softbank Robotics, and the related
behavior can be seen in the support video [17].
Script Description
The higher level of behavior is shown in
ball_chase, switch to sit if battery_low
sit, switch to ball_chase if battery_high
54

*

IEEE ROBOTICS & AUTOMATION MAGAZINE

*

september 2018

This implements a state machine that has the robot chasing the ball until its battery gets low (ball_chase), in
which case it sits ( sit ). When recharged, the robot
resumes the chasing behavior. ball_chase is declared as
a list of three nodes:
ball_chase:
ball_detection | out=ball
bargeting ball: following, whenever
time_ago <2, priority of 2
searching, priority of 1

When ball chasing is activated, the vision module for ball
detection is activated and pushes schemes describing detected
balls to the memory. In this case, a ball is described using
three properties: its color (to differentiate one ball from
another), its position, and a time stamp. When a new ball is
detected, the targeting command creates a following
branch related to it-i.e., a pulling of position and color information from the memory via the Python API will return the
most recent information corresponding to the targeted ball.
This branch is activated only when the ball has been recently
detected, as commanded by the time_ago <2 evaluation.
When activated, because of its higher priority score, it blocks
searching, which is of lower priority. Only at startup, when no
ball has been detected yet, or when a ball has not been detected for more than 2 s, the lower priority searching branch
may activate. Not using priorities results in an undefined
behavior, as both following and searching would, at
times, be set to activate without informatio n about which
should take precedence. This results in the robot alternating
between following and searching for the ball.



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