0% found this document useful (0 votes)
55 views

Interfacing Matlab Simulink With V REP F

This document discusses interfacing Matlab/Simulink with the 3D simulation engine V-REP using ROS for developing sensor-based control algorithms for robotic platforms. It presents an architecture that uses V-REP to simulate robots, extracts sensor data using ROS and ViSP, implements control algorithms in Simulink, and sends commands back to V-REP. This allows prototyping controls in Simulink and testing them in realistic 3D simulations. Two examples are described: visual servoing of a quadrotor drone and manipulator arm.

Uploaded by

yemane g.michal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Interfacing Matlab Simulink With V REP F

This document discusses interfacing Matlab/Simulink with the 3D simulation engine V-REP using ROS for developing sensor-based control algorithms for robotic platforms. It presents an architecture that uses V-REP to simulate robots, extracts sensor data using ROS and ViSP, implements control algorithms in Simulink, and sends commands back to V-REP. This allows prototyping controls in Simulink and testing them in realistic 3D simulations. Two examples are described: visual servoing of a quadrotor drone and manipulator arm.

Uploaded by

yemane g.michal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Interfacing Matlab/Simulink with V-REP for an Easy Development of

Sensor-Based Control Algorithms for Robotic Platforms


Riccardo Spica, Giovanni Claudio, Fabien Spindler and Paolo Robuffo Giordano

I. OUTLINE
In this presentation we will show how to interface Mat-
lab/Simulink with the open-source 3D simulation engine V-
REP1 exploiting the popular ROS2 communication middle-
ware.
The Matlab/Simulink environment is a very convenient
possibility for developing, debugging and testing complex
control algorithms in a “fast prototyping” fashion. One can (b) A manipulator arm
code algorithms either in the matlab scripting language or by (a) A quadrotor UAV (Adept Viper s850) per-
including external C/C++ code using, e.g., s-functions. Also, controlling its pose via forming a visual servo-
the automatic code generation feature makes it possible to visual servoing ing task
speed up the execution time and even to deploy the generated Fig. 1: Two screenshots of the V-REP Simulation environ-
binaries to other platforms (e.g., the robot itself). Finally, ment
the use of scopes, displays, and the other visualization and
matlab post-processing tools represents a great added value
during the debugging and testing phase of the algorithms.
first show how to embed ROS nodes in simulink by includ-
On the other hand, to the best of our knowledge, Matlab
ing custom C S-Functions representing ROS topics to be
lacks an easy-to-use 3D physical simulation engine specif-
listened/published. This will make it possible for simulink
ically tailored to robotics applications. In this respect, V-
to exchange data with V-REP in real-time for obtaining
REP represents a valid alternative: it consists of an open-
the robot data and computing the needed control actions.
source state-of-the-art (and freely available for academic
Then, we will demonstrate our architecture in two sim-
use) 3D physical simulation engine which is becoming more
ulated scenarios: (i) visual control of a quadrotor UAV
and more widespread in the robotics community thanks to
and (ii) visual control of an industrial manipulator. The
its flexibility (possibility to simulate many different robotic
first scenario will involve a quadrotor UAV equipped with
platforms), dynamical engine (it supports ODE, Bullet and
a IMU and a down-looking camera meant to control its
Vortex), and finally customizability (it offers many different
pose w.r.t. a ground target by means of a visual servoing
possibilities to include one’s own code or to interface it
law [1]. The second scenario will consider the same situ-
with the external world). Concerning this latter point, V-REP
ation for a fixed manipulator with an eye-in-hand camera
comes with a native support of ROS that makes it easy to
performing a classical visual servoing task [2]. Figure 1
exchange data with other modules, e.g., for sending the robot
shows two snapshots of the simulation, while a video is
state and sensor data to an external planner/controller and
available online at http://www.irisa.fr/lagadic/
receiving back the motion commands.
demo/demo-vrep/demo-vrep.html.
This presentation will then focus on how to interface the
In both cases, the (simulated) camera images generated in
matlab/simulink environment with V-REP using the ROS
V-REP are first pre-processed in an indepenend ROS node
communication libraries (the publisher/subscriber paradigm)
by using the well-established ViSP library3 [3] for extracting
for fast prototyping of robot control algorithms. We will
the salient features of the tracked object. The location of the
R. Spica is with the University of Rennes 1 in the Lagadic group at Irisa features, together with the quadrotor/manipulator states, are
and Inria Rennes Bretagne Atlantique, Campus de Beaulieu, 35042 Rennes then sent via ROS to simulink which implements the servoing
Cedex, France [email protected]
G. Claudio is with Inria in the Lagadic group at Irisa and Inria Rennes
loop (and the flying controller in the quadrotor case). The
Bretagne Atlantique and Irisa, Campus de Beaulieu, 35042 Rennes Cedex, motion commands (thrust/torques or joint velocities) are then
France [email protected] sent back to the V-REP simulation. The overall software
F. Spindler is with Inria in the Lagadic group at Irisa and Inria Rennes
Bretagne Atlantique and Irisa, Campus de Beaulieu, 35042 Rennes Cedex,
architecture is shown in Fig. 2. The time synchronisation
France [email protected] between matlab/simulink and V-REP is achieved by relying
P. Robuffo Giordano is with CNRS in the Lagadic group at Irisa and Inria on a soft real-time execution: both V-REP (natively) and
Rennes Bretagne Atlantique, Campus de Beaulieu, 35042 Rennes Cedex,
France [email protected]
matlab/simulink (by means of a custom s-function) are forced
1 http://coppeliarobotics.com/
2 http://www.ros.org/ 3 http://www.irisa.fr/lagadic/visp/visp.html
Fig. 2: Software modules and exchanged data.

to run at the same rate w.r.t. the real time (thus, one
can also run faster than real-time simulations if needed).
Finally, thanks to the ROS communication interface, it is also
straightforward to plug the matlab/simulink controller with
alternative simulation softwares or real hardware counter-
parts of the simulated robots (as long as the communication
interface is the same). This is for instance the case for the
simulated manipulator which has a real counterpart in our
lab4 .
To conclude, this presentation will show how to easily
interface matlab/simulink with a widespread, open-source,
and state-of-the-art 3D robotic simulation (V-REP) using
ROS as communication middleware for sensor-based control
of popular robotic platforms. A live demo of the simu-
lation/control architecture will also be shown during the
workshop.
We believe this contribution fits well with the workshop
topics as it involves the use of matlab/simulink for sensor
processing (in our case camera camera images and IMU
data), control law testing (visual servoing, flight control),
possibility to use the same code with the simulated and
real robots (owing to the ROS middleware), and finally its
strong educational impact as the V-REP simulation engine
(and ROS) can be freely accessed by academic users.
R EFERENCES
[1] O. Bourquardez, R. Mahony, N. Guenard, F. Chaumette, T. Hamel, and
L. Eck, “Image-based visual servo control of the translation kinematics
of a quadrotor aerial vehicle,” IEEE Trans. on Robotics, vol. 25, no. 3,
pp. 743–749, 2009.
[2] F. Chaumette and S. Hutchinson, “Visual servo control, Part I: Basic
approaches,” IEEE Robotics and Automation Magazine, vol. 13, no. 4,
pp. 82–90, 2006.
[3] E. Marchand, F. Spindler, and F. Chaumette, “ViSP for visual servoing:
a generic software platform with a wide class of robot control skills,”
IEEE Robotics and Automation Magazine, vol. 12, no. 4, pp. 40–52,
2005.

4 http://www.irisa.fr/lagadic/material/
material-eng.html

You might also like