Code Monkey home page Code Monkey logo

leap_hand_sim's Introduction

LEAP Hand: Low-Cost, Efficient, and Anthropomorphic Hand

This repository contains the URDF, IsaacGym environment and sim2real deployment code for the paper "LEAP Hand: Low-Cost, Efficient, and Anthropomorphic Hand for Robot Learning" (https://arxiv.org/abs/2309.06440).

Installation

Setup a conda environment (optional)

conda create -n leapsim python=3.8
conda activate leapsim

Install Pytorch using these instructions

Download the Isaac Gym Preview 4 release from the website, then follow the installation instructions in the documentation

cd isaacgym/python
pip install -e .

Clone and install leapsim python packages

git clone https://github.com/leap-hand/LEAP_Hand_Sim
cd LEAP_Hand_Sim
pip install matplotlib gitpython numpy==1.20.3 wandb
pip install -e .

Running a pretrained policy

You can run a pretrained in-hand reorienation policy to check your install. To deploy this policy on the real hand, see the real-world deployment section below.

cd leapsim
python3 train.py wandb_activate=false num_envs=1 headless=false test=true task=LeapHandRot checkpoint=runs/pretrained/nn/LeapHand.pth

sim-deployment

Real-world deployment

  • Running in the real world requires our LEAP Hand ROS API.
  • Follow the instructions in the above link and then run roslaunch example.launch first. The hand should go to the home pose.
  • Next, in a separate window run deploy.py using:
cd leapsim
python3 deploy.py wandb_activate=false num_envs=1 headless=false test=true task=LeapHandRot checkpoint=runs/pretrained/nn/LeapHand.pth
  • The hand should go to a pre-grasp pose and then rotate a 7.5cm cube by default.

rw-deployment

Training your own policy

First, generate a cache of stable grasps for different cube sizes

for cube_scale in 0.9 0.95 1.0 1.05 1.1 
do
	bash scripts/gen_grasp.sh $cube_scale custom_grasp_cache num_envs=1024 
done

This will generate .npy files in the leapsim/cache folder. Next, train a policy using this grasp cache

python3 train.py task=LeapHandRot max_iterations=1000 task.env.grasp_cache_name=custom_grasp_cache

If you wish to not use wandb append wandb_activate=false

for cube_scale in 0.9 0.95 1.0 1.05 1.1 
do
	bash scripts/gen_grasp.sh $cube_scale custom_grasp_cache num_envs=1024 wandb_activate=false
done
python3 train.py task=LeapHandRot max_iterations=1000 task.env.grasp_cache_name=custom_grasp_cache wandb_activate=false

After training, the policy can be visualized by running

python3 train.py wandb_activate=false num_envs=1 headless=false test=true task=LeapHandRot checkpoint=runs/<checkpoint_name>/nn/LeapHand.pth

For training details of this policy refer to the LEAP hand paper section VI-D.

Citing

If you find LEAP hand or this codebase useul in your research, please cite:

@article{
	shaw2023leaphand,
	title={LEAP Hand: Low-Cost, Efficient, and Anthropomorphic Hand for Robot Learning},
	author={Shaw, Kenneth and Agarwal, Ananye and Pathak, Deepak},
	journal={Robotics: Science and Systems (RSS)},
	year={2023}
}

Acknowledgements

Check out the following amazing codebases we build upon

leap_hand_sim's People

Contributors

anag004 avatar lucky7chess avatar

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.