Introduction to V-REP
virtuel robot experimentation platform
by Ma thia s Thor
This presentation is inspired by the official V-REP presentation and the official website
Content
❏ V-REP Overview
❏ Scene Objects
❏ Ca lcula tion Modules
❏ Control Mecha nis ms
❏ Extra
❏ Sta rting your own project in GoRobots
❏ Ques tions a nd Getting Sta rted
V-REP Overview
What is it? Genera l purpos e robot s imula tor with integra ted
development environment
V-REP Overview
What is it? Genera l purpos e robot s imula tor with integra ted
development environment
What can it do ? Sens ors , mecha nis ms , robots a nd whole s ys tems
ca n be modelled a nd s imula ted in va rious wa ys
V-REP Overview
What is it? Genera l purpos e robot s imula tor with integra ted
development environment
What can it do ? Sens ors , mecha nis ms , robots a nd whole s ys tems
ca n be modelled a nd s imula ted in va rious wa ys
Typical applications ? Fa s t prototyping a nd verifica tion
Controller development
Ha rdwa re control
Simula tion of fa ctory a utoma tion s ys tems
Sa fety monitoring
Product pres enta tion
etc.
Three Central Elements
Scene Ca lcula tion
Objects Modules
Control
Mecha nis ms
Scene Objects
Scene Calculation
Ba s ic building blocks Objects Modules
14 different types
Ca n be combined with ea ch other
Ca n form complex s ys tems together with Control
ca lcula tion modules a nd control Mecha nis m s
mecha nis ms
Scene Objects
Scene
Objects
Shapes and Dummies
Shapes
Ra ndom mes h, convex mes h, primitive mes h, or heightfield mes h
Ca n be grouped/ ungrouped (also merged)
Optimized for fa s t ca lcula tions
Dummies
Auxilia ry reference fra me & helper object
Joints and Force/ Torque Sensors
Joints
Revolute-type • Pris ma tic-type • Screw-type • Spherica l-type
Velocity, pos ition, s pring/ da mper or force controlled
Beha vior is controlled by phys ica l engine
Ea s y to do invers e kinema tics
Force/Torque Sensors
Mea s ures force a nd torque
Ca n conditionally brea k a pa rt
Us ed to ‘glue’ rigid pa rts together
(not as s trong as grouping, but keeps individual dynam ics )
Cameras, Lights, and Mirrors
Cameras
Pers pective / orthogra phic projection
Tra cking & a utoma tic view-fitting
function
Lights
Spotlight / directiona l / omnidirectiona l
Mirrors
Mirror or s cene / object clipping function
Cameras, Lights, and Mirrors
Proximity Sensors
More tha n s imple ra y-type detection
Configura ble detection volume
Ca n be us ed to model a lmos t a ny type of proximity s ens or, from ultra s onic to
infra red, a nd s o on.
Graphs
Time gra phs • X/ Y gra phs • 3D curves • Ca n be exported
Us eful debugging tool!
Vision Sensors
Integra ted ima ge proces s ing • Ra y-tra ced rendering a ls o a va ila ble
Paths and Mills
Paths
6 dim. tra jectory definition
Genera te a pa th from the edge
of a s ha pe.
Mills
Cus tomiza ble cutting volume
Cuts s ha pes (i.e. mes hes )
Octrees and Point Clouds
Point Clouds
Point conta iner
Calculation modules
Scene Calculation
Objects Modules
5 ba s ic a lgorithms
Ca n be combined with ea ch other
Control
Mecha nis m s
Calculation modules
Calculation
Modules
Inverse/ forward kinematics & Minimum Distance Calculations
Inverse/forward kinematics
Any mecha nis m: redundant, bra nched, clos ed, etc.
Da mped / unda mped res olution
Weighted res olution • Conditiona l res olution
Obs ta cle a voida nce
Minimum Distance Calculations
Any mes h • Any point cloud • Any
individua l point
Collision Detection and Path Planning
Collision Detection
Any mes h • Any point cloud • Any individua l point
Path Planning
Pla nning ta s ks in 3D-
s pa ce, a nd in 2D-s pa ce
for vehicles with non-
holonomic motion
cons tra ints .
Collision Detection and Path Planning
Collision Detection
Any mes h • Any point cloud • Any individua l point
Path Planning
Pla nning ta s ks in 3D-
s pa ce, a nd in 2D-s pa ce
for vehicles with non-
holonomic motion
cons tra ints .
Dynamics / Physics
4 physics engines:
➢ Bullet Phys ics
➢ Open Dyna mics Engine (ODE)
➢ Vortex Dyna mics
➢ Newton Dyna mics
Simple s witching
Dyna mic pa rticles to s imula te a ir or
wa ter jets
Dynamics
Sta tic/ non-s ta tic s hapes
res ponda ble/ non-res pondable s ha pes (masks)
Control Mechanisms
Scene Calculation
6 methods or interfa ces Objects Modules
7 la ngua ges
All methods ca n be us ed a t the s a me time,
a nd even work ha nd-in-ha nd
Control
Mecha nis m s
Control Mechanisms
Embedded Remote
Scripts API clients
Control Plugins ROS nodes
Mecha nis ms
Add-ons
Control Mechanisms
Embedded Remote
Scripts API clients
Local Interface Remote Interface
Sa me proces s Plugins ROS nodes Different proces s /
ha rdwa re
Add-ons
Control Mechanisms
Over 500 API functions
(Extenda ble)
Embedded
Scripts Ca n be a tta ched to a ny s cene object
Ma ny Lua extens ion libra ries a va ila ble
Threa ded or non-threa ded
Va rious types : ma in s cript, child s cripts , ca llba ck s cripts
(e.g. cus tom joint controllers )
Plugins Lua interfa ce
Lightweight a nd ea s y to progra m (child s cripts )
→ Initia liza tion • Actua tion • Sens ing • s hut down
Extremely porta ble s olution
Add-ons
Control Mechanisms
Embedded Non-threa ded child s cript
Scripts
Plugins
Add-ons
Control Mechanisms
Over 500 API functions . Extenda ble
Embedded C/ C++ interfa ce
Scripts
Us ed to provide V-REP with a s pecia l functionality requiring
either fa s t ca lcula tion ca pa bility (s cripts a re m os t of the tim e s lower tha n
com piled la ngua ges ), a s pecific interfa ce to a ha rdwa re device (e.g. a
rea l robot), or a s pecia l communica tion interfa ce with the outs ide
world
Plugins
The ROS functiona lity is pla ced in a plugin
Add-ons
Control Mechanisms
Over 400 API functions . Extenda ble
Embedded Lua interfa ce
Scripts
Ca n cus tomize the s imula tor
Lightweight a nd ea s y to s et-up
Ca n s ta rt a utoma tically a nd run in the ba ckground, or they ca n
be ca lled a s functions
Plugins
Add-ons
Control Mechanisms
Over 100 API functions
(Extendable)
Remote
API clients Client (your program) - Server (v-rep plugin) relationship
C/ C++, Python, Java, Matlab, Octave, Lua & Urbi interfaces
Lightweight and easy to use
ROS nodes Python Example
Control Mechanisms
Plugin-based
Remote It acts as a ROS node that other nodes can communicate with
API clients
via ROS services, ROS publishers and ROS subscribers
Supports all standard messages and is extendable
Generic (e.g. easy to change program from communicating with
the simulation to communicating with a real robot)
I successfully compiled it with ROS Kinetic in ubuntu 16.04
ROS nodes
Control Mechanisms
1) C/ C++ API Calls
2) Cas ca ded Child s cript execution
3) LUA API calls
4) Cus tom LUA API callbacks
5) V-REP event callbacks
6) rem ote API function ca lls
7) ROS trans it
8) cus tom com m unica tion
a) s ocket, s erial, pipes , etc.
9) Add-on calls to LUA API
10) Script ca llba ck ca lls
Control Mechanisms
If in doubt, us e their webs ite!
http:/ / [Link] robotics .com
Other features - Custom User Interfaces (QT-Based)
Other features - Mesh Edit Modes
❏ Triangle, vertex or edge edit m ode
❏ Modify m es hes (adjus t vertices , add/ rem ove triangles )
❏ Sem i-a utom atic prim itive s hape extraction function
❏ Triangle, vertex or edge extraction
❏ Mes h decom pos ition
❏ Convex decom pos ition
❏ Convex hull extraction
❏ Mes h decim ation
Other features
❏ Headles s m ode s upport (i.e. via com m and line)
❏ Im port form ats : OBJ , STL, 3DS, DXF, COLLADA & URDF
❏ Model brows er and s cene hierarchy
❏ Multilevel undo / redo
❏ Movie recorder (w. ray tracing)
❏ Sim ulation of paint or welding s eam s
❏ Static & dynam ic textures
❏ Exhaus tive docum entation
❏ Etc.
V-REP Source Code Licens ing
Res ources
V-REP webs ite: [Link] .com
V-REP us er ma nua l: [Link] robotics .com/ helpFiles /
V-REP forum: [Link] robotics .com
V-REP YouTube cha nnel: Virtua lRobotPla tform
V-REP Twitter a ccount: coppelia Robotic
Starting your own project in GoRobots
Starting your own project in GoRobots
1. As k for m em bers hip in ENS group
on GitLa b (Koh, J an-Matthias , or Me)
Starting your own project in GoRobots
1. As k for m em bers hip in ENS group
on GitLa b (Koh, J an-Matthias , or Me)
2. Fork your vers ion of GoRobots
Press this
If you forked later than 08.47 this morning do this!
1) Configure a rem ote tha t points to the ups trea m repos itory in Git
$ git rem ote a dd ups trea m git@gitla [Link] :ens _s du/ gorobots .git
2) Fetch the bra nches a nd their res pective com m its from the ups trea m repos itory
$ git fetch ups trea m
3) Check out your fork's loca l m a s ter bra nch.
$ git checkout m a s ter
4) Merge the cha nges from ups trea m / ma s ter into your loca l m a s ter bra nch (Sync.)
$ git m erge ups trea m / ma s ter
5) Check for m erge conflicts with (you m a y need to ins ta ll m eld)
$ m eld .
No Important Changes (Check with meld)? → $ git reset --hard
Starting your own project in GoRobots
1. As k for m em bers hip in ENS group
on GitLa b (Koh, J an-Matthias , or Me)
2. Fork your vers ion of GoRobots
3. Clone your fork to your Pc
git clone “this address”
Sta rting your own project in GoRobots
1. As k for m em bers hip in ENS group
on GitLa b (Koh, J an-Matthias , or Me)
2. Fork your vers ion of GoRobots
3. Clone your fork to your Pc
4. Get pendulum s im ula tion up a nd
running by following the guide in
the rea dm e file
Please write me on mathias@[Link] if you find any errors in the guide
Starting your own project in GoRobots
1. As k for m em bers hip in ENS group
on GitLa b (Koh, J an-Matthias , or Me)
2. Fork your vers ion of GoRobots
3. Clone your fork to your Pc Your controller here →
e.g. /controllers/pendulum/[Link]
4. Get pendulum s im ula tion up a nd
running by following the guide in
the rea dm e file
5. Sta rt your own project a nd us e the
following s tructure Your makelistcatkin and child script here →
e.g. /projects/pendulum/catkin_ws/src/...
Your v-rep sim (.ttt) in v-rep_simulations in here →
e.g. /utils/v-rep_simulations/pendulum/ [Link]
Starting your own project in GoRobots
1. As k for m em bers hip in ENS group
on GitLa b (Koh, J an-Matthias , or Me)
2. Fork your vers ion of GoRobots
3. Clone your fork to your Pc
4. Get pendulum s im ula tion up a nd
running by following the guide in
the rea dm e file
5. Sta rt your own project a nd us e the
following s tructure
6. End your project with a m erge
reques t
Press this
Questions and Getting started
Any Ques tion?
Try getting the pendulum s imulation to run on
your PC!
Installing VORTEX Physical engine
1) Go to: https :/ / [Link]-la bs .com / licens es /
2) Crea te free a ccount
3) Go to: My Account > Downloa ds (the downloa d pa ge)
4) Pres s : Optiona l Downloa d > Vortex Studio (Linux)
5) Then go to: My Account > Licens es
a ) Then reques t a licens e for Vortex Studio Es s entia ls
6) Extra ct the downloa ded folder
a ) Go to “Vortex_Studio…/ bin” (in the termina l)
b) Then run “./ VortexLicens eMa na ger --a ctiva te KEY”
7) Res ta rt V-REP
V-REP Overview
What is it? Genera l purpos e robot s imula tor with integra ted
development environment
What can it do ? Sens ors , mecha nis ms , robots a nd whole s ys tems
ca n be modelled a nd s imula ted in va rious wa ys
Typical applications ? Fa s t prototyping a nd verifica tion
Controller development
Ha rdwa re control
Simula tion of fa ctory a utoma tion s ys tems
Sa fety monitoring
Product pres enta tion
etc.