This repository makes it possible for researchers to easily gather a dataset of images for training a robot to perform robotic manipulation. The dataset contains 2-d images that have been rendered with the use of the V-REP physics simulation engine. The repository enables users to readily apply domain randomization through varying light conditions, object textures, background colors and textures, camera position, target object location and target object dimensions. Additionally, the repository provides two different methods with which the robot can be trained to grasp the object using the previously collected dataset. The first method depends on classification, so the robot receives various potential grasps on the action space (the space in which it is allowed to perform grasps) as well as one spatial image and outputs the probability that the given grasps will result in a successful grasp. The second method depends on regression, so the robot has to learn to predict a successful grasp given just the spatial image. A grasp is a 3-dimensional vector that is made up of the x and y location on the action space as well as of the orientation of the grasp.
-
Linux Operating System, preferably Ubuntu 18.04.
-
Please download the V-REP physics simulation engine. The repository was
created using the V-REP PRO EDU, Ubuntu 18.04
sudo apt-get install libxkbcommon-x11-dev
export PATH=$PATH:~/Qt/Tools/QtCreator/bin
-
Create SWAP file, as the installation of torch is a highly memory consuming procedure.
sudo fallocate -l 8G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile sudo cp /etc/fstab /etc/fstab.back echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab -
sudo pip install future -
Finally, change the path accordingly.
-
If you don't already have it, install Python.
This repository was developed is compatible with Python 2.7.
-
General recommendation for Python development is to use a Virtual Environment. For more information, see https://docs.python.org/3/tutorial/venv.html
Install and initialize the virtual environment with the "venv" module on Python 3 (you must install virtualenv for Python 2.7):
python -m venv mytestenv # Might be "python3" or "py -3.6" depending on your Python installation cd mytestenv source bin/activate
-
Clone the repository.
git clone https://github.com/gthd/supervised_learning.git -
Install the dependencies using pip.
cd supervised_learning pip install -r requirements.txt -
There is the option of whether to show the V-REP simulation environment while the robot gathers data. To enable visualization delete the -h parameter from
supervised_learning/supervised/robot.py
Line 77 in 2aab258
A demo app is included to show how to use the project.
To collect the dataset run:
python supervised/supervised.py
To train the robot using classification run:
python supervised/q_network.py
To train the robot using regression run:
python supervised/regression.py
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project is licensed under the MIT License - see the LICENSE.md file for details
- I want to acknowledge the help and guidance I received from my supervisor Edward Johns.