Giter Club home page Giter Club logo

doorgym's Introduction

DoorGym

Updates

12/14/2019 Presenting poster at Deep RL workshop at NeurIPS 2019! (paper)

11/3/2019 Now you can choose Baxter as a robot!

8/30/2019 Doorgym-Unity plugin has been released!

8/26/2019 Door opening agent trainer has been released!

8/13/2019 Random Door knob Generator has been released!

8/12/2019 Door knob Dataset (3K knobs for each type) has been released!

DoorGym includes follows.

  • Door knob data set (Pull knob, Lever knob, Round knob 3K each)
  • Robot xml (UC Berkeley's BLUE, Rethinkrobot's Baxter)
  • Random Door world generator
  • Door opening policy trainer
  • Mujoco-Unity Plugin ver. Doorgym

0. Set up the environment

requirement:

  • Ubuntu 16.04 or later (Confirmed only on 16.04)

-Python3.6 or later

-Mujoco

-Mujoco-py

-Gym 0.14.0 or later

-OpenAI Baseline 0.1.6 or later

-Unity3D

etc.

Conda (Anaconda, Miniconda)

Step1. Install Mujoco

  1. Get the license from MuJoCo License page

  2. Download Mujoco2.00 from MuJoCo Product page.

  3. Extruct it and place it in under home/.mujoco, as /mujoco200 (Not mujoco200_linux).

  4. Put your key under both .mujoco/ and .mujoco/mujoco200/bin.

Detailed installation can be checked in following page. https://github.com/openai/mujoco-py

Step2. Set environment var. and install necessary pkgs

sudo apt install libosmesa6-dev libgl1-mesa-glx libglfw3 libglew-dev libopenmpi-dev patchelf

Set following path in ~/.bashrc.

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/[usr-name]/.mujoco/mujoco200/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/nvidia-[driver-ver]
export PYTHONPATH=$PYTHONPATH:/home/[use-name]/DoorGym/DoorGym-Unity/python_interface
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libGLEW.so

Step3. Clone DoorGym repo and Create conda environment

git clone https://github.com/PSVL/DoorGym
cd ./DoorGym
git submodule init
git submodule update
conda env create -n doorgym -f environment/environment.yml
conda activate doorgym
pip install -r requirements.txt
pip install -r requirements.dev.txt

Step4. Install doorenv (0.0.1)

cd envs
pip install -e .

Step5. Install OpenAI Baselines (0.1.6<)

cd ../..
git clone https://github.com/openai/baselines
cd baselines
pip install -e .

Step6. Import test

Make sure that you can import pytorch and mujoco-py w/o problem.

Python 3.7.4 (default, Aug 13 2019, 20:35:49) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
>>> import mujoco_py

If there is an error while importing mujoco-py, try trouble shooting according to the mujoco-py installation guide

1. Download the randomized door knob dataset

You can download from the following URL (All tar.gz file).

Pull knobs (0.75 GB)

Lever knobs (0.77 GB)

Round knobs (1.24 GB)

  • Extract and place the downloaded door knob dataset under the world_generator/door folder (or make a symlink).
  • Place your favorite robots under the world_generator/robot folder. (Blue robots are there as default)

2. Generate door world (e.g. lever knob and hook arm combination.)

cd [path/to/]DoorGym/world_generator

python world_generator.py --knob-type lever --robot-type floatinghook

Check the model by running the mujoco simulator

cd ~/.mujoco/mujoco200/bin

./simulate [path/to/DoorGym]/DoorGym/world_generator/world/lever_floatinghook/1551848929_lever_floatinghook.xml

More detailed instruction here

3. train the agent on the generated door worlds (e.g. lever knob and hook arm combination.)

Proximal Policy Optimization (PPO) training

python main.py --env-name doorenv-v0 --algo ppo --num-steps 4096 --num-processes 8 --lr 1e-3 --save-name ppo-test --world-path /[abs_path/to/DoorGym/]DoorGym/world_generator/world/pull_floatinghook

Soft Actor Critic (SAC) training

python main.py --env-name doorenv-v0 --algo sac --save-name ppo-test --world-path /[abs_path/to/DoorGym/]DoorGym/world_generator/world/pull_floatinghook

Twin Delayed DDPG (TD3) and Advantage Actor-Critic (A2C) can be used as following arguments

--algo td3 or --algo a2c.

4. Train with vision network estimator

Install Unity3D editor for Linux.

Open the project in DoorGym-Unity Plugin from submodule DoorGym-Unity.

with Unity

python main.py --env-name doorenv-v0 --algo ppo --num-steps 4096 --num-processes 8 --lr 1e-3 --save-name ppo-test --world-path /[abs_path/to/DoorGym/]DoorGym/world_generator/world/pull_floatinghook --visionnet-input --unity

without Unity

python main.py --env-name doorenv-v0 --algo ppo --num-steps 4096 --num-processes 8 --lr 1e-3 --save-name ppo-test --world-path /[abs_path/to/DoorGym/]DoorGym/world_generator/world/pull_floatinghook --visionnet-input

5. Run the policy

python enjoy.py --env-name doorenv-v0 --load-name trained_models/ppo/doorenv-v0_reacher-pull-floatinghook.600.pt --world-path /[abs_path/to/DoorGym/]DoorGym/world_generator/world/pull_floatinghook

Paper

Newer paper with Sim2Real (NeurIPS workshop)

Arxiv paper: https://arxiv.org/abs/1908.01887

Reference

This repo is powered by following excellent repos and software.

doorgym's People

Contributors

yusukeurakami 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  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  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  avatar  avatar  avatar

doorgym's Issues

Unity version?

I have question about Unity version, because I use this repo and install the new version Unity 2020.3.25f1 run readme train with vision network with unity, the Unity screen can render doorgym environment as below picture.
image
However the terminal always frozen and didn't any response like below picture.
image
Is the version of Unity wrong? or some problem?
I use Ubuntu 20.04 and my driver version is nvidia-460.

Run doorgym in docker container

Can I run the doorgym in docker container?
because i don't know how to run the unity in the docker container,which seems that has no display device.

Knob Datasets download issue

Hello, your work is so interesting. But currently it seems that I can not download three knob datasets, which means to require the download permission.
Looking forwards to your help, thank you. ๐Ÿ˜ƒ
Iโ€˜ve solved the problem by changing another browser.

Random Door Knob Generator Source Code

On the README it states that "8/13/2019 Random Door knob Generator has been released!". However, I can only find the world generator in the source code. Is this door knob generator publicly available? If so, where can I access it?

Handle moves within door plane

Hi,

We are trying to use the environment for training a Toyota HSR to open doors, but we seem to have some problem with the collisions, which leads to the handle moving within the plane of the door. The problem is illustrated in the image below, where you can see the handle being pushed away towards the middle of the door:

hsr_door_opening_moving_handle

In case it's relevant, we generated our robot model from the HSR's URDF (if it helps to debug the issue, we have the model in our fork: https://github.com/alex-mitrevski/DoorGym/blob/feature/hsr/world_generator/robot/hsr.xml). For the collision, we used contype="16" and conaffinity="7"as in the Blue floating hook model.

We trained the robot using PPO and the training seemed to be going well, but the learned policy obviously makes no sense due to the incorrect physical behaviour.

Do you by any chance know what might be going wrong here? Are we perhaps making a mistake in defining the collisions?

Thanks!

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.