Professional Documents
Culture Documents
AbstractThis paper is a short report on the research Within the field of AI, An agent is any entity that can
done about robot interaction algorithms. To develop the perceive its environment through sensors and act upon that
activity a Raspberry Pi based Lego robot has been used. The environment through actuators (Fig. 1). The simplest agents are
aim of this research is to program the robot using python to called reactive agents, which lack an internal symbolic model
achieve behaviors, such as: and act by binding certain combinations of stimulus to certain
responses.
Following a black straight and curved line. We use Lego BrickPi robot (Fig. 2) to make programs that
permit this robot to carry out some actions in this robot. For
Go through a complex path without leaving it's path.
example: line following, line detection, random exploration,
Go through a maze until finding a candle. etc., then we acquire some important data about sensors. We
propose to program an embodied agent for extinguishing a fire
These activities must be performed by the robot with the in a four-room maze on its own.
minimum human interaction, only the programming
necessary. The aim is to let the robot interact with the
environment in order to achieve predetermined goals.
I. INTRODUCTION
The field of Artificial Intelligence comprises the set of
intellectual and technological resources for the creation of
programs for machines that mimic human behavior. The Figure 1: Agent and environment interaction diagram
research in the field of AI is characterized by the production of
machines for automation tasks which require intelligent
behavior. AI is widely studied in various fields of science
concept, nature and society and it has been an important field of
scientific research in recent decades.
In the construction of a system, the need for some
intelligence can be predicted when it's required to adopt a
processes such as: making a decision of an unforeseen situation,
in the presence of an enormous volume and undetermined
information, much of which is inaccurate, insecure and
conjectured, taking into account constraints, goals and
objectives greatly set by the same decision-making agent which
decides, resulting in decision satisfactorily.
Thus, if the problem is well structured, the AI will obtain
great achievements, such as the ones obtained to date in games
field, automatic demonstration and scheduling. So, predictably,
the machines will exceed humans in more and more fields where
intelligence used to be considered essential. Figure 2: BrickPi robot
II. LEGOS BRICKPI ROBOT A. Exploring robot behavior
The Lego BrickPi is a kit that contains software and To start, it's necessary to calibrate the movement of the robot.
hardware to create small, customizable and programmable In our case, there was a small variance between the right and the
robots. They include a programmable brick computer that left motor, it was necessary to increase the value of the right
controls the system, a set of modular sensors and motors and motor so the robot goes straight, e.g. robot.motors(40,42), hence
LEGO parts to create the mechanical systems. The main if the robot has to go forward at a speed of 60, the right
component in the kit is a brick-shaped computer called the instruction would be robot.motors(60,62) otherwise the robot
RaspBerry Pi. would move forward but turning to the right.
Then we tested the light sensor, to know the real value when
it detects a black or white line.
Also the ultrasonic sensor had to be tested to know exactly
the range of distance it could detect obstacles. In the test we
could see that this sensor could give false values, depending on
the way that the signal was reflected to the sensor.
Once everything is set and ready, it's time to start with the
first task.
B. Environment testing
This part of the research is focused in test and observe the
behavior of the robot in several situations. All the data obtained
from these test will later be used to solve the main problem.
These are the tests from which we will acquire the data [1]:
Navigate from A point to B point.
Room exploration without touching the walls.
Simulate a sumo fight.
Figure 3: Lego sensors Follow a path without leaving the rout.
This robot uses sensors to gather information from the
environment and uses the information to plan movements. The The first task to do is to navigate from one room to other, the
Legos sensors, with which we will work, are (see Fig. 3): path we did is represented in the Fig.4 with a red line. To
The touch sensor detects physical contact with the accomplish this task, we pre-programmed the path as individual
orange trigger, and returns a value of 1 if it is pressed in, segments. So the robot just has to follow the instructions.
or 0 if it is not. It can be used as a bumper.
Ultrasonic Sensor detects distance to object in the range
[0, 250~280] mm. Allows the robot to detect obstacles
and avoid them.
The light sensor detects reflected the light, also can
detect the basic colors of objects and surfaces by aiming
directly at them at close range. The sensor gives a light
intensity reading of 0-100 value.
The programming language used to work with the BrickPi is
python, so the task of programming should not be difficult or
complex. Two libraries were provided by the teachers to start the
tests such as: candle.py and robot.py.
C. Braitenbergs vehicle
Braitenberg vehicle is an agent that can move in an
autonomous way by a setting. It has primitive sensors (capable
of measuring stimuli), and wheels (each driven by its own
motor) which operate as actuators or effectors. A sensor, in its
simplest form, is directly connected to an effector, so that a
signal or stimulus in such sensor produces an immediate
response in the motor (moving the wheel, for example). Our goal
is to create different algorithms which enables the robot to
produce different actions of a Braitenberg vehicle. Depending
on how the sensors are connected, the robot shows different
behaviors. Based on this idea, we define these connections in
order to bring out one certain behavior or another [2].
Both drive tasks will constantly feed the values of each light
sensor into the respective motor as a speed. So we get these
Figure 5: Sumo ring with coke cans behavior:
A. Ipsilateral relationship1 (uncrossed): Each of the two
light sensors, belonging to the robot, are connected to
the corresponding side engine (Fig. 7), the speed of
As shown in the Fig. 5, it is necessary to use the light sensor each engine is proportional to the intensity of the
to avoid the robot going out of the circle. The pseudo code to perception of these sensors, i.e., each light sensor
accomplish this goal its a variation of the previous code: stimulates the wheel on the same side.
while true When the robot detects light, it moves towards the light
if still inside ring even faster and when is very close avoids it.
move forward More light on the right, the right wheel faster
if theres any obstacle turns: Turn left, outside the light.
move forward
else More light on the left, the left wheel faster turns:
Turn right, outside the light.
turn right
else B. Contralateral relationship2 (crossed): the right light
turn 180 degrees sensor is connected to the left engine and the left light
sensor is connected to the right engine (Fig. 8).
The last task consists in following the path in a mat without When the robot detects light, it moves towards the light
leaving the rout, which is determined by a black or grey line. ever faster.
This task has a small complication with it's cycles, depending on More light on the right, the right wheel slower
the calibration of the light sensor and the navigation instructions turns: Turn right, toward the light.
we can end up in a loop (see Fig. 6).
1 2
Affecting, or referring to the same side of the body. Affecting the opposite side of the body.
More light on the left, the left wheel slower The problem resolution: The strategies to explore this
turns: Turn left, toward the light. environment can be multiple, perhaps the easiest one is to follow
one of the walls, either the left or right one.
From a known and fixed position, regarding the exploration:
The robot starts at the initial position H (Fig. 10), detects the left
wall, continues to enter to the first room (central), once inside
the robot seeks the right wall and follows it until the end of the
path.