[IROS'21] SurRoL: An Open-source Reinforcement Learning Centered and dVRK Compatible Platform for Surgical Robot Learning

Overview

SurRoL

SurRoL

IROS 2021 SurRoL: An Open-source Reinforcement Learning Centered and dVRK Compatible Platform for Surgical Robot Learning

Features

  • dVRK compatible robots.
  • Gym style API for reinforcement learning.
  • Ten surgical-related tasks.
  • Various object assets.
  • Based on PyBullet for physics simulation.

Installation

The project is built on Ubuntu with Python 3.7, PyBullet, Gym 0.15.6, and evaluated with Baselines, TensorFlow 1.14.

Prepare environment

  1. Create a conda virtual environment and activate it.

    conda create -n surrol python=3.7 -y
    conda activate surrol
  2. Install gym (slightly modified), tensorflow-gpu==1.14, baselines (modified).

Install SurRoL

git clone https://github.com/jiaqixuac/surrol.git
cd surrol
pip install -e .

Get started

The robot control API follows dVRK (before "crtk"), which is compatible with the real-world dVRK robots.

You may have a look at the jupyter notebooks in tests. There are some test files for PSM and ECM, that contains the basic procedures to start the environment, load the robot, and test the kinematics.

We also provide some run files to evaluate the environments using baselines.

License

SurRoL is released under the MIT license.

Citation

If you find the paper or the code helpful to your research, please cite the project.

@inproceedings{xu2021surrol,
  title={SurRoL: An Open-source Reinforcement Learning Centered and dVRK Compatible Platform for Surgical Robot Learning},
  author={Xu, Jiaqi and Li, Bin and Lu, Bo and Liu, Yun-Hui and Dou, Qi and Heng, Pheng-Ann},
  booktitle={2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
  year={2021},
  organization={IEEE}
}

Acknowledgement

The code is built with the reference of dVRK, AMBF, dVRL, RLBench, Decentralized-MultiArm, Ravens, etc.

You might also like...
Trading Gym is an open source project for the development of reinforcement learning algorithms in the context of trading.

Trading Gym Trading Gym is an open-source project for the development of reinforcement learning algorithms in the context of trading. It is currently

Conservative Q Learning for Offline Reinforcement Reinforcement Learning in JAX
Conservative Q Learning for Offline Reinforcement Reinforcement Learning in JAX

CQL-JAX This repository implements Conservative Q Learning for Offline Reinforcement Reinforcement Learning in JAX (FLAX). Implementation is built on

Reinforcement-learning - Repository of the class assignment questions for the course on reinforcement learning

DSE 314/614: Reinforcement Learning This repository containing reinforcement lea

Open source hardware and software platform to build a small scale self driving car.

Donkeycar is minimalist and modular self driving library for Python. It is developed for hobbyists and students with a focus on allowing fast experimentation and easy community contributions.

Megaverse is a new 3D simulation platform for reinforcement learning and embodied AI research

Megaverse Megaverse is a new 3D simulation platform for reinforcement learning and embodied AI research. The efficient design of the engine enables ph

PyZebrascope - an open-source Python platform for brain-wide neural activity imaging in behaving zebrafish
PyZebrascope - an open-source Python platform for brain-wide neural activity imaging in behaving zebrafish

PyZebrascope - an open-source Python platform for brain-wide neural activity imaging in behaving zebrafish

A set of tools for creating and testing machine learning features, with a scikit-learn compatible API

Feature Forge This library provides a set of tools that can be useful in many machine learning applications (classification, clustering, regression, e

MiniHack the Planet: A Sandbox for Open-Ended Reinforcement Learning Research
MiniHack the Planet: A Sandbox for Open-Ended Reinforcement Learning Research

MiniHack the Planet: A Sandbox for Open-Ended Reinforcement Learning Research

🔮 A refreshing functional take on deep learning, compatible with your favorite libraries

Thinc: A refreshing functional take on deep learning, compatible with your favorite libraries From the makers of spaCy, Prodigy and FastAPI Thinc is a

Comments
  • SurRol RL setting merge

    SurRol RL setting merge

    Hello,

    I've got trouble to make SurRol RL env setting. First of all, I was deeply impressed with your SurRol projects.

    Here is my problem. I can execute 'needle_pick' and 'needle_regrasp' tasks easily. Then, I want to merge them and learn with Reinforcement Learning.

    I divided needle to 18 parts to grab.(This is pybullet env and I pressed 'w' and 'a' key when it execute)

    And I want to make,

    1. PSM1 grasp needle random point of 18 parts
    2. PSM2 regrasp needle random point with RL with stable_baseline3(Cause baseline in github service has been terminated.)

    I appreciate if you give me an advice for me. Also, I sent you an email for details.

    Best regards, Donghyeon Choi

    opened by Choirong 4
  • HOW to test training of environment

    HOW to test training of environment

    Hello,

    thank you for sharing your repo. I wanted to test it and replicate your results. I have downloaded and installed it. I run the test scripts and everything seems fine. I then checked inside /run where there are three bash script.

    I tried to run ddpg_activetrack.sh with the following env id -env=ActiveTrack-v0.

    I get the following error:

    Traceback (most recent call last):

    File "/home/claudia/.pyenv/versions/3.7.12/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/home/claudia/.pyenv/versions/3.7.12/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/claudia/data/virtual_environments/surrol/lib/python3.7/site-packages/baselines-0.1.6-py3.7.egg/baselines/run.py", line 250, in main(sys.argv) File "/home/claudia/data/virtual_environments/surrol/lib/python3.7/site-packages/baselines-0.1.6-py3.7.egg/baselines/run.py", line 216, in main model, env = train(args, extra_args) File "/home/claudia/data/virtual_environments/surrol/lib/python3.7/site-packages/baselines-0.1.6-py3.7.egg/baselines/run.py", line 54, in train env_type, env_id = get_env_type(args) File "/home/claudia/data/virtual_environments/surrol/lib/python3.7/site-packages/baselines-0.1.6-py3.7.egg/baselines/run.py", line 143, in get_env_type assert env_type is not None, 'env_id {} is not recognized in env types'.format(env_id, _game_envs.keys()) AssertionError: env_id ActiveTrack-v0 is not recognized in env types

    Is there a problem with the environment registration in gym?

    Following the Issue #662 from Baslines i have add the following line in baselines/run.py at line 52: _game_envs['custom_type'] = { 'ActiveTrack-v0'}

    But again i get the following error: gym.error.UnregisteredEnv: No registered env with id: ActiveTrack-v0

    Thank you, Cheers Claudia

    opened by Cladett 2
  • Fix bug of parallelized environments

    Fix bug of parallelized environments

    Hi, @jiaqixuac. This PR aims to fix the bug of running parallel (vectorized) PSM environments. I will explain the cause of the found issue and how to fix that.

    When running parallel environments, Pybullet will assign unique object ids to each env. For example, if there is an eval_env (called at first) and a train_env (called at second), which is the case in Stable_baselines3, Pybullet will assign ids of 0-5 to the eval_env and ids of 6-11 to the train_env. Then train_env will store 0-5 into self.obj_ids. Of course, there is no problem when initializing them. However, when you reset those envs through and sample a new goal for the train_env, the function reset(self) will call p.resetSimulation() to reset the simulation. Afterward, Pybullet will assign ids of 0-5 to the train_env. The self.obj_ids of train_env now becomes 0-11. Note that the valid ids are 0-5 now. But in _env_setup(self), the id self.obj_id of the object (like needle) will be set as self.obj_ids['rigid'][0], which belongs to 6-11 (since 0-5 is stored at first, the value at index=0 of the id list is in 0-5). This leads an error pybullet.error: getLinkState failed, since self.obj_id is not contained in the valid ids 0-5.

    One possible solution is to reset self.obj_ids along with resetting the simulation. By doing this, we can guarantee that self.obj_id is always in the currently valid objective ids.

    opened by TaoHuang13 1
  • Error while running script

    Error while running script

    Hi, how can i use step function correctly? when i wrote: `import gym import numpy as np from surrol.const import ROOT_DIR_PATH import surrol.gym

    env = gym.make("NeedlePick-v0") env.reset() while True: obs = env.step(np.random.randn(5)) env.render()` it gave me an error:

    Traceback (most recent call last): File "dato1.py", line 12, in <module> obs = env.step(np.random.randn(5)) File "/home/dato/src/my_projects/robotics/venv/lib/python3.8/site-packages/gym/wrappers/time_limit.py", line 50, in step observation, reward, terminated, truncated, info = self.env.step(action) ValueError: not enough values to unpack (expected 5, got 4) Destroy EGL OpenGL window. how can i fix this?

    opened by datonefaridze 1
Owner
Med-AIR@CUHK
Medical Image Analysis, Artificial Intelligence, Robotics
Med-AIR@CUHK
PaddleRobotics is an open-source algorithm library for robots based on Paddle, including open-source parts such as human-robot interaction, complex motion control, environment perception, SLAM positioning, and navigation.

简体中文 | English PaddleRobotics paddleRobotics是基于paddle的机器人开源算法库集,包括人机交互、复杂运动控制、环境感知、slam定位导航等开源算法部分。 人机交互 主动多模交互技术TFVT-HRI 主动多模交互技术是通过视觉、语音、触摸传感器等输入机器人

null 185 Dec 26, 2022
HSC4D: Human-centered 4D Scene Capture in Large-scale Indoor-outdoor Space Using Wearable IMUs and LiDAR. CVPR 2022

HSC4D: Human-centered 4D Scene Capture in Large-scale Indoor-outdoor Space Using Wearable IMUs and LiDAR. CVPR 2022 [Project page | Video] Getting sta

null 51 Nov 29, 2022
Space robot - (Course Project) Using the space robot to capture the target satellite that is disabled and spinning, then stabilize and fix it up

Space robot - (Course Project) Using the space robot to capture the target satellite that is disabled and spinning, then stabilize and fix it up

Mingrui Yu 3 Jan 7, 2022
Guiding evolutionary strategies by (inaccurate) differentiable robot simulators @ NeurIPS, 4th Robot Learning Workshop

Guiding Evolutionary Strategies by Differentiable Robot Simulators In recent years, Evolutionary Strategies were actively explored in robotic tasks fo

Vladislav Kurenkov 4 Dec 14, 2021
MohammadReza Sharifi 27 Dec 13, 2022
[ICML 2020] Prediction-Guided Multi-Objective Reinforcement Learning for Continuous Robot Control

PG-MORL This repository contains the implementation for the paper Prediction-Guided Multi-Objective Reinforcement Learning for Continuous Robot Contro

MIT Graphics Group 65 Jan 7, 2023
Motion Planner Augmented Reinforcement Learning for Robot Manipulation in Obstructed Environments (CoRL 2020)

Motion Planner Augmented Reinforcement Learning for Robot Manipulation in Obstructed Environments [Project website] [Paper] This project is a PyTorch

Cognitive Learning for Vision and Robotics (CLVR) lab @ USC 49 Nov 28, 2022
Deep Reinforcement Learning for mobile robot navigation in ROS Gazebo simulator

DRL-robot-navigation Deep Reinforcement Learning for mobile robot navigation in ROS Gazebo simulator. Using Twin Delayed Deep Deterministic Policy Gra

null 87 Jan 7, 2023
Robot Reinforcement Learning on the Constraint Manifold

Implementation of "Robot Reinforcement Learning on the Constraint Manifold"

null 31 Dec 5, 2022