Coder Social home page Coder Social logo

gbartyzel / gym-vrep Goto Github PK

View Code? Open in Web Editor NEW
36.0 3.0 13.0 30.54 MB

Open-AI Gym extension for robotics based on V-REP

License: Apache License 2.0

Python 100.00%
v-rep reinforcement-learning openai-gym robotics deep-reinforcement-learning rl mobile-robotics coppeliasim

gym-vrep's Introduction

Open-AI Gym extension for robotics based on V-REP

Environments

  1. Mobile robot navigation - the mobile robot contains ultrasonic sensors, IMU and two DC motors. Number of ultrasonic sensors depends on task type. The task of this agent is to navigate from position A to position B. There are implemented two variants presented below.
Environment Description
RoomNavigation Environment with static obstacles like walls.
DynamicRoomNavigation Environment with dynamic obstacles like randomly moving mobile robots.

The environment can be customized with four parameters:

  • navigation_type - Selects the type of the navigation algorithms from the supported ones (ideal, odometry, gyrodometry). Default is ideal.
  • enable_vision - Whether to include visual feedback to the observation space. Default is False.
  • goal_threshold - Defines the threshold value for reaching the goal. Default value is set to 0.05.
  • collision_threshold - Defines the threshold distance for the proximity sensors, when the collision occurs. Default value is set to 0.05.

Action space are desired motor angular velocities in rad/s. They are limited to (0, 15.0) rad/s.

Environment observation space description:

  • distances from n proximity sensors
  • polar coordinates
  • linear and angular velocities
  • (optional) image from camera sensor

Getting started

Here are provided basic requirements for the project:

  • CoppeliaSim 4.1.0+
  • Python 3.6+
  • Ubuntu 20.04
  • OpenAI gym
  • PyRep

Python

To install this package run following commands:

git clone https://github.com/Souphis/gym-vrep.git
cd gym-vrep
python3 setup.py install

Basic usage

To run the environment with default configuration just add follwing code to your project:

import gym
import gym_coppelia_sim

env = gym.make("RoomNavigation-v0") # or env = gym.make("DynamicRoomNavigation-v0")

Below is the example how to run environment in the headless mode:

import gym
import gym_coppelia_sim

env = gym.make("RoomNavigation-v0", headless_mode=True)

Changing the navigation algorithm can be done with following example:

import gym
import gym_coppelia_sim

env = gym.make("RoomNavigation-v0", navigation_algos="odometry")

gym-vrep's People

Contributors

gbartyzel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gym-vrep's Issues

no directory

how to solvr this question no such in this directry

Dynamic programming

How can we add dynamic bellman equation for reward function? It will be more sensitive rewards for us.
thank u

Qt Aborted (core dumped)

Hi, Souphis! First thanks for this repo. I'm trying to install gym-vrep everything is OK until I try to run simple_run.py on vscode. It shows me an error about Qt.
Here is the error:
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in "/home/jack/anaconda3/envs/pyt38/lib/python3.8/site-packages/cv2/qt/plugins" This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Aborted (core dumped)

After install Qt5, I got a similar error. It shows me that ... Qt plugin "xcb" is found but can nott be used ...

No module named gym.envs.registration

Hello, first thanks for this repo. I'm trying to install gym-vrep everything is OK untill I try run ipython init.py on terminal it show me an error about Importing gym error. How does this library works ? When I try it on pycharm it shows no error but nothing happens. Help me please.

Here is the error:


ImportError Traceback (most recent call last)
/home/supreme/gym-vrep/gym_vrep/init.py in ()
1 import logging
----> 2 from gym.envs.registration import register
3
4 logger = logging.getLogger(name)
5 register(

ImportError: No module named gym.envs.registration

pıoneer robot

how can i change robot? for example i changed the smartbot to pıoneer robot . when the pıoneer robot hit obstacles, the episode cant change to new episode. how can i fix it?

Check connection status

Fix (line 65 of gym_vrep.py)

print('Connecting to V-REP on port {}'.format(self._port))
client = vrep.simxStart('127.0.0.1', self._port, True, True, 1000, 5)
assert client >=0, 'Connection to V-REP failed!'

Error when running the simple examle

I'm trying to run the provided example.
I'm on a fresh install of Ubuntu 20 in virtual box.
All dependencies installed. When trying to run the simple_run.py in VS Code I get this error:

Exception has occurred: TypeError ufunc 'isinf' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe'' File "/home/vvv/gym-vrep/examples/simple_run.py", line 7, in main env = gym.make("DynamicRoomNavigation-v0") File "/home/vvv/gym-vrep/examples/simple_run.py", line 20, in <module> main()

And this is in terminal:

cd /home/vvv/gym-vrep ; /usr/bin/env /bin/python3 /home/vvv/.vscode/extensions/ms-python.python-2022.6.2/pythonFiles/lib/python/debugpy/launcher 35247 -- /home/vvv/gym-vrep/examples/simple_run.py /usr/local/lib/python3.8/dist-packages/gym_coppelia_sim-0.2.0-py3.8.egg/gym_coppelia_sim/envs/mobile_robot_navigation/mobile_robot_navigation.py:230: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. velocities = np.array([0.0, -max_angular_vel]) /usr/local/lib/python3.8/dist-packages/gym_coppelia_sim-0.2.0-py3.8.egg/gym_coppelia_sim/envs/mobile_robot_navigation/mobile_robot_navigation.py:253: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray. velocities = np.array([max_linear_vel, max_angular_vel])

Do I need to modify the mobile_robot_navigation.py somehow just to get the simple_run.py to do something?

Odometry problem

when i tried odometry navigation, my goal is not working . How can i fix it . my goal not seen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.