Giter Site home page Giter Site logo

cangjiaxaun / roboinstruct-2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rrahmati/roboinstruct-2

0.0 1.0 0.0 1.35 MB

Train a robot to see the environment and autonomously perform different tasks

License: MIT License

Python 32.97% C++ 66.73% CMake 0.30%

roboinstruct-2's Introduction

RoboInstruct-2

This framework is designed to demonstrate arbitrary object manipulation tasks to a robot and train a deep neural network to autonomously mimic that behavior by processing sequence of images from the environment.

Video

Videos of task demonstration and autonomous performance by a Lynxmotion AL5D robot

Paper

  • Rouhollah Rahmatizadeh, Pooya Abolghasemi, Ladislau Bölöni, Sergey Levine. Vision-Based Multi-Task Manipulation for Inexpensive Robots Using End-To-End Learning from Demonstration. arXiv

Installation

Dependencies:

Optional:

Demonstration

First you need a robot (If you do not have a robot, you can try the simulator in this repository: roboinstruct-1). The system should work for different robots. However, the code in this repository is only able to control a Lynxmotin AL5D robot arm. Connect this robot to your computer. Connect a camera and set its corresponding image topic in record_demonstration.py and config.py. Place the camera in a position so that it can see the robot arm and the relevant objects in the environment. Install either PlayStation Move API or LeapMotion driver and connect the device to your computer. Copy demonstrate_ros_package folder to your ROS workspace and build the ros package (catkin_make etc.). For PS Move, change the path to the PS Move API in publish_move_pose.py file. Run these commands:

rosrun demonstrate_leap leap_al5d -l 1 (1 for LeapMotion, 0 for PS Move)

rosrun demonstrate_leap publish_move_pose.py (Only for PS Move)

rosrun demonstrate_leap record_demonstration.py

If everything goes well, the recorded demonstration will be saved in your home directory. Copy them into a new folder in roboinstruct root folder and call it trajectories. Create another folder in roboinstruct root folder and call it models.

Learning

make_dataset.py reads the data from trajectories folder and converts it into appropriate formats for Chainer or Blocks code to train the neural network. Open config.py file, change make_dataset_mode to prepare_data_for_chainer, and run make_dataset.py. Go to autoencoder/chainer_vaegan/src and run train.py. When the vision part is trained well after a few epochs, copy the saved models from autoencoder/chainer_vaegan/model to autoencoder/chainer_vaegan/model-saved folder. Now in config.py file, change make_dataset_mode to prepare_data_for_blocks, and run make_dataset.py. run train.py to train the LSTM model given visual features. This saves the final model into the models folder.

Most of the parameters can be set in config.py. There are some ideas implemented that are not included in the paper such as multi-timescale learning, auxiliary predictions, etc. You can take a look at the config.py to see a short description of these ideas. If you feel confident, you can change these parameters.

Testing on the robot

For testing the trained model on the robot, first run rosrun demonstrate_leap leap_al5d so that you can send commands to the robot. Setup the camera and run it to publish the images on its corresponding ROS topic. Set the ID of the task that you want to robot to perform in task_to_perform variable in config.py. Run sample.py to load the saved model and generates the trajectory and send commands to the robot.

Acknowledgment

The codes in the char-rnn, chainer-vae-gan, and leap-hand repositories helped a lot in this project.

roboinstruct-2's People

Contributors

rrahmati avatar

Watchers

 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.