V-REP Quick User Manual
V-REP Quick User Manual
Version 1.4
MAY 2012
Documentation Author
Julien Tharin
K-Team S.A.
Z.I. Plans-Praz
1337 Vallorbe
Switzerland
Email: [email protected]
Url: www.k-team.com
Documentation version
Version
1.0
1.1
1.2
Date
03.06.2010
14.06.2010
16.12.2010
Author
J. Tharin
J. Tharin
J. Tharin
Description
First draft
Updated
Updated floating license dongle; added Khepera 3 Lua parser
1.3
05.07.2011
J. Tharin
Some corrections
1.4
16.05.2012
J. Tharin
Trademark Acknowledgements:
IBM PC: International Business Machines Corp.
Macintosh: Apple Corp.
SUN Sparc-Station: SUN Microsystems Corp.
LabVIEW: National Instruments Corp.
Matlab: MathWorks Corp.
Khepera: K-Team and LAMI
Logitech: Logitech Int. SA
V-REP: Dr. Marc Andreas Freese
LEGAL NOTICE:
TABLE OF CONTENTS
1.
INTRODUCTION ................................................................................................. 1
1.1
1.2
1.3
1.4
2.
INSTALLATION .................................................................................................. 4
2.1
2.2
2.3
3.
V-REP ........................................................................................................................ 1
SPECIFICATIONS .......................................................................................................... 1
REQUIRED HARDWARE/ SOFTWARE ............................................................................ 3
HOW TO USE THIS HANDBOOK ..................................................................................... 3
THE SINGLE FIXED LICENSE ......................................................................................... 4
THE SINGLE DONGLE LICENSE...................................................................................... 4
THE FLOATING LICENSE ............................................................................................... 4
USAGE ................................................................................................................... 6
3.1
TUTORIAL.................................................................................................................... 6
3.2
LOADING INTEGRATED SCENES.................................................................................... 6
3.3
PROGRAMMING THE KHEPERA III ROBOT .................................................................... 7
3.3.1
On V-REP simulator........................................................................................... 7
3.3.2
Applying Lua script on the real Khepera 3 robot .............................................. 8
1.
INTRODUCTION
1.1
V-REP
Thank you for buying the V-REP software. A powerful 3D robot simulator, which
features several versatile calculation modules (inverse kinematics, Physics/dynamics,
collision detections, minimum distance calculations, path planning, etc.), a distributed
control architecture (unlimited number of control scripts, threaded or non threaded), and
several extension mechanisms (plug-ins, custom client application, etc.).
V-REP is the perfect tool for fast prototyping and verification, remote monitoring, fast
algorithm development, robotics related education, and simulation of factory automation
systems. A V-REP plug-in was specifically developed to allow an intuitive, easy and
realistic Khepera robot simulation.
This document introduces the instructions for the installation and the first steps in VREP. For more information on how to use V-REP, please refer to the help file that ships
with V-REP.
1.2 Specifications
Full collision detection module, allowing fast interference checking between any
geometries or collection of geometries, with optional collision contour calculation.
More than 250 clean and fine-grained API functions, available from the C/C++
and Lua side (wrappers can make them available to other languages too)
Fully integrated edit mode for robot/mechanism/scene edition (triangle edit mode,
vertex edit mode, edge edit mode, custom user-interface edit mode, path/trajectory
edit mode, etc.) 4 in-parallel running simulator instances sharing a same copy
buffer.
Full copy/paste functionality, not just for objects, but also for their associated
behavior (programs), also during simulation
Compact scene and model files (one single compressed binary file containing all
what is needed (objects and programs))
Exhaustive CAD-data import and export file-format support (DXF, 3DS, OBJ,
STL)
Multi-level undo/redo
Objects and attached functionalities are fully scalable (resizable), also during
simulation
Free V-REP PLAYER VERSION that allows you to distribute and play created
scenes and models anywhere
Required hardware :
o PC, Linux or Apple computer
o Minimal configuration:
CPU: >300 (Passmark CPU Rating)
RAM: >=512 MB
Storage capacity: >50 MB
Video card: >200 (Passmark G3D Rating) (a good video card (i.e.
hardware accelerated) is probably the most critical element of V-REP)
Monitor resolution: >=1024x768
Required software :
o OS:
Microsoft Windows Operating Systems: XP with SP3/Vista/Seven
Linux 2.6: Ubuntu, or another distribution
MacOS: from version 10.6
o V-REP setup: V-REP Vx.y.z Setup.exe, where x,y,z are the current version
of the software from http://ftp.k-team.com/V-REP/
o optional: floating license type of V-REP: file
v_repFloatingLicenseServer.exe
Remark: Please go often check http://ftp.k-team.com/V-REP/ to see if an update is
available, as this software is constantly improving. You won't need to request
any new license for updating.
1.4
This handbook introduces the V-REP software and how to start using it. For more
information on how to use V-REP, please refer to the help file that ships with V-REP.
If this handbook does not answer one of the problems you are confronted with, please
consult the K-Team web site (www.k-team.com) and, especially the Forum and the FAQs.
Installation:
Usage:
2.
INSTALLATION
When you received the license keys, put them in a text file named
floatingLicenses.txt, one by line, in the same directory of the license server. Edit
also the floatingLicenseSettings.txt file, where the port on which the server listens to
can be set. All text output is automatically saved to a log file
(floatingLicenseServerLog.txt). Make sure that Windows allows the server to listen
to that port (Firewall). Then launch the server.
4. On each client PCs that should run V-REP, install V-REP V-REP Vx.y.z Setup.exe
file then edit the V-REP FULL\system\usrset.txt file. Make sure following values
are added and correct:
a. floatingLicenseEnabled = true
b. floatingLicenseServer = xxx.xxx.xxx.xxx (specify the IP address of the floating
license server PC)
c. floatingLicensePort = 20249 (make sure the port number is same as the one
specified on the floating license server PC)
d. floatingLicenseLight = false (if false, that PC will search for a V-REP FULL
floating license, otherwise it will search for a V-REP LIGHT floating license)
5. Save the file.
6. Start V-REP. If the floating license server cannot be contacted, or if no appropriate (or
available) floating license could be found, an error message is displayed and V-REP
ends. Otherwise V-REP starts and automatically uses the settings of the floating
license that it received from the server (options, FULL/LIGHT, serial number). Every
4 minutes, V-REP will actualize the license (reserve it for another 8 minutes). If it
failed at actualizing the license, an error message appears every 10-15 seconds.
7. When ending V-REP, V-REP will check-out the license that it borrowed, so that other
PCs can use it. If V-REP crashed (or failed at checking a license out because it could
not connect to the server), then its license will automatically be freed (checked-out)
after 8 minutes.
3.
Usage
3.1 Tutorial
After having installed and registered the software, you can start using it.
The best way is to start with the tutorials located in the V-REP User Manual. You can
access it by the link on your desktop or from the V-REP program: Help menu, Help
Topics sub-menu, into V-REP => Contents => V-Rep => Tutorials => BubbleRob
tutorial.
Simulation start
maxVel=2*math.pi
while (simGetSimulationState()~=sim_simulation_advancing_abouttostop) do -- while simulation running...
if (simExtK3_getLineSensor(0)>0.75) then
velLeft=maxVel
-- left sensor intensity > 0.75
else
velLeft=maxVel*0.5
-- left sensor intensity <= 0.75
end
if (simExtK3_getLineSensor(1)>0.75) then
velRight=maxVel
-- right sensor intensity > 0.75
else
velRight=maxVel*0.5
-- right sensor intensity <= 0.75
end
simExtK3_setVelocity(velLeft,velRight) -- Set desired left and right motor velocities
if (simExtK3_getGripperProxSensor(0)<0.015)or(simExtK3_getGripperProxSensor(1)<0.015) then
-- Something was detected between the fingers
simExtK3_setGripperGap(0) -- close the fingers
simExtK3_setArmPosition(900) -- move the arm up
end
end
simExtK3_setVelocity(velocity_Left , velocity_Right)
set the velocities of the left and right wheels in [rad/s]
simExtK3_setArmPosition(position)
set position of the gripper's arm; range [300 (down) .. 900 (up)]
simExtK3_setGripperGap(gap)
set aperture position of the gripper; range [0 (closed) .. 170 (open)]
Software:
connect the Khepera 3 robot and open the terminal (see Khepera 3 user manual,
chapter 5.2 Testing the secondary serial link: http://ftp.kteam.com/KheperaIII/UserManual/ )
copy the Lua script from V-REP Khepera 3 robot (fig. 3.2) to a file named
script.lua and transfer this file to the robot
Usage:
-
run the parser with the Lua script file as argument (exit with keys CTRL-C):
./kh3luaparser script.lua
you can modify the script with the vi editor, directly on the robot
vi script.lua
The vi commands are:
Key x: delete the letter under the cursor
Key a: enter in edit (append) mode
Key i: enter in edit (insert) mode
Escape key then : : exit mode: write wq! for saving and exiting
write q! for exiting without saving
If you have several consoles connected to the robot via network (see Korebot II user
manual), you can launch the script into one console; and edit it in another one. The parser
program is checking if the script file is modified and saved. It will reload and launch the
newer if it is the case.
Look at the Lua script examples in the subfolder lua_examples in the source files of the
parser or at http://ftp.k-team.com/KheperaIII/V-REP_lua/lua_examples/
Implemented commands for the Lua parser running on the Khepera3 robot:
The common Lua commands can be used. The implemented LUA commands for the
Khepera 3 are described in the chapter 3.3.1 above. And these following specific commands
of the simulator can be used too:
-
10
K-Team S.A.
Z.I. Plans-PRAZ
1337 VALLORBE
Switzerland