All Projects → Troxid → vrep-api-python

Troxid / vrep-api-python

Licence: GPL-2.0 License
Simple for use Python binding for Coppelia Robotics V-REP simulator (remote API)

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to vrep-api-python

Holodeck
High Fidelity Simulator for Reinforcement Learning and Robotics Research.
Stars: ✭ 513 (+2231.82%)
Mutual labels:  simulator, robotics
Bullet3
Bullet Physics SDK: real-time collision detection and multi-physics simulation for VR, games, visual effects, robotics, machine learning etc.
Stars: ✭ 8,714 (+39509.09%)
Mutual labels:  simulator, robotics
Hexapod Robot Simulator
A hexapod robot simulator built from first principles
Stars: ✭ 577 (+2522.73%)
Mutual labels:  simulator, robotics
Habitat Lab
A modular high-level library to train embodied AI agents across a variety of tasks, environments, and simulators.
Stars: ✭ 587 (+2568.18%)
Mutual labels:  simulator, robotics
Webots
Webots Robot Simulator
Stars: ✭ 1,324 (+5918.18%)
Mutual labels:  simulator, robotics
Gazebo
Open source robotics simulator.
Stars: ✭ 404 (+1736.36%)
Mutual labels:  simulator, robotics
Gibsonenv
Gibson Environments: Real-World Perception for Embodied Agents
Stars: ✭ 666 (+2927.27%)
Mutual labels:  simulator, robotics
Hexapod
Blazing fast hexapod robot simulator for the web.
Stars: ✭ 370 (+1581.82%)
Mutual labels:  simulator, robotics
Habitat Sim
A flexible, high-performance 3D simulator for Embodied AI research.
Stars: ✭ 1,098 (+4890.91%)
Mutual labels:  simulator, robotics
Plankton
Open source simulator for maritime robotics researchers
Stars: ✭ 51 (+131.82%)
Mutual labels:  simulator, robotics
Holodeck Engine
High Fidelity Simulator for Reinforcement Learning and Robotics Research.
Stars: ✭ 48 (+118.18%)
Mutual labels:  simulator, robotics
jiminy
Jiminy: a fast and portable Python/C++ simulator of poly-articulated systems with OpenAI Gym interface for reinforcement learning
Stars: ✭ 90 (+309.09%)
Mutual labels:  simulator, robotics
Awesome Emulators Simulators
A curated list of software emulators and simulators of PCs, home computers, mainframes, consoles, robots and much more...
Stars: ✭ 94 (+327.27%)
Mutual labels:  simulator, robotics
l2r
Open-source reinforcement learning environment for autonomous racing.
Stars: ✭ 38 (+72.73%)
Mutual labels:  simulator, robotics
rcssserver
The RoboCup Soccer Simulator Server
Stars: ✭ 100 (+354.55%)
Mutual labels:  simulator
timeline
Takes tweets from a bot's followings and markovifies them. Ruby port of sneaksnake/timeline
Stars: ✭ 13 (-40.91%)
Mutual labels:  simulator
robotic-warehouse
Multi-Robot Warehouse (RWARE): A multi-agent reinforcement learning environment
Stars: ✭ 62 (+181.82%)
Mutual labels:  robotics
HackSystem
A Hack System based on ASP.NET Core and Blazor WebAssembly.
Stars: ✭ 72 (+227.27%)
Mutual labels:  simulator
behavioral cloning
No description or website provided.
Stars: ✭ 26 (+18.18%)
Mutual labels:  simulator
gear
Collision Avoidance Path Planning in Rust-lang
Stars: ✭ 29 (+31.82%)
Mutual labels:  robotics

v-rep python

Simple python binding for Coppelia Robotics V-REP simulator (remote API) of version 3.5.0 rev4

Getting started

  1. Requirements: CPython version >= 3.5.2, pip
  2. Install library from PyPI by entering this command:
[sudo] pip install 'git+https://github.com/Troxid/vrep-api-python'

V-Rep specific

Package needs platform-specific native library (remoteApi). It uses two enviroment variables VREP and VREP_LIBRARY. If VREP is unspecified package will use default /usr/share/vrep for it. If VREP_LIBRARY is also unspecified, then it will concatenate VREP with programming/remoteApiBindings/lib/lib/64Bit/. This setup was test tested under LINUX ONLY. We are open for debug under Windows. * For windows users: NOT TESTED

To use package you will need the socket port number, which can be located in V-REP/remoteApiConnections.txt.

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

Designed to be used with examples/Pioneer.ttt.

from pyrep import VRep
import time

class PioneerP3DX:

    def __init__(self, api: VRep):
        self._api = api
        self._left_motor = api.joint.with_velocity_control("Pioneer_p3dx_leftMotor")
        self._right_motor = api.joint.with_velocity_control("Pioneer_p3dx_rightMotor")
        self._left_sensor = api.sensor.proximity("Pioneer_p3dx_ultrasonicSensor3")
        self._right_sensor = api.sensor.proximity("Pioneer_p3dx_ultrasonicSensor6")

    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):
        self._left_motor.set_target_velocity(left)
        self._right_motor.set_target_velocity(right)

    def right_length(self):
        return self._right_sensor.read()[1].distance()

    def left_length(self):
        return self._left_sensor.read()[1].distance()

with VRep.connect("127.0.0.1", 19997) as api:
    r = PioneerP3DX(api)
    while True:
        rl = r.right_length()
        ll = r.left_length()
        if rl > 0.01 and rl < 10:
            r.rotate_left()
        elif ll > 0.01 and ll < 10:
            r.rotate_right()
        else:
            r.move_forward()
        time.sleep(0.1)

License

Copyright (C) 2016-2017 Stanislav Eprikov, Pavel Pletenev

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].