Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

XIII Simpósio Brasileiro de Automação Inteligente

Porto Alegre – RS, 1o – 4 de Outubro de 2017


A COMPARISON BETWEEN A SIMULATED AND A REAL MOBILE ROBOT PATH
TRACKING APPLICATION USING V-REP

Kenny A. Q. Caldas∗, Júnior A. R. Silva∗, Felix M. Escalante∗, Valdir Grassi Jr∗, Marco
H. Terra∗, Adriano A. G. Siqueira†

Electrical Engineering Department - University of São Paulo at São Carlos
Avenida Trabalhador São-Carlense, 400, São Carlos, SP, Brazil. CEP 13566-590

Mechanical Engineering Department - University of São Paulo at São Carlos
Avenida Trabalhador São-Carlense, 400, São Carlos, SP, Brazil. CEP 13566-590

Emails: kennycaldas@usp.br, junior.anderson@usp.br, maurinho707@usp.br,


vgrassi@usp.br, terra@sc.usp.br, siqueira@sc.usp.br

Abstract— The focus of this work is the validation of the Virtual Robot Experimentation Platform, V-REP,
as a reliable and resourceful simulator for robotics applications. For this purpose, a simulated and a real mobile
robot path tracking application are compared under the same conditions. A genetic path planning algorithm
is used for generating the reference path for the mobile robot. A kinematic controller was implemented using
Kanayma’s method. Simulated and experimental results are shown using a mobile robot e-Puck and the high
precision Vicon camera system.

Keywords— Mobile robots, Robots control, Path planning, Simulation.

1 Introduction This paper focus on the comparison of a


robotic application in a simulated environment in
Study of the robotic systems has become a versa- V-REP with a real world scenario. To this pur-
tile and open field in all education levels, from pose, a kinematic control (Kanayama et al., 1990)
elementary school (Bers et al., 2002), (Church of a mobile robot with differential traction is con-
et al., 2010) to postgraduate courses (Mirheydar sidered. Initially, the control problem is repro-
et al., 2009). In large part, this is due to advances duced in simulated environment through the com-
in control systems, computer science, and commu- bination of V-REPr and MATLABr . After-
nications systems, which have made robotics more wards, the same problem is applied in real time
accessible. Nowadays, there is a variety of robot experiment using an e-Puck robot and a high pre-
shapes, sizes, prices, and functionalities that allow cision localization system composed by four Vicon
for a broad array of individuals, not necessarily re- cameras. In both scenarios the reference path for
searchers, to become interested in robotics. How- the mobile robot is generated by a genetic algo-
ever, depending on the cost and complexity of the rithm approach, according to Kala (2014). This
project, it is convenient to make use of simulation way, the main contribution of this paper is the
software/environment beforehand. validation of the results obtained in V-REP as a
Simulators play an important role in most re- reliable and resourceful software for fast prototyp-
search fields, especially in robotic systems. Ac- ing of robotics systems.
cording to Torres-Torriti et al. (2016), they be- The sections of this paper are organized in
came increasingly popular due to the progress in the following way: in Section 2, the implemen-
computer technology, which allowed the develop- tation of the genetic algorithm for path planning
ment of tools to improve some pioneer simulators, problems is discussed; in Section 3, the kinematic
such as those developed by Corke (1996), and by model of a differential mobile robot and the pro-
Marhefka and Orin (1996). Currently, there are posed controller are detailed. Section 6 covers the
simulators widely used for different specific areas main results obtained in simulations and exper-
of robotics, such as for manipulators (Ferraguti iments and Section 7 approaches the discussion
et al., 2013) or mobile robotics (Michel, 2004). and conclusion of this work.
A few years ago, The Coppelia Robotics devel-
oped the Virtual Robot Experimentation Plat- 2 Path planning with Genetic Algorithm
form (V-REPr ) (Rohmer et al., 2013b), (Peralta
et al., 2016) , (Fabregas et al., 2016) . The simula- The path planning method with obstacle avoid-
tor has a wide range of commercially known robots ance uses a camera positioned above the path re-
(manipulators and mobile), including the possibil- gion where the mobile robot will move, in a way
ity of constructing any other robot, as well as the that it will cover all possible free and occupied
simulation environment. Additionally, it allows spaces, as shown in Figure 1. Based on this con-
the versatility of communication with other soft- figuration, it is possible to implement a genetic
wares, making it possible to command and receive algorithm to find a collision-free path from a start-
information externally of the robotic project. ing point to a target position.

ISSN 2175 8905 2026


XIII Simpósio Brasileiro de Automação Inteligente
Porto Alegre – RS, 1o – 4 de Outubro de 2017
The first step is to take a picture of the map path composed of a set of points from the starting
with the positioned camera. This image is con- position and the desired goal. The initial popula-
verted to a binary matrix by thresholding using tion is given by (Ismail et al., 2008)
the function im2bw from MATLABr , where each
pixel will have a value assigned: 0 for detected InitialP opulation = [Ind1 , Ind2 , ..., Indn ] , (1)
obstacles (black) and 1 for free spaces (white).
where Indn represents an individual and n the
population size. The structure of Indn is given by

Ind = [P0 , P1 , ..., PN +1 ] , (2)

where P is the (x, y) coordinates of the path, P0


is the starting position, N is the amount of turn-
ing points chosen by the user and PN +1 the goal
coordinates.
One of the main elements of the genetic al-
Figure 1: Position of the camera and resulting
gorithm is the definition of the fitness function.
picture of the map. Source: Modified from (Kala,
The efficiency of an individual to solve the path
2014).
planning problem is measured by the sum of the
distances traveled from the starting position to the
The representation of the coordinate system goal, evaluating each line segment individually. A
of the map is also shown in Figure 1. The user high penalty value is assigned to segments where
chooses the starting position and the desired goal there is an obstacle. The best individuals are the
based on the map dimensions. If the genetic algo- ones with the lowest fitness values. The fitness
rithm detects that the chosen points are inside an function is defined by
obstacle or outside the map dimensions, an error
message is shown. f itness = d0 ∗ p + d1 ∗ p + ...dn ∗ p, (3)
The next step is to determine the amount of
turning points the resulting path will have. Figure where p is a penalty multiplier for paths resulting
2 illustrates a representation of a path generated in collisions and dn is the distance between two
by the genetic algorithm. The amount of points set of points and is calculated by
in the path is the maximum number of turns it is p
d = (xn+1 − xn )2 + (yn+1 − yn )2 . (4)
expected the robot to make in the map. If this
number is too high, it could result in very large The next population generation is created
computational burden and may generate a path by using two functions: selection and crossover.
with useless turns, increasings its length. On the The selection function chooses the parents of the
other hand, if there are not enough points to con- new population based on their fitness value. The
nect the origin to the goal coordinates, it may lead crossover function is responsible to determine how
to a non feasible solution or a collision-prone path the genetic algorithm creates the new individuals,
(Kala, 2014). called children, for the next generation. The func-
tions used in this works are the stochastic uniform
method and scattered crossover, respectively. A
detailed description of these functions can be seen
in the documentation of MATLABr optimization
toolbox 2015.
The stopping criteria adopted is a predefined
number of generations, in order to reduce the com-
putational time required for the algorithm genetic
to run. In case none solution is found under a
set of parameters, an output error message will
be shown.

3 Mobile robot kinematic


Figure 2: Path generated by a set of points.
Source: Modified from (Kala, 2014). A differential mobile robot is used in this work,
meaning that each motor of the actuated wheels
The initialization of the genetic algorithm is has an independent actuation. The geometry
given by an initial population with a predefined analysis of the robot is based on Figure 3. The
number of individuals. An individual represents a axes (X, Y ) represent the inertial coordinates sys-
possible solution to the considered problem. For tem; (X0 , Y0 ) the local coordinates system; d the
the path planning case, it represents a reference distance between the center of the wheels axis P0

2027
XIII Simpósio Brasileiro de Automação Inteligente
Porto Alegre – RS, 1o – 4 de Outubro de 2017
and the center of mass Pc ; b the distance between (Siqueira et al., 2010). This way, S(q1 )T becomes
the actuated wheel and the symmetry axis of the
robot; r the wheel radius; α the clockwise angle S(q1 )T =
between the inertial reference axis x and the sym- 
c(b cos α − d sin α) c(b cos α + d sin α)

metry axis of the robot and θr and θl are the an- c(b cos α + d sin α) c(b cos α − d sin α)
gular displacement for the right and left wheels. 
 c −c

 , (8)
 
 1 0 
0 1
r
where c = 2b . The kinematic model can be ex-
pressed by
q˙1 (t) = S(q1 )q˙2 (t) (9)
or
x˙c = c(b cos α − d sin α)θd + c(b cos α + d sin α)θe
y˙c = c(b cos α + d sin α)θd + c(b cos α − d sin α)θe
α̇ = c(θr − θl).

(10)

The position vectors of the right and left


T
wheels are defined as q2 = [θr θl ] and the an-
h iT
gular velocities vectors as q˙2 = θ˙r θ˙l .
Figure 3: Unicycle model. The proposed kinematic controller is based on
Kanayama et al. (1990). The controller uses the
The kinematic controller proposed has to kinematic model of the mobile robot to generate
consider the nonholonomic and holonomic con- the desired angular velocities for the left and right
straints. For a differential mobile robot, there are wheels, in order to follow the collision-free path
three kinematic constraints that must be observed references found by the genetic algorithm.
during the development of the controller (Coelho The mobile robot reference and current pose
T
and Nunes, 2003). The first is found in relation are defined by qr = [xr yr αr ] and qc =
T
to Pc , due the velocity at P0 being parallel to the [xc yc αc ] , respectively, where αr is given by
X0 axis. This constraint is given by
αr = tan−1 (y˙r /x˙r ). (11)
ẏc cos α − ẋc sin α − dα̇ = 0, (5)
This way, it is possible to define the error be-
T
where (xc , yc ) represents the center of mass Pc po- tween the two states as qe = [xe ye αe ] , where
sition in the inertial coordinates system.
xe = cos α(xr − xc ) + sin α(yr − yc )
The other two constraints are present on the
rotation of the actuated wheels, since they can not ye = − sin α(xr − xc ) + cos α(yr − yc ) (12)
slide αe = αr − αc .

ẋc cos α + ẏc sin α + bα̇ − rθr = 0 (6a) The desired linear and angular velocities, v d
ẋc cos α + ẏc sin α − bα̇ − rθl = 0. (6b) and ω d , are calculated by the kinematic controller
by using the error between the current and desired
Based on these equations, it is possible to pose based on the given references by
rewrite the three kinematic constraints of the dif- p
vr = (ẋr )2 + ẏr )2 ωr = α˙r . (13)
ferential mobile robot model in the matrix form
T
by using q1 = [xc yc α θr θl ] as the gener- Based on these equations, it is possible to de-
alized coordinate of the mobile robot fine the kinematic controller by
 
− sin α cos α −d 0 0 vd = vr cos(αe ) + Kx xe
R(q1 ) = − cos α − sin α −b r 0 . (7) (14)
wd = wr + vr (Ky ye + Kα sin(αe )),
− cos α − sin α b 0 r
where Kx , Ky e Kα are the controller gains.
The matrix R(q1 ) is full rank and can In order to correctly update the desired values
be expressed as [R(q1 ) R2 ], to ensure that for the left and right wheels, the angular velocities
R(q1 ) avoids singularity and that S(q1 ) = generated by the controller must consider the ra-
 −1 T
(R1 (q1 R2 )T I4 is in the null space of R(q1 ) dius and distance between the wheels. Therefore,

2028
XIII Simpósio Brasileiro de Automação Inteligente
Porto Alegre – RS, 1o – 4 de Outubro de 2017
the relation between the angular velocities and the to one of the walls, the mobile robot would be in
robot physical parameters is given by a safe distance.
" # 
θ˙d
 
d 1/r b/r vd
q̇2 = ˙rd = , (15)
θ 1/r −b/r ωd
l

where θ˙rd e θ˙ld are the angular velocities for the


right and left wheel that will be updated on the
robot.

4 Simulation setup

The implementation of the genetic path planning


algorithm and the kinematic controller were made
using the V-REPr simulator. V-REPr is a plat-
form for virtual experiments with a wide variety
of robots in its library , including the e-Puck, the
differential mobile robot used in this work. This
simulation framework allows a rapid algorithm im- Figure 5: Collision-free path generated by the ge-
plementation, system verification and quick pro- netic algorithm.
totyping, which can greatly reduce the deploy-
ment complexity of robotics systems (Rohmer
et al., 2013a).
The first step is to design the simulation envi- 5 Experiment setup
ronment where the mobile robot will be moving.
The map is represented in Figure 4. It has an area The experiment performed to compare the results
of 2 × 2m2 divided in four rooms and a main cor- obtained from the simulation in V-REPr uses the
ridor. Once the map is defined, the collision-free e-Puck in an environment monitored by high pre-
path is obtained by implementing the genetic algo- cision Vicon system.
rithm. For the simulation, the origin coordinates
points were chosen as x0 = 0.20m, y0 = 0.25m
and goal as xg = 1.50m, yg = 1.80m.

(a) (b)

Figure 6: (a) Vicon camera model T-series T40S.


(b) Reflective marker.

The Vicon cameras are positioned on the


superior corners of the experiment environment.
The tracking of the object inside a workspace is
obtained by reflective markers placed on the mo-
bile robot, and its identification is done through
the distance between them. Figure 6 shows the Vi-
Figure 4: Simulation environment in V-REPr . con system and the reflective marker used in this
work. The kinematic controller in MATLABr up-
The path generated from the genetic algo- dates the control inputs and transmits them to the
rithm implementation can be seen in Figure 5. e-Puck through Bluetooth. The main characteris-
The function ga of MATLABr was used for this tics of the Vicon cameras are presented in Table 1
application. The resulting set of points of the path and a diagram of the experiment setup can be seen
were filtered, in order to eliminate the exceeding in Figure 7. Although the Vicon cameras have a
point and obtain a smooth path. In order to con- high capture frame rate, the Bluetooth communi-
sider the robot dimension into the path planning cation between the computer and the e-Puck lim-
problem, the dimensions of the walls on the map its the sampling period to 0.14 seconds.
were incremented by the radius of the robot body. Once the experiment setup was defined, the
This way, even if the generated path was very close same map designed in the simulation on V-REPr

2029
XIII Simpósio Brasileiro de Automação Inteligente
Porto Alegre – RS, 1o – 4 de Outubro de 2017

Table 1: Vicon system technical characteristics


Camera T40S
Resolution 4Mp (2336 × 1728 )
Camera frame rates 30 − 2000
Sensor Vicon Vegas S-4

Figure 9: Path traveled by the e-Puck during the


experiment.

Figure 7: Experiment setup diagram.

was built, using the same dimensions values. Fig-


ure 8 shows the map used in the experiment.

Figure 10: Orientation angle of the e-Puck during


the experiment.

7 Conclusion
Figure 8: Real map used in the experiment. This paper presented a comparison between a sim-
ulated and a real robotic system. A genetic algo-
rithm was used to perform a collision-free path
6 Results and discussion planning of a mobile robot in a structure environ-
ment. This was done by positioning an overhead
The results obtained from the simulation and the camera that could capture a picture of the whole
experiment are shown in Figure 9. The blue and area where the robot will move. In order to do
red curve represent the simulated and real tra- this, a map in V-REPr was designed to replicate
jectories, respectively. The circles are the refer- a real world scenario and the genetic algorithm
ence path generated by the genetic algorithm. It was able to find a feasible path.
is possible to see that both results are very similar, The control strategy was based on the kine-
which shows that using the V-REPr as a proto- matic model of the e-Puck, as shown in the work
typing tool is a good solution, since it is very ac- of Kanayama et al. (1990), which generates the
curate with the real system. The gains used in the desired angular velocities required to keep the mo-
kinematic controller are: kx = 0.1, ky = 1000 and bile robot in the path by using a set of references
kα = 10, based on Equation (14). for the control inputs calculation.
Figure 10 shows the orientation angle and Fig- The results were obtained initially in the sim-
ure 11 the lateral error for simulated and real sce- ulation environment in V-REPr and later in a real
narios. The distance traveled by the e-Puck is world experiment, by using the Vicon cameras for
used as abscissa for these graphs. Both results localization. The comparison of the results ob-
showed that under the same conditions, V-REPr tained was satisfactory, since the simulation could
could reproduce very closely the e-Puck behavior reproduce very accurately the behavior of the e-
during its movement. Puck in the real system, which validates the use

2030
XIII Simpósio Brasileiro de Automação Inteligente
Porto Alegre – RS, 1o – 4 de Outubro de 2017
Conference on Emerging Technologies Fac-
tory Automation (ETFA), pp. 1–5.
Ismail, A., Sheta, A. and Al-Weshah, M. (2008).
A mobile robot path planning using genetic
algorithm in static environment, Journal of
Computer Science 4(4): 341–344.
Kala, R. (2014). Code for robot path plan-
ning using genetic algorithms, Available at
http://rkala.in/codes.html .
Figure 11: Lateral error of the experiment and Kanayama, Y., Kimura, Y., Miyazaki, F. and
simulation. Noguchi, T. (1990). A stable tracking con-
trol method for an autonomous mobile robot,
of V-REPr as a resourceful tool for quick proto- Robotics and Automation, 1990. Proceed-
typing of robotics systems. ings., 1990 IEEE International Conference
Future works involve the comparison of simu- on, IEEE, pp. 384–389.
lations in different environments and robotics sys- Marhefka, D. W. and Orin, D. E. (1996). Xani-
tems, as an alternative to reduce the time taken mate: an educational tool for robot graphical
to develop real world robotics applications. simulation, IEEE Robotics Automation Mag-
azine 3(2): 6–14.
8 Acknowledgments
Michel, O. (2004). Cyberbotics ltd. webotsTM :
This work is supported by National Council for professional mobile robot simulation, Inter-
Scientific and Technological Development (CNPq) national Journal of Advanced Robotic Sys-
under grants 142080/2016-0 and by Coordination tems 1(1): 5.
for the Improvement of Higher Education Person-
Mirheydar, H., Jones, M., Koeneman, K. S. and
nel (CAPES) under grants 1584685.
Sweet, R. M. (2009). Robotic surgical edu-
cation: a collaborative approach to training
References postgraduate urologists and endourology fel-
lows, Jsls 13(3): 287–292.
Bers, M., Ponte, I., Juelich, K., Viera, A. and
Schenker, J. (2002). Teachers as designers: Peralta, E., Fabregas, E., Farias, G., Vargas, H.
Integrating robotics in early childhood edu- and Dormido, S. (2016). Development of a
cation, Information Technology in childhood khepera iv library for the v-rep simulator,
education 1: 123–145. IFAC-PapersOnLine 49(6): 81 – 86.

Church, W. J., Ford, T., Perova, N. and Rogers, Rohmer, E., Singh, S. P. and Freese, M. (2013a).
C. (2010). Physics with robotics-using lego V-rep: A versatile and scalable robot simula-
mindstorms in high school education., AAAI tion framework, Intelligent Robots and Sys-
Spring Symposium: Educational Robotics tems (IROS), 2013 IEEE/RSJ International
and Beyond. Conference on, IEEE, pp. 1321–1326.

Coelho, P. and Nunes, U. (2003). Lie algebra ap- Rohmer, E., Singh, S. P. N. and Freese,
plication to mobile robot control: A tutorial, M. (2013b). V-rep: A versatile and
Robotica 21(5): 483–493. scalable robot simulation framework, 2013
IEEE/RSJ International Conference on In-
Corke, P. I. (1996). A robotics toolbox for mat- telligent Robots and Systems, pp. 1321–1326.
lab, IEEE Robotics Automation Magazine
3(1): 24–32. Siqueira, A. A., Terra, M. H. and Francisco, T. B.
(2010). Controle robusto de robôs móveis em
Fabregas, E., Farias, G., Peralta, E., Vargas, H. formação sujeitos a falhas, Revista Controle
and Dormido, S. (2016). Teaching control & Automaçao/Vol 15: 1.
in mobile robotics with v-rep and a khepera
iv library, 2016 IEEE Conference on Control Torres-Torriti, M., Arredondo, T. and Castillo-
Applications (CCA), pp. 821–826. Pizarro, P. (2016). Survey and comparative
study of free simulation software for mobile
Ferraguti, F., Golinelli, N., Secchi, C., Preda, N. robots, Robotica 34(04): 791–822.
and Bonfè, M. (2013). A component-based
software architecture for control and simula-
tion of robotic manipulators, 2013 IEEE 18th

2031

You might also like