TRS: An Open-source Recipe for Teaching/Learning Robotics with a Simulator.
:: setup a laptop in 5 minutes, write a control, navigation, vision or manipulation program in 100 lines of code


This page details the installation and configuration of the following items:

  • Peter Corke's RVC toolbox,
  • The V-REP simulator,
  • The MATLAB bindings for V-REP.


TRS requires a fairly recent version of MATLAB. MATLAB versions older than 2011 are know to cause problems.


Before installing V-REP and RVC, please take the time to read the tips below:

  • The installation process needs to be slightly adapted to your platform (Linux, Mac, Win), and to your MATLAB version. At each step of the install procedure, I provide a set of commands that are tailored to a 64-bit Linux machine. If you use a different setup, you may have to adapt these commands.
  • If you are using Windows, you can pretty much follow the directives below. However, to ease the process, I suggest you install everything in C:/trs instead of your home directory.

    In the instructions below, the tilde ~ character stands for the home directory. If you are using Windows, you may use C:/ instead of ~. If you decide to go against this recommendation, please make sure that the path where you install the project stuff does not contain spaces, accented characters, or other non-letter characters. Letters and numbers only please.

Install Procedure

The recommended procedure for setting up your computer is listed below:

  1. Project-related files are published through Git. Download a Git client from the website. If you are unfamiliar with Git, SourceTree is a cool GUI for Mac and Windows.

    Clone the Git repository onto your machine; this tutorial will consider you do it in your home directory ~. On a UNIX machine: cd ~ git clone

    Do not modify the files within that directory, as they may be updated in the repository. Remember to regularly pull from the Git repository to get updates.

    If you have trouble downloading the project files with Git, you can download a ZIP snapshot of the current state of the Git repo. The ZIP file behind this link is kept up-to-date, but you must re-download it often to make sure you get all the updates to the project files.

  2. Download V-REP PRO EDU. When you have downloaded V-REP, unpack it, for instance in your home directory.

    If your firewall asks you whether V-REP should be allowed, always answer yes: the communication between MATLAB and V-REP will take place via the network (internal to your computer). Otherwise, you will face problems later on.

  3. Install the V-REP bindings for MATLAB:
    1. You must copy three files from the directory of the V-REP app (downloaded at the previous step) to the directory named youbot within your local copy of the GitHub repository. The three files you need to copy are named:
      • remApi.m
      • remoteApiProto.m
      • (if you use Linux) or remoteApi.dll (if you use Windows) or remoteApi.dylib (if you use a Mac). If you have a choice between a 32-bit or 64-bit remoteApi, pick the one that corresponds to your MATLAB install (32-bit MATLAB or 64-bit MATLAB). If you have 32-bit MATLAB, pick the 32-bit remoteApi, even if your kernel is 64-bit.
      You will find these files in the directory containing the V-REP app. Look in the programming/remoteApiBindings/lib/lib and programming/remoteApiBindings/matlab/matlab subdirectories of the V-REP app directory (although this can change from version to version). You must copy these files to the youbot directory within your copy of the GitHub repo. If you closely followed the instructions above, the youbot directory is at ~/trs/youbot (Linux/Mac) or C:/trs/youbot (Windows).

      Note that, when you run any MATLAB script using V-REP, you will be warned to use the right version of the remote API file (; this is perfectly normal. The message should look like this: Note: always make sure you use the corresponding remoteApi library (i.e. 32bit Matlab will not work with 64bit remoteApi, and vice-versa)

    2. In MATLAB, change to the youbot directory. On Linux/Mac: cd ~/trs/youbot Then perform a first connection test by typing: vrep=remApi('remoteApi'); vrep.delete();

      If there is no error, the MATLAB bindings to V-REP are loaded! If there is an error, check the steps above, check the Troubleshooting section below, and read V-REP's MATLAB bindings help. The V-REP developers are actively supporting TRS. If you cannot solve this issue, post a question on the V-REP forums.

    3. Startup V-REP (Linux: ./ from within V-REP's directory; Windows: in your Start menu), use the menu "File/Open Scene", and open ~/trs/youbot/binding_test.ttt. Hit "Start Simulation" in the Simulation menu. Then, back in MATLAB, go to the youbot folder. On Linux/Mac: cd ~/trs/youbot Then run the binding_test script: binding_test(); If you see MATLAB replying Number of objects in the scene: 19, everything works! If not, as recommended above, post a question on the V-REP forums (the most common cause of errors is forgetting to start the simulation).
  4. In MATLAB, run the startup_robot.m file provided via the Git repository. If you cloned the Git repository in your home directory (~ under Linux and macOS), run: run('~/trs/matlab/startup_robot.m');

    This line needs to be run every time MATLAB restarts. You may want to add it to your MATLAB startup file. This first first checks whether P. Corke's RVC toolbox is downloaded (and downloads it if it's not), and then updates MATLAB's path so that it can find the toolbox functions and the V-REP binding.

    Test that the RVC toolbox works: In MATLAB, type rotx(1) If there is no error, P. Corke's RVC toolbox is working! If there is an error, check the steps above and read the toolbox' install documentation.

Discovering the simulator

Here are a few videos to help you get familiar with the simulator.

Back-up link

Back-up link

Back-up link

Back-up link


  • If you get an error that contains version `GLIBCXX_3.4.15' not found, talk to me in class, or take a look at this link.
Valid HTML5 and CSS
© Renaud Detry 2014
This work is licensed under a Creative Commons Attribution 4.0 International License.