forked from incognite-lab/myGym
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.old
More file actions
270 lines (163 loc) · 8.21 KB
/
Copy pathREADME.old
File metadata and controls
270 lines (163 loc) · 8.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270

We introduce myGym, a toolkit suitable for fast prototyping of neural networks in the area of robotic manipulation and navigation. Our toolbox is fully modular, so that you can train your network with different robots, in several environments and on various tasks. You can also create a curriculum of tasks with increasing complexity and test your network on them.
From version 3.10 there is SB3 and Gymnasium implemented and there is a basic set of protorewards to create any manipulation task from their combination. Their composition is semi automated and will be fully automated in next realese. It is possible to train multiple networks within one task and switch between them based on reward or adaptively. The number of networks is specified in config file.
[](https://shields.io/)
[](https://shields.io/)
[](https://shields.io/)
[](https://shields.io/)
[](https://shields.io/)
[](https://shields.io/)
[](https://shields.io/)
[](https://shields.io/)
## Install myGym 3.10
From myGym 3.10 there is Stable Baseline 3 and Gymnasium.
If you want to use old myGym 3.7. with Stable Baselines1 and Gym, switch to branch mygym-3.7
Clone the repository:
`git clone https://github.com/incognite-lab/mygym.git`
`cd mygym`
Create Python 3.10 conda env:
`conda create -n mygym Python=3.10`
`conda activate mygym`
Install myGym:
`pip install -e .`
If you face troubles with mpi4py dependency install the lib:
`sudo apt install libopenmpi-dev`
## myGym 3.10 presents
* Atomic rewards
* Protorewards
* Atomic actions
* Easy multi-step task definition
* Nico and Tiago robot support
* Multi-step tasks with custom robots

* Multi-goal rewards for training long horizon

* Automatic tasks checker (oraculum)

* Parallelized training within CPU and GPU on cluster
## Overview
| Environment | Gym-v0 is suitable both single-step and multi-step manipulation and navigation|
|---|---|
| Workspaces | Table, Collaborative table, Maze, Vertical maze, Drawer, Darts, Football, Fridge, Stairs, Baskets |
| Vision | Cartesians, RGB, Depth, Class, Centroid, Bounding Box, Semantic Mask, Latent Vector |
| Robots | 9 robotic arms, 2 dualarms, humanoid |
| Robot actions | Absolute, Relative, Joints |
| Objects | 54 objects in 5 categories |
| Tasks | Reach, Press, Switch, Turn, Push, Pick, Place, PicknPlace, Poke,MultiReach, MultiPNP|
| Randomizers | Light, Texture, Size, Camera position |
| Baselines | Tensorflow, Pytorch |
| Physics | Bullet, Mujoco deprecated from version 2.0 |
## Test the environments prior training
You can visualize the virtual gym env prior to the training.
`python test.py`
There will be the default workspace activated.
## Visualization Tools
myGym includes several visualization utilities to help you explore and understand the environment:
### Visualize All Objects
View all available URDF objects in a grid layout:
```bash
python myGym/visualize_all_objects.py
```
This script:
- Recursively finds all URDF files in `myGym/envs/objects` directory
- Displays them in a square grid on a plane in PyBullet
- Supports customization options:
```bash
# Custom spacing between objects (default: 0.3 meters)
python myGym/visualize_all_objects.py --spacing 0.5
# Use a different plane
python myGym/visualize_all_objects.py --plane plane_old.urdf
# Run without GUI (useful for testing)
python myGym/visualize_all_objects.py --no-gui
```
### Visualize Robot
Interactively visualize and control robot joints:
```bash
python myGym/visualize_robot.py
```
### Visualize Robot IK
Visualize robot inverse kinematics:
```bash
python myGym/visualize_robot_ik.py
```
## Unit Tests
The repository includes unit tests in the `myGym/unittest/` directory:
### Test all training configs
Test train.py with all configuration files in the `./configs` folder:
```bash
# Test all configs with default settings (10000 steps)
python3 myGym/unittest/test_train_configs.py
# Test with custom step count
python3 myGym/unittest/test_train_configs.py --steps 5000
# Test a specific config
python3 myGym/unittest/test_train_configs.py --config train_A_nico.json
```
The test will display each config with a ✔ OK mark if training succeeds without errors, and provide a summary table of successfully trained configs at the end.
### Test robot URDFs
Test robot URDF joint limit reachability:
```bash
python3 myGym/unittest/test_robots.py
```
See `myGym/unittest/README.md` for more details on available tests.
## Training
Run the default training without specifying the parameters:
`python train.py`
The default traning is without GUI. You can turn GUI on, or parallelize traning (see train parameters)
## Environment
As myGym allows curriculum learning, the workspaces and tasks are concentrated in single gym, so that you can easily transfer the robot. The basic environment is called Gym-v0. There are more gyms for navigation and multi-agent collaboration in preparation.
## Robots
| Robot |Type| Gripper | DOF | Parameter value |
|---|---|---|---|---|
| UR-3 | arm | no gripper | 6 | ur3 |
| UR-5 | arm | no gripper | 6 | ur5 |
| UR-10 | arm | no gripper | 6 | ur10 |
| Kuka IIWA | arm | magnetic, gripper | 6 | kuka |
| Reachy | arm | passive palm | 7 | reachy |
| Leachy | arm | passive palm | 7 | leachy |
| Franka-Emica | arm | gripper | 7 | panda |
| Jaco arm | arm | two finger | 13 | jaco |
| Gummiarm | arm | passive palm | 13 | gummi |
| Human Support Robot (HSR) | arm | gripper | 7 | hsr |
| ABB Yumi | dualarm | two finger | 12 | yumi |
| ReachyLeachy | dualarm | passive palms | 14 | reachy_and_leachy |
| Pepper | humanoid | -- | 20 | pepper |
| Tiago | humanoid | -- | 19 | tiago |
| Nico | humanoid | -- | 14 | nico |
## Workspaces
| Name |Type| Suitable tasks | Parameter value |
|---|---|---|---|
| Tabledesk | manipulation | Reach,Press, Switch, Turn, PicknPlace | table |
| Drawer | manipulation | Pick, Place, PicknPlace | drawer |
| Fridge | manipulation | Push, Pick | fridge |
| Baskets | manipulation | Throw, Hit | baskets |
| Darts | manipulation | Throw, Hit | darts |
| Football | manipulation | Throw, Hit | football |
| Collaborative table | collaboration | Give, Hold, Move together | collabtable |
| Vertical maze | planning | -- | veticalmaze |
| Maze | navigation | -- | maze |
| Stairs | navigation | -- | stairs |
## Authors

[Incognite lab - CIIRC CTU](https://incognite-lab.github.io)
Core team:
[Michal Vavrecka](https://kognice.wixsite.com/vavrecka)
[Gabriela Sejnova](https://www.linkedin.com/in/gabriela-sejnova/)
[Megi Mejdrechova](https://www.linkedin.com/in/megi-mejdrechova)
[Nikita Sokovnin](https://www.linkedin.com/in/nikita-sokovnin-250939198/)
[Frederik Albl](https://incognite-lab.github.io)
[Sofia Ostapenko](https://incognite-lab.github.io)
[Radoslav Skoviera](https://incognite-lab.github.io)
Contributors:
Peter Basar, Michael Tesar, Vojtech Pospisil, Jiri Kulisek, Anastasia Ostapenko, Sara Thu Nguyen
## Citation
'@INPROCEEDINGS{9643210,
author={Vavrecka, Michal and Sokovnin, Nikita and Mejdrechova, Megi and Sejnova, Gabriela},
booktitle={2021 IEEE 33rd International Conference on Tools with Artificial Intelligence (ICTAI)},
title={MyGym: Modular Toolkit for Visuomotor Robotic Tasks},
year={2021},
volume={},
number={},
pages={279-283},
doi={10.1109/ICTAI52525.2021.00046}}'
## Paper
[myGym: Modular Toolkit for Visuomotor Robotic Tasks](https://arxiv.org/abs/2012.11643)