Enabling the Remote API - client side

All units going to, or coming from the API are in meters, kilograms, seconds and radians (unless otherwise explicitly indicated), independently of what was selected for the user interface units in the user settings dialog.



C/C++ client

To use the remote API functionality in your C/C++ application, just include following C-language files in your project:

  • extApi.h
  • extApi.c
  • extApiPlatform.h (contains platform specific code)
  • extApiPlatform.c (contains platform specific code)
  • Above files are located in V-REP's installation directory, under programming. Make sure you have defined NON_MATLAB_PARSING and MAX_EXT_API_CONNECTIONS=255 as a preprocessor definition. To enable the remote API on the client side (i.e. your application), call simxStart. See the bubbleRobClient project in the programming directory for an example. This page lists and describes all supported C/C++ remote API functions. V-REP remote API functions can easily be recognized from their "simx"-prefix.



    Python client

    To use the remote API functionality in your Python script, you will need following 3 items:

  • vrep.py
  • vrepConst.py
  • remoteApi.dll, remoteApi.dylib or remoteApi.so (depending on your target platform)
  • Above files are located in V-REP's installation directory, under programming. You might have to build the remoteApi shared library yourself (using remoteApiSharedLib.vcproj or remoteApiSharedLib_Makefile) if not already built in the programming/remoteApiSharedLib directory. In that case, make sure you have defined NON_MATLAB_PARSING and MAX_EXT_API_CONNECTIONS=255 as a preprocessor definition.

    Once you have above elements in a directory known to Python, call import vrep to load the library. To enable the remote API on the client side (i.e. your application), call vrep.simxStart. See the simpleTest.py script in the programming/Python directory for an example. This page lists and describes all supported Python remote API functions. V-REP remote API functions can easily be recognized from their "simx"-prefix.



    Java client

    To use the remote API functionality in your Java application, you will need following 2 items:

  • package coppelia (containing 12 Java classes)
  • remoteApiJava.dll, remoteApiJava.dylib or remoteApiJava.so (depending on your target platform)
  • Above files are located in V-REP's installation directory, under programming. You might have to build the remoteApiJava shared library yourself (using remoteApiSharedLibJava.vcproj or remoteApiSharedLibJava_Makefile) if not already built in the programming/remoteApiSharedLib directory. In that case, make sure you have defined NON_MATLAB_PARSING and MAX_EXT_API_CONNECTIONS=255 as a preprocessor definition.

    Once you have above elements in a directory known to Java, compile your application with myAppName.java with javac myAppName.java. In your application, make sure to import the classes that you use with import coppelia.className, then call remoteApi vrep = new remoteApi() to load the library. To enable the remote API on the client side (i.e. your application), call vrep.simxStart. See the simpleTest.java program in the programming/Java directory for an example.This page lists and describes all supported Java remote API functions. V-REP remote API functions can easily be recognized from their "simx"-prefix.



    Matlab client

    To use the remote API functionality in your Matlab program, you will need following 3 items:

  • extApi.h
  • remApi.m
  • remoteApi.dll, remoteApi.dylib or remoteApi.so (depending on your target platform)
  • Above files are located in V-REP's installation directory, under programming. You might have to build the remoteApi shared library yourself (using remoteApiSharedLib.vcproj or remoteApiSharedLib_Makefile) if not already built in the programming/remoteApiSharedLib directory. You might have to call mex -setup.

    Once you have above elements in Matlab's current folder, call vrep=remApi('remoteApi','extApi.h') to build the object and load the library. To enable the remote API on the client side (i.e. your application), call vrep.simxStart. See the simpleTest.m program in the programming/Matlab directory for an example.This page lists and describes all supported Matlab remote API functions. V-REP remote API functions can easily be recognized from their "simx"-prefix.

    Make sure your Matlab uses the same bit-architecture as the remoteApi library: 64bit Matlab with 32bit remoteApi library will not work!

    You can make the loadlibrary command much faster by using the mfilename option to loadlibrary to generate a prototype file and thunkfile. This also has the advantage that a compiler will not be needed anymore to run the loadlibrary command. Refer to the Matlab loadlibrary documentation for details.



    Urbi client

    To use the remote API functionality in your Urbi script, you will need following 2 items:

  • remoteApiConst.urbi
  • remoteApiUrbi.dll, remoteApiUrbi.dylib or remoteApiUrbi.so (depending on your target platform)
  • Above files are located in V-REP's installation directory, under programming. You might have to build the remoteApiUrbi shared library yourself if not already built in the programming/remoteApiSharedLib directory. In that case, make sure you have defined NON_MATLAB_PARSING as a preprocessor definition. Under Windows, use remoteApiSharedLibUrbi.vcproj. Under Linux/Mac, do following steps:

  • Create an extApiUrbi.uob folder in the Urbi root
  • Copy following elements into that new folder: extApi.c, extApi.h, extApiInternal.h, extApiPlatform.c, extApiPlatform.h, v_repConst.h and extApiUrbi.cpp
  • From within above folder, type:
  • ../bin/umake -q --shared-library -o remoteApiUrbi.so EXTRA_CPPFLAGS=-DNON_MATLAB_PARSING -DMAX_EXT_API_CONNECTIONS=255

    To load the remote Api functionality from a script, call loadFile("remoteApiConst.urbi") and loadModule("remoteApiUrbi"). To enable the remote API on the client side (i.e. your application), call vrep.simxStart. See the simpleTest.urbi script in the programming/Urbi directory for an example. This page lists and describes all supported Urbi remote API functions. V-REP remote API functions can easily be recognized from their "simx"-prefix.


    Recommended topics

  • Enabling the Remote API - server side
  • Remote API overview
  • Remote API modus operandi
  • Alphabetical remote API function list
  • Remote API function list by category
  • Remote API constants