Warning
This page is located in archive. Go to the latest version of this course pages. Go the latest version of this page.

CoppeliaSim robotic simulator, installation and Python API

CoppeliaSim (formarly 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.).

CoppeliaSim installation

CoppeliaSim is cross-platform and works on Windows, Linux and macOS. Download the educational version CoppeliaSim Pro EDU for your particular system.

  • On Linux
    • Download the archive .tar.gz, unpack it, navigate to the unpacked directory in the terminal and run the simulator calling the script: ./coppeliasim.sh
  • On Windows
    • Download the .exe installation file, run it and follow the instructions in the installer. Most likely you will be prompted to install Visual C Redistributable package. You can run the CoppeliaSim simulator by launching the coppeliasim from desktop. When running V-REP you may see a firewall or antivirus popup as the V-REP simulator uses UDP and TCP/IP sockets for communication which is okay.
  • On macOS
    • Download the archive .zip, unpack it, navigate to the unpacked directory and run the simulator by launching coppeliasim


CoppeliaSim python remote API

CoppeliaSim 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:
CoppeliaSim Python remote API documentation
CoppeliaSim 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

When using the connection through remote API, it is necessary to include the CoppeliaSim remote API binding scripts and library located at the installation directory of the CoppeliaSim in:
./programming/remotaApiBindings/python/python - the scripts
./programming/remotaApiBindings/lib/lib - the library
It is necessary to copy all the sources within these two directories and include them in the python script.

If your CoppeliaSim does not automatically start the remoteAPI (i.e., HexapodHal.py fails even though the simulator is running with the appropriate scene opened), you can manually start the API by calling simRemoteApi.start(19997) in the simulator terminal, where 19997 is the port used by HexapodHal.py to connect to the API.


Labs Python Scripts

The python scripts for controlling the robot in CoppeliaSim or V-REP used in during the labs are for python version 3.5. 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

courses/uir/tutorials/vrep_tut.txt · Last modified: 2021/09/20 23:03 by pragrmi1