You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should you wish to run the simulator locally, this is fine, however it will drastically limit your ability to collaborate with the rest of your team.
8
+
{{% /notice %}}
9
+
10
+
## Running simulations
11
+
12
+
To ease the load on your computers, the Webots simulator will be run by us, which you can interact with through our runner interface. The runner allows you to run simulations, and view the logs and recordings afterwards.
13
+
14
+
To run a simulation, click the "Run Simulation" button. The button will prevent you from running additional simulations whilst a simulation is running. Once the simulation has finished, the button will return to "Run Simulation", and an entry will be shown below it with a link to the logs and animation for your simulation run. Note that this always uses the files in the `zone-0` / `zone-1` directory.
15
+
16
+
## Directory structure
17
+
18
+
In VSCode, you will see a directory structure which looks similar to this:
Copy file name to clipboardExpand all lines: content/simulator/local.md
+5-24Lines changed: 5 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,8 @@
1
1
---
2
-
title: Simulator
3
-
weight: 5
2
+
title: Local installation
4
3
---
5
4
6
-
To test out your robot code, you can use our Simulator. This gives you a realistic environment to run your code, against a dummy robot, without the need for a physical arena. This simulator is currently only available on Windows.
5
+
Should you wish to run the simulator locally, this is fine, however it will drastically limit your ability to collaborate with the rest of your team.
7
6
8
7
## Installation
9
8
@@ -17,7 +16,9 @@ You will also need Python 3.9 installed.
17
16
18
17
There are a small number of [external libraries](/api#included-libraries) which will be available to your robot code during the competition. For local development you will need to install these yourself.
19
18
20
-
{{% notice warning %}} If you are installing python on Windows, you will need to add python to PATH otherwise Webots will not be able to find the python installation {{% /notice %}}
19
+
{{% notice warning %}}
20
+
If you are installing python on Windows, you will need to add python to `PATH` otherwise Webots will not be able to find the python installation
21
+
{{% /notice %}}
21
22
22
23
### Installing the simulation
23
24
@@ -30,7 +31,6 @@ You may receive a warning about your computer’s GPU not being good enough, whi
30
31
31
32
If Webots is picking up the incorrect version of Python, you’ll need to change it. This can be done using Tools > Preferences > General > Python command. You’ll need to ensure a matching version of Python is installed.
32
33
33
-
34
34
## Overview
35
35
36
36
Within the Webots IDE, there are a few different panels:
@@ -40,25 +40,6 @@ Within the Webots IDE, there are a few different panels:
40
40
- At the bottom is the console, where output from your robot code will be displayed
41
41
- At the top are your general controls which include the time controls. Press the centre play button to run the simulation at normal speed.
42
42
43
-
## Other robots
44
-
45
-
There is another robot in the arena, in its starting zone. By default, this robot will not move.
46
-
47
-
To control the other robot, you will need to provide its code:
48
-
49
-
Create the robot code in `zone-1/robot.py`. Your code at `robot.py` will be used for zone 0, though you are encouraged to move your code to `zone-0/robot.py` when running multiple robots. Robots which do not have any robot code in their `zone-x` directory will not do anything.
50
-
51
-
```plain
52
-
.
53
-
├── competition-simulator
54
-
│ ├── controllers
55
-
│ │ ├── example_controller
56
-
│ │ └── sr_controller
57
-
│ ├── ...
58
-
│ └── worlds
59
-
└── robot.py
60
-
```
61
-
62
43
## Time
63
44
64
45
In the simulated environment, time advances only at the pace that the simulator is run. The relation between this time and the real passage of time depends on a couple of factors: the speed the simulation is configured to run at and the ability of the computer running the simulation to process it fast enough.
On first run, the robot will execute an example program for convenience. On first run, this will be copied into `zone-0` in the same directory that `competition-simulator-<version>` is stored in:
7
+
8
+
```plain
9
+
.
10
+
├── competition-simulator-<version>
11
+
│ ├── ...
12
+
│ └── worlds
13
+
│ └── Arena.wbt
14
+
├── zone-0
15
+
│ ├── crane.py
16
+
│ └── forklift.py
17
+
└── zone-1
18
+
```
19
+
20
+
Your code for the forklift robot should go in `forklift.py` and the crane in `crane.py`.
21
+
22
+
{{% notice warning %}}
23
+
Only your controller code will be present in the competition environment.
24
+
{{% /notice %}}
25
+
26
+
### Time
27
+
28
+
In the simulated environment, time advances only at the pace that the simulator
29
+
is run. As a result, using `time.time` to know how long your robot has been
30
+
running for or `time.sleep` to wait for some duration will be unreliable.
31
+
32
+
As a result the API present in the simulator supports a slightly different
33
+
approach to handling time. See the documentation about [simulated time](./time)
34
+
for more details.
35
+
36
+
## Other robots
37
+
38
+
There is another robot in the arena; its starting zone is zone 1. By default, this robot will not move.
39
+
40
+
To control the zone 1 robot, you will need to provide its code:
41
+
42
+
Create the robot code in `zone-1/forklift.py` and `zone-1/crane.py`. Your original code in `zone-0/` will still be used to control zone 0 robots. Robots which do not have any robot code in their `zone-x` directory will not do anything.
0 commit comments