Mingrui-Yu / shape_control_DLO

Repo for ICRA 2022 paper "Shape control of Deformable Linear Objects with Offline and Online learning of Local Linear Deformation Models"
MIT License
19 stars 3 forks source link

shape_control_DLO

Project website

Code for ICRA 2022 paper "Shape Control of Deformable Linear Objects with Offline and Online Learning of Local Linear Deformation Models".

Here we provide:

Dependencies

Installation

Install the following dependences in your python3 env:

pip install numpy
pip install matplotlib
pip install sklearn
pip install rospkg
pip install empy
pip install PyYAML
pip install mlagents==0.27.0
pip install gym
pip install gym_unity
pip install scipy

Clone the repository:

git clone https://github.com/Mingrui-Yu/shape_control_DLO.git

Build the catkin workspaces:

cd <YOUR_PATH>/shape_control_DLO/ws_dlo
catkin_make

Change the variable "project_dir" in shape_control_DLO/'ws_dlo/src/dlo_system_pkg/config/params_sim.yaml to '/shape_control_DLO/'.

If you want to retrain the offline model, you can download the training dataset: OneDrive. Then unzip it and put it in /shape_control_DLO/.

Usage

Give permissions to the simulation environment:

chmod -R 755 <YOUR_PATH>/shape_control_DLO/env_dlo/env_2D
chmod -R 755 <YOUR_PATH>/shape_control_DLO/env_dlo/env_3D

Source the workspace:

cd <YOUR_PATH>/shape_control_DLO/ws_dlo
source devel/setup.bash

Parameter settings

Modifiable parameters in shape_control_DLO/ws_dlo/src/dlo_system_pkg/config/params_sim.yaml:

Run the control tasks

Activate your python3 env, and run:

roslaunch dlo_system_pkg simulation_run.launch

Train the neural network

First, run

roslaunch dlo_system_pkg upload_params.launch

Then, Activate your python3 env, and run the python script:

python src/dlo_manipulation_pkg/scripts/RBF.py

Details

Built simulation environment

The simulation environment is an executable file built by Unity. In both 2D and 3D environment, the ends of the DLO are grasped by two grippers which can translate and rotate.

Both the control rate and the data collection rate are 10 Hz.

The manipulated DLO is with a length of 0.5m and a diameter of 1cm.

Coordinate

We use a standard right-hand coordinate in the simulation environment.

In 2D tasks, the x axis is towards the bottom of the screen. The y axis is towards the right of the screen. The z axis is towards the outside of the screen.

In 3D tasks, the x axis is towards the outside of the screen. The y axis is towards the right of the screen. The z axis is towards the top of the screen.

Actually, the coordinates in 2D and 3D environment are the same. Only the position of the camera is changed.

Feature

Ten features are uniformly distributed along the DLO, which are represented by blue points. Note that the first and last features are the left and right ends, so they actually represent the positions of the robot end-effectors.

Desired shape

The desired shape is represented by the desired positions of 10 features. All desired shapes are chosen from the training dataset, so they are ensured to be feasible. The 100 2D desired shapes are stored in shape_control_DLO/env_dlo/env_2D_Data/StreamingAssets/desired_shape/2D/desired_positions.npy and the 100 3D desired shapes are stored in shape_control_DLO/env_dlo/env_2D_Data/StreamingAssets/desired_shape/3D/desired_positions.npy .

Note that in control tasks, only the desired positions of the internal 8 features are considered (set as the target points).

State

The state is a 116-dimension vector.

Note that in 2D environment, the dimension of the position of one feature is still three, but the value in the z axis is always zero.

Action

The action is a 12-dimension vector.

In our implementation, the action is formulated as the above format in both 2D and 3D environment. Thus, in 2D tasks, we need to output valid control input in the controller script, where the [2, 3, 4, 8, 9, 10] dimension of the control input must be zero.

Training dataset

Our offline collected data are in shape_control_DLO/data/train_data.

The format of the training dataset is (-1, 116). Each row is a 116-dimension state vector.

The lengths and diameters of the 10 DLOs:

DLO length(m) diameters(mm)
1 0.7 20
2 0.8 6
3 0.6 16
4 0.4 8
5 0.4 18
6 1.0 18
7 1.0 30
8 0.8 10
9 0.6 8
10 0.5 14

Citation

Please cite our paper if you find it helpful :)

@INPROCEEDINGS{yu2022shape,
  author={Yu, Mingrui and Zhong, Hanzhong and Li, Xiang},
  booktitle={2022 International Conference on Robotics and Automation (ICRA)}, 
  title={Shape Control of Deformable Linear Objects with Offline and Online Learning of Local Linear Deformation Models}, 
  year={2022},
  volume={},
  number={},
  pages={1337-1343},
  doi={10.1109/ICRA46639.2022.9812244}}

Contact

If you have any question, feel free to raise an issue (recommended) or contact the authors: Mingrui Yu, ymr20@mails.tsinghua.edu.cn