R
O B O
GB+USA
Lightseeker with
Obstacle Detection
M
S
O B I L E
E T
■ We are nowhere near the end of the possibilities offered by the ROBO Mobile Set.
For this reason we will now combine the two functions of light-seeking and obstacle detection. From a
scientific point of view the robot will then be equipped with two behaviors. Since both behavior patterns
can't be active at the same time, they will receive different priorities. As a rule the robot performs its
light-seeking behavior. Should it detect an obstacle, a hazard to the robot, the obstacle recognition
behavior becomes active. If everything is clear the robot can continue its light-seeking.
Professional software developers, when faced with such a demanding task won't simply plough ahead
with programming. No, they use a specific strategy to develop the program. One of these methods is
called "top-down design". With this approach the system is defined as a whole from the top down
without dealing with the details at the beginning. It is this method we will use to work out this
problem.
A s s i g n m e n t 1 ( L e v e l 3 ) :
Teach the robot the following behavior patterns:
● Search for a source of light.
● As soon as you have found it, follow it.
● Should an obstacle appear on the way, evade it.
● Then begin searching for a source of light again.
Use the program elements of ROBO Pro level 3 to find the solution.
Apply the "top-down" approach when working on the assignment.
Ti p s :
First divide the assignment into three parts:
• Query if the robot sees a source of light (subprogram "Light")
• Query if it encounters an obstacle (subprogram "Obstacle")
• Tell the robot what to do depending on these results (subprogram "Driving")
Now consider the different situations the robot is able to perceive to create
the subprograms "Light" and "Obstacle". Assign a numerical value to each
situation. This value is saved as variable using a Command element. Each
situation will result in a reaction that is executed in the "driving" subprogram.
S u b p r o g r a m l i g h t :
N o S i t u a t i o n
0
No light source present
1
Light source directly in front of robot
2
Light source to the left of robot
3
Light source to the right of robot
4 4
6 6
4 4
6 6
A
B
C T I V I T Y
O O K L E T
State of the Sensors
I6=0; I7=0
I6=1; I7=1
I7=1
I6=1
R e a c t i o n
seek light
drive straight ahead
execute a left turn
execute a right turn