Vous êtes sur la page 1sur 5

Simulating a Robot Maze in Matlab

Espinoza, Lilia. lilyespinoza226@gmail.com. Aldaz, Jorge. croco_bmx@gmail.com. Infante,


Jefferson. jefferson_barsaelidolo@hotmail.com. Masaquiza, Bryan.
b_masaquiza@outlook.com.

Abstract: This simulation system enables us to


see the operation of a robot maze, which is
programmed with the right priority, to form part
of the trajectory is made an algorithm in the
form of matrix of n columns and m rows, for its
operation determines the way only with ones
which this anger following if and only if in the
case of zeros determine it as a wall and back by
the same path until you find new space.
Keywords: robot, maze matrix, ones, zeros.

I. INTRODUCTION

First of all, I will explain what is you


project, is the construction of a robot
capable of solving mazes simulated in
Matlab. This project was already
intended for quite some time, in order to
see it working in a software clearly, this
application allows us to understand in a
more precise manner the two priorities of
the robot left and right. Well, I'm going
to go a bit more into the General
characteristics of this project. We must
build a labyrinth in Matlab of n number
of rows and number of columns m. After
this introduction, I enter in my
simulation, which perform the same
function of a physical robot.

II. DEVELOPMENT AND DESIGN

GUIs (also known as graphical user


interfaces or UIs) provide point-andclick control of software applications,
eliminating the need to learn a language
or type commands in order to run the
application.
MATLAB apps are self-contained
MATLAB programs with GUI front
ends that automate a task or calculation.
The GUI typically contains controls such
as menus, toolbars, buttons, and sliders.

Many MATLAB products, such as


Curve
Fitting
Toolbox,
Signal
Processing Toolbox, and Control System
Toolbox, include apps with custom user
interfaces. You can also create your own
custom
apps,
including
their
corresponding UIs, for others to use.
Creating

MATLAB

GUI

Programmatically
For more control over design and
development, you can also create MATLAB
code that defines all component properties
and behaviors. MATLAB contains built-in
functionality to help you create the GUI for
your app programmatically. You can add
dialog boxes, user interface controls (such as
push buttons and sliders), and containers
(such as panels and button groups).
Matrix

In MATLAB, a matrix is a rectangular


array of numbers. Special meaning is
sometimes attached to 1-by-1 matrices,
which are scalars, and to matrices with
only one row or column, which are
vectors. MATLAB has other ways of
storing both numeric and nonnumeric
data, but in the beginning, it is usually
best to think of everything as a matrix.
The operations in MATLAB are
designed to be as natural as possible.
Where other programming languages
work with numbers one at a time,
MATLAB allows you to work with
entire matrices quickly and easily.
The best way for you to get started with
MATLAB is to learn how to handle
matrices. Start MATLAB and follow
along with each example.
You can enter matrices into MATLAB in
several different ways:
Enter an explicit list of elements.

Load matrices from external data files.


Generate matrices using built-in
functions.
Create matrices with your own
functions in M-files.
Start by entering Drers matrix as a list
of its elements. You only have to follow
a few basic conventions:
Separate the elements of a row with
blanks or commas.
Use a semicolon, to indicate the end of
each row.
Surround the entire list of elements
with square brackets, [ ].
Variables
MATLAB does not require any type
declarations or dimension statements.
When MATLAB encounters a new
variable name, it automatically creates
the variable and allocates the appropriate
amount of storage. If the variable
already exists, MATLAB changes its
contents and, if necessary, allocates new
storage. For example, num_students = 25
creates a 1-by-1 matrix named
num_students and stores the value 25 in
its single element. To view the matrix
assigned to any variable, simply enter the
variable name.
Variable names consist of a letter,
followed by any number of letters, digits,
or underscores. MATLAB is case
sensitive; it distinguishes between
uppercase and lowercase letters. A and a
are not the same variable. Although
variable names can be of any length,
MATLAB uses only the first N
characters of the name, (where N is the
number returned by the function
namelengthmax), and ignores the rest.
Hence, it is important to make each
variable name unique in the first N
characters to enable MATLAB to
distinguish variables.
Handle Graphics refers to a system of
graphics objects that MATLAB uses to
implement graphing and visualization
functions. Each object created has a

fixed set of properties. You can use these


properties to control the behavior and
appearance of your graph.
When you call a plotting function,
MATLAB creates the graph using
various graphics objects, such as a figure
window, axes, lines, text, and so on.
MATLAB enables you to query the
value of each property and set the values
of most properties.
For example, the following statement
creates a figure with a white background
color and without displaying the figure
toolbar.
figure('Color','white','Toolbar','none')
Well, the robot is primarily of labyrinth,
passes this should move within a
labyrinth of walls that are delimited by
zeroes, with various deviations and
possibilities, and the take in certain order
according to priority send that to run the
algorithm road to follow so one that is
marked as career this way is manual
entry according to the needs of the user.
Our idea was go keeping in a trajectory
that you go painting to mark the path by
which the robot toured, in the same way
is marked with another color when the
robot returns after having detected a wall
in this House a zero.
The algorithm works when it takes the
right road, in case it is not possible i.e. in
zero search to find a new path and
returns, as the last resource, the one on
the left. This option is much simpler and
avoids a problem we raised with the
other, which recognize a point that had
already passed.
Testing with algorithms and drawn path.
Features maze.
MATLAB is one of the most
sophisticated software which allows us
to develop applications in this case of
robotics to see the behavior of a robot in
real life for the corrento operation of the
priorities that will be used, that they are
left priority and priority right, form a

matrix of zeros with the option to change


to mark the path of the robot with ones.
The labyrinth has some walls that are
composed of only zeros the how is
generated through an array of n columns
and m rows. Initially, will not take any
ones, each will be marking according to
the user's need to test its performance.
Matlab programming is performed using
the guide is a chart for the development
of many programs
dynamically
interface.
We used in our GUI buttons to access
various functions, axes to obserbar our
parent and above our path maze.
When programming the buttons had to
be aware that function was to play and to
enter the programming created an .m file.
we called to the function and start with
the programming.
The program has to follow matrices that
when we create an array containing 1 and
0, where zero is the wall and the one is
the way. involves taking into account the
positions of the matrix in order to
compare the way and the simulation of
the robot maze follow the proposed path,
also it is given two left and right
priorities.
For us know if we have right priority in
the way of the matrix we compared in a
position that is already marked the path
of color blue, if going up and if the right
the column is added plus 1 and compared
to see if there way there, if any at
intervals of position matrix under
column column plus 1 is set, and change
the value of the tour this becomes also a
condition which also changes the value
of matrix. Similarly if going in the matrix
horizontally and want to know if there is
way to the right, in this case we add rows
plus 1.
And if we want to have left precedence
in the way of the matrix we compared in

a position that is already marked the path


of light blue, if going up and if the right
ie the column will subtract 1 and
compared to see if there way there, if
there is the value of position under
column matrix least 1 column sets, and
change the value of this tour becomes
also a condition which also changes the
value of the array. Similarly if going in
the matrix horizontally and want to know
if there is way to the left, in this case we
subtract rows minus 1.

III. CONCLUSIONS

Matlab is a sophisticated
software which allows us to carry
out programmes and see it
working visually if we use the
application's graphical user
interface.
The development of the area
which is to develop the
simulation of robot maze is a
matrix of zeros and ones.
To trace the path by which the
robot will develop meeting
schedule in the algorithm is
fulfilled in the following way: If
the robot bumps into zeros is
detected as a wall in a physical
robot is detected.
In the algorithm was developed a
tracking system that consists of
mark the path that the robot runs
where the robot look in need of
return and if his track record
makes it will be marked in
another color.
IV. REFERENCES
http://www.mathworks.com/disco
very/matlab-gui.html
http://nl.mathworks.com/academ
ia/student_version/learnmatlab_s
p3.pdf
http://nl.mathworks.com/academ
ia/student_version/learnmatlab_s
p3.pdf

Simulating a Robot Maze in Matlab


Espinoza, Lilia. lilyespinoza226@gmail.com. Aldaz, Jorge. croco_bmx@gmail.com. Infante,
Jefferson. jefferson_barsaelidolo@hotmail.com. Masaquiza, Bryan.
b_masaquiza@outlook.com.