Why listen to me?
CMP3103M/CMP9050M– Lecture 5
Robot Behaviour
Dr. Mike Mangan
Course Information: Delivery Team
Office: 2220 Isaac Newton Building
Surgery hours: Tues 9-11am
Contact: mmangan@lincoln.ac.uk
Course Information: Syllabus
Date Title Lecturer
23/01/2017 Intro Marc Hanheide
30/01/2017 Robot Programming Marc Hanheide
06/02/2017 Robot Sensing Marc Hanheide
13/02/2017 Motion & Control Marc Hanheide
20/02/2017 Robot Behaviour Mike Mangan
27/02/2017 Navigation Mike Mangan
06/03/2017 Navigation Mike Mangan
13/03/2017 Robot mapping – SLAM Mike Mangan
20/03/2017 Control Architectures Paul Baxter
27/03/2017 HRI 1 Paul Baxter
03/04/2017 HRI 2 Paul Baxter
24/04/2017 Applications Paul Baxter
01/05/2017 Revision / Robot Systems Marc Hanheide
This week…
1. Robot behaviours
2. Braitenberg’s vehicles
3. Combining robot behaviours
4. Learning robot behaviours
What do we mean by behaviour?
Definition
noun
The observable response or reaction of an organism, an individual, or a system to a situation
Supplement
Behaviour pertains to the (aggregate of) acts or reactions that an organism, an individual or a system
produces in response to a particular circumstance. It may be induced by stimuli or inputs from the
environment whether internal or external, conscious or subconscious, overt or covert, and voluntary or
involuntary.1
It may be innate. It means it may be based on the instinct or natural action (or inaction), originating
from inside an organism or a cell. Or, it may be acquired (or learned) based on previous experiences or
exposure.
http://www.biology-online.org
http://www.biology-online.org/dictionary/Organism
What do we mean by robot behaviour?
Robot Behaviour:
• [from psychology] reaction to a stimulus
• Basic building block for robot actions
Behaviour
stimulus
response
Robot behaviours – line-following
behaviour
stimulus
response
Application Areas?
Robot behaviours – exploration/search
behaviour
stimulus
response
Application Areas?
Common robot behaviours
Example Category
road following path following
wandering exploration/directional
goal following goal-oriented appetitive
obstacle avoidance aversive/protective
balance postural behaviours
flocking social/cooperative
visual search perceptual
Braitenberg’s Vehicles
Building seemingly complex behaviours from simple
interactions.
Valentino Braitenberg, “Vehicles: Experiments in Synthetic
Psychology”, MIT Press, 1984.
This lecture covers Vehicles 1 to 3
(but the whole book is highly recommended…)
Vehicle 1 – Getting Around
Vehicle 1 – Getting Around
Input
(sensor)
Output
(motor)
Vehicle 1 – Getting Around
Input
(sensor)
Output
(motor)
Vehicle 1 – Getting Around
Input
(sensor)
Output
(motor)
Transfer function
Vehicle 1 – Getting Around
Under perfect conditions the vehicle stops on dark spots
But if more realistic physics are added e.g. non-symmetric
drive or friction interesting things emerge such as:
• looping continuously around sources
• Brownian motion on the group level
http://stevebattle.github.io/braitenberg/vehicle1.html
Vehicle 2 – What are their behaviours?
+ ++ +
Vehicle 2 – What are their behaviours?
Fearful
Vehicle 2 – What are their behaviours?
Fearful Aggressive
+ ++ +
Vehicle 2 – What are their behaviours?
– — –
Input
(sensor)
Output
(motor)
Inhibitory connections
New transfer function
Vehicle 3 – Love
Permanent
love
Exploring
Love
Multisensory Version
• Increasingly complex behaviours can be created by
adding:
• New sensors with changing profiles
• (non-linear / digital)
• New Transfer functions
• (Non-linear / weighting)
• Varying excitatory and inhibitory connectivity
• E.g. goal seeking vs obstacle avoidance
Real World Example – Cricket Phonotaxis
Work of Prof Barbara Webb, University of Edinburgh
Female has to locate male of her
species (i.e. ignore other species)
https://www.youtube.com/watch?v=aMeKvWU1CnQ (16:55)
Robot behaviours – recap
• Robot Behaviour:
• [from psychology] reaction to a stimulus
• Basic building block for robot actions
• Often reactive behaviours:
• no internal data interpretation
• fast reactions!
• Reactive behaviours perform closed loop control
• Remember lecture 4
• Different behaviours can be combined into complex
ones
Behaviour
stimulus
response
Questions?
This week…
1. Robot behaviours
2. Braitenberg’s vehicles
3. Combining robot behaviours
4. Learning robot behaviours
Why behaviour-based robots?
http://www.mind.ilstu.edu/curriculum/medical_robotics/behavior_pioneers.php
Complexity emerges through time
• Each robot programmed with
simple rules:
Drive
upon_impact
if (have_frisbee)
drop_Frisbee
else
grab_Frisbee
end
Complexity emerges through time
Multiple Behaviours
behaviour 1stimulus 1
behaviour 2stimulus 2
behaviour 3stimulus 3
behaviour 4stimulus 4
behaviour 5stimulus 5
co
o
rd
in
a
to
r
action
p
e
rc
e
p
ti
o
n
• Concurrent behaviours – How to coordinate behaviours at the same time?
• Sequencing – Not covered in this lecture
Subsumption
Organises behaviours and sub-behaviours into a hierarchy. Higher levels inhibit
(subsume) the actions lower levels.
Subsumption
Organises behaviours and sub-behaviours into a hierarchy. Higher levels inhibit
(subsume) the actions lower levels.
Subsumption
Organises behaviours and sub-behaviours into a hierarchy. Higher levels inhibit
(subsume) the actions lower levels.
https://www.youtube.com/watch?v=gN3tMnB22Uc
Subsumption
Key concepts:
Situatedness: a robot should be able to react to its environment within a human-like
time-frame.
Embodiment: “The real world is its own best model”. “Every simulation is doomed to
succeed”.
Intelligence: Brooks argues that developing perceptual and mobility skills are a
necessary foundation for human-like intelligence.
Emergence: Conventionally, individual modules are not considered intelligent by
themselves. It is the interaction of such modules, evaluated by observing the agent
and its environment, that is usually deemed intelligent (or not).
• “Machina Speculatrix”, 1948
– experiments in reflex behaviour
– built of electronic valves and photo-cells
– approach or escape a light source
– https://www.youtube.com/watch?v=lLULRlmXkKo
Complexity emerges through interaction
Notes on Behaviour-based robotics
Emergence offers fantastic opportunities but is hard to design.
Long term planning needs newer methods e.g. Q learning
Learning Robot Behaviours
Neural Network learning of behaviours
See Mobile Robotics: A Practical Introduction (p56)
McCulloch & Pitt neuron (1943)
𝑦 = 0 𝑖𝑓 𝑠𝑢𝑚 < 𝑇 𝑦 = 1 𝑖𝑓 𝑠𝑢𝑚 > 𝑇
Neural Network learning of behaviours
See Mobile Robotics: A Practical Introduction (p56)
Left Whisker Right Whisker Left Motor Right Motor
0 0 1 1
0 1 -1 1
1 0 1 -1
1 1 X X
Task: Obstacle Avoidance Using Whiskers
?
Neural Network learning of behaviours
See Mobile Robotics: A Practical Introduction (p56)
LW RW
LM RM
W_RWRMW_LWLM
We have no idea what the weights or threshold should be so
we initially set them to neutral values:
ꙍ = 0 (all weights set to zero)
Θ = -0.01 (threshold for motors activating)
µ = 0.3 (learning rate)
Neural Network learning of behaviours
See Mobile Robotics: A Practical Introduction (p56)
LW RW
LM RM
We have no idea what the weights or threshold should be so
we initially set them to neutral values:
ꙍ = 0 (all weights set to zero)
Θ = -0.01 (threshold for motors activating)
µ = 0.3 (learning rate)
Use the following learning rule to optimise weights to get
desired behaviour:
𝜔𝑘 𝑡 + 1 = 𝜔𝑘+ 𝜇 𝑡 𝜏𝑘 − 𝑜𝑘 𝑖𝑘
New
weight
Old
weight
Learning rate input
Target
output
Obtained
output
00
-0.01 -0.01
Neural Network learning of behaviours
LW RW
LM RM
00
Initial set-up.
All weights = 0
µ = 0.3
Θ = -0.01
𝜔𝐿𝑊𝐿𝑀= 0 + 0.3 ∗ 1 − 1 0=0
Left
Whisker
Right
Whisker
Left
Motor
Right
Motor
0 0 1 1
0 1 -1 1
1 0 1 -1
1 1 X X
𝜔𝑘 𝑡 + 1 = 𝜔𝑘 + 𝜇 𝑡 𝜏𝑘 − 𝑜𝑘 𝑖𝑘
-0.01 -0.01
Neural Network learning of behaviours
See Mobile Robotics: A Practical Introduction (p56)
LW RW
LM RM
00
Initial set-up.
All weights = 0
µ = 0.3
Θ = -0.01
𝜔𝐿𝑊𝐿𝑀= 0 + 0.3 ∗ 1 − 1 0=0
𝜔𝐿𝑊𝑅𝑀= 0 + 0.3 ∗ 1 − 1 0=0
𝜔𝑅𝑊𝐿𝑀= 0 + 0.3 ∗ (1 − 1)0=0
𝜔𝑅𝑊𝑅𝑀= 0 + 0.3 ∗ 1 − 1 0=0
Left
Whisker
Right
Whisker
Left
Motor
Right
Motor
0 0 1 1
0 1 -1 1
1 0 1 -1
1 1 X X
𝜔𝑘 𝑡 + 1 = 𝜔𝑘 + 𝜇 𝑡 𝜏𝑘 − 𝑜𝑘 𝑖𝑘
Now its your turn.
-0.01 -0.01
Neural Network learning of behaviours
See Mobile Robotics: A Practical Introduction (p56)
LW RW
LM RM
Initial set-up.
All weights = 0
µ = 0.3
Θ = -0.01
𝜔𝐿𝑊𝐿𝑀= 0 + 0.3 ∗ −1 − 1 0=0
𝜔𝐿𝑊𝑅𝑀= 0 + 0.3 ∗ 1 − 1 0=0
𝜔𝑅𝑊𝐿𝑀= 0 + 0.3 ∗ −1 − 1 1=-0.6
𝜔𝑅𝑊𝑅𝑀= 0 + 0.3 ∗ 1 − 1 1=0
Left
Whisker
Right
Whisker
Left
Motor
Right
Motor
0 0 1 1
0 1 -1 1
1 0 1 -1
1 1 X X
00
Neural Network learning of behaviours
See Mobile Robotics: A Practical Introduction (p56)
LW RW
LM RM
Initial set-up.
All weights = 0
µ = 0.3
Θ = -0.01
𝜔𝐿𝑊𝐿𝑀= 0 + 0.3 ∗ −1 − 1 1=0
𝜔𝐿𝑊𝑅𝑀= 0 + 0.3 ∗ 1 − 1 1=-0.6
𝜔𝑅𝑊𝐿𝑀= −0.6 + 0.3 ∗ −1 − 1 0=-0.6
𝜔𝑅𝑊𝑅𝑀= 0 + 0.3 ∗ 1 − 1 0=0
Left
Whisker
Right
Whisker
Left
Motor
Right
Motor
0 0 1 1
0 1 -1 1
1 0 1 -1
1 1 X X
00
-0.01 -0.01
Neural Network learning of behaviours
See Mobile Robotics: A Practical Introduction (p56)
LW RW
LM RM
Left
Whisker
Right
Whisker
Left
Motor
Right
Motor
0 0 1 1
0 1 -1 1
1 0 1 -1
1 1 X X
00
-0.01 -0.01
Does it work?
Neural Network learning of behaviours
See Mobile Robotics: A Practical Introduction (p56)
LW RW
LM RM
00
– –
-0.01 -0.01
Robot Behaviour Learning
Learned behaviours included:
• Obstacle avoidance
• Wall following
• Box pushing
Robot Behaviour Learning
Summary
1. Robot behaviours
2. Braitenberg’s vehicles
3. Combining robot behaviours
4. Learning robot behaviours
Recommended Reading
• Ulrich Nehmzow, “Mobile Robotics:
A Practical Introduction”, Springer,
2nd edition, 2002.
• Ronald C. Arkin, “Behavior-based
Robotics”, MIT Press, 1998.
Questions?
Workshops & Assessment
1. All cut off dates for
demonstrating robot
capabilities extended by 1
week
• Week 5 – tasks 3&4
• Week 6 – task 4
2. Visual object search
1. 70% of 30% for practical
2. Individual
3. Assessment by
implementation
submission plus
presentation (w10,11)
3. Training environment will be
available on Thursday.
Disclaimers:
• subject to change
• Test environment
will be different