README.md 2.73 KB
Newer Older
Alexandre Arnold's avatar
Alexandre Arnold committed
1
2
3
4
5
6
# Cocopil Simu

ANITI Cocopil simulation files

## Getting started

7
Install the latest version of [Webots](https://cyberbotics.com) (tested with 2022a), a cross-platform open source robotic simulator.
Alexandre Arnold's avatar
Alexandre Arnold committed
8

9
Make sure to have a [properly configured](https://cyberbotics.com/doc/guide/using-python) Python environment, in which the dependencies listed in `requirements.txt` are installed:
Alexandre Arnold's avatar
Alexandre Arnold committed
10

11
12
```bash
pip install -r requirements.txt
Alexandre Arnold's avatar
Alexandre Arnold committed
13
14
```

15
Open one of the world files (simulation environments with associated controllers) listed below.
Alexandre Arnold's avatar
Alexandre Arnold committed
16

17
## World files
Alexandre Arnold's avatar
Alexandre Arnold committed
18

19
### factory
Alexandre Arnold's avatar
Alexandre Arnold committed
20

21
Location: `webots/worlds/factory.wbt`
Alexandre Arnold's avatar
Alexandre Arnold committed
22

23
A simple factory scene which, once the simulation is run:
Alexandre Arnold's avatar
Alexandre Arnold committed
24

25
26
27
- gets populated with various randomized objects (according to `webots/controllers/factory/spec.yml`)
- exports the actual "ground truth" to `webots/controllers/factory/scene.yml` once the scene is stabilized (after a warm-up time of 5 sec)
- prints some examples of generated natural language labels describing the scene
28
29
30
31
32
33
34
35
36
37
38
39

### factory_tiago

Location: `webots/worlds/factory_tiago.wbt`

A slightly more complex factory scene (with a TIAGo Steel robot) which, once the simulation is run:

- gets populated with 2 tables of random color with a hammer and a wrench on top of each (according to `webots/controllers/factory_tiago/spec.yml`)
- exports the actual "ground truth" to `webots/controllers/factory_tiago/scene.yml` once the scene is stabilized (after a warm-up time of 1 sec)
- exposes the simulation as an [OpenAI Gym environment](https://www.gymlibrary.ml) (a standard API for reinforcement learning)
- generates natural language goals for the robot at every new episode (e.g. "Go to the hammer on the green table")
- uses fluent(s) from `webots/controllers/factory_tiago/fluents.py` to give contextual rewards (e.g. based on distance to goal)
40
41
42
43
44
45
46
47
48

### test_fluents

Location: `webots/worlds/test_fluents.wbt`

A demo scene based on factory_tiago (without randomized generation) and two additional chairs which, once the simulation is run:

- uses fluent(s) from `webots/controllers/test_fluents/fluents.py` to demonstrate their use
- prints in console the value of these fluents at each simulation step
49
50
51
52
53
54

## Additional files

### TiagoBase fix

To avoid the problem of the Tiago wheels not moving correctly in simulation when Self-Collision is set to True, please replace the Webots file in `projects/robots/pal_robotics/tiago_base/protos/TiagoBase.proto` by the one from this repo: `misc/TiagoBase.proto` (it just reduces a bit the height of the collision cylinder of the base to not touch the wheels & moves the bumper sensor up a bit for the same reason). This seems to be enough to simulate the various Tiago models (incl. Tiago Steel) without any strange artifacts while still preventing the robotic arm from crossing the robot's body.