Skip to main content

Simple python binding for V-REP robotics simulator

Project description

# v-rep python
Simple python binding for
[Coppelia Robotics V-REP simulator]( ([remote API](

## Getting started
0. Requirements: CPython >= 3.5.2 version, pip
1. Install library from PyPI by entering this command:
`pip install vrep-python`
2. Create environment variable with path to platform-specific native library (remoteApi):
* For windows users:
* For linux users:
Add `export VREP_LIBRARY="vrep_folder/programming/remoteApiBindings/lib/lib/64Bit/"`
to `.bashrc`

3. Find the socket port number in `V-REP/remoteApiConnections.txt` and use
it to connect to the server simulator

## Currently implemented things
In the current version is not implemented features such as remote management GUI,
additional configuration properties of objects and shapes, etc.
Basically implemented those components that are required to control the robot:
* Joint
* Proximity sensor
* Vision sensor
* Force sensor
* Position sensor (used for that dummy or shape object)
* ~~Remote function calls~~

## Example
from vrepapi import VRepApi
import time

class PioneerP3DX:

def __init__(self, api: VRepApi):
self._api = api
self._left_motor = api.joint.with_velocity_control("left_motor")
self._right_motor = api.joint.with_velocity_control("right_motor")
self._left_sensor = api.sensor.proximity("left_sensor")
self._right_sensor = api.sensor.proximity("right_sensor")

def rotate_right(self, speed=2.0):
self._set_two_motor(speed, -speed)

def rotate_left(self, speed=2.0):
self._set_two_motor(-speed, speed)

def move_forward(self, speed=2.0):
self._set_two_motor(speed, speed)

def move_backward(self, speed=2.0):
self._set_two_motor(-speed, -speed)

def _set_two_motor(self, left: float, right: float):

def right_length(self):

def left_length(self):

api = VRepApi.connect("", 19997)


r = PioneerP3DX(api)
for _ in range(100):
rl = r.right_length()
ll = r.left_length()
if rl != 0 and rl < 10:
elif ll != 0 and ll < 10:


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for vrep-api-python, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size vrep-api-python-0.1.0.tar.gz (24.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page