Search
This is an old revision of the document!
V-REP is a powerful cross-platform 3D simulator based on a distributed control architecture: control programs (or scripts) can be directly attached to scene objects and run simultaneously in a threaded or non-threaded fashion. It features advanced physics engines which allows to simulate real-world physics and object interactions (collisions, object dynamics, etc.).
V-REP is cross-platform and works on Windows, Linux and macOS. Download the educational version V-REP Pro EDU for your particular system.
./vrep.sh
vrep
V-REP supports multiple ways of simulation control including internal Lua scripting, ROS connectivity or external API. The documentation for external API functions can be found in: V-REP Python remote API documentation V-REP C++ remote API documentation
Tutorial on basic interfacing between V-REP and python can be found on the web: V-REP Python remote API tutorial
./programming/remotaApiBindings/python/python
./programming/remotaApiBindings/lib/lib
The python scripts for controlling the robot in V-REP used in during the labs are for python version 2.7. Besides, they rely on python libraries that help to solve the lab tasks. The required libraries are already installed on the lab computers, but they can be install using, e.g.,
sudo apt install python-numpy python-scipy python-matplotlib python-pandas python-sympy python-nose
Further, the scripts for controlling the hexapod rely on the provided hardware abstraction layer, in particular for V-REP hexapod_vrep. The libraries must be accessible to your python scripts, and thus you can added (or symlink) them to the working directory. However, it is more easier to setup your working environment and the library to the search path. This can be done, e.g., in .bashrc. For example, let suppose the hexapod_vrep is in $HOME/uir/. Then, you can added it to search path by
hexapod_vrep
$HOME/uir/
export PYTHONPATH=$PYHTONPATH:$HOME/uir:$HOME/uir/hexapod_vrep/vrep_api
Besides, the scripts use python2.7, while the default version is python 3 in ubuntu 16.04. Therefore, you can use alias to python e.g.,
alias python=python2.7
and specify the python interpret in the scripts files by the first line as
#!/usr/bin/env python
Notice, using env is platform independent as it can be in various directories.
env
Finally, you can set the execution flag of the scripts using, e.g.,
chmod +x lab01.py
.bashrc
alias python=python2.7 export PYTHONPATH=$HOME/uir:$HOME/uir/hexapod_vrep/vrep_api export PATH=$PATH:$HOME/uir/V-REP_PRO_EDU_V3_4_0_Linux