Skip to content

Commit 404b586

Browse files
authored
Merge pull request #553 from srobo/jdp-sim-overhaul
2 parents 0e6bf31 + 1b1c6a7 commit 404b586

File tree

2 files changed

+40
-26
lines changed

2 files changed

+40
-26
lines changed

simulator/index.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ title: Simulator
55

66
# Simulator
77

8-
The simulator is a useful tool for becoming more familiar with our API or planning out game strategies.
8+
The simulator is a useful development tool, it allows you to become familiar with our API and to get started coding straight away even if you have yet to construct your robot.
9+
It could also be used to test out game strategies before applying them in real life.
910

1011
## Programming
1112

1213
Programming for the simulator is very similar to [programming for your physical robot]({{ site.baseurl }}/programming/).
1314

14-
The simulator provides a subset of the `sr.robot3` [Robot API]({{ site.baseurl }}/programming/robot_api/) which is used on the physical robots. As a result code which is written for the simulator should largely work on your robot and vice-versa.
15+
The simulator provides a subset of the `sr.robot3` [Robot API]({{ site.baseurl }}/programming/robot_api/) which is used on the physical robots.
16+
As a result code which is written for the simulator should largely work on your robot and vice-versa.
1517

1618
## Getting started
1719

simulator/setting_up_simulator.md

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,39 @@ Setting up the Simulator
88

99
## Prerequisites
1010

11-
You need to download and install [Webots](https://cyberbotics.com/#download) (the download is around 300MB).
12-
This is the platform we run our simulation in.
1311

14-
Version "R2023b" of Webots is supported.
12+
### Webots
1513

16-
### Python Version
14+
Our simulator runs in a program called Webots.
15+
In order to run the simulation you first need to install Webots.
16+
You need to download [Webots from here](https://cyberbotics.com/#download) and install it.
17+
18+
The current supported version is "R2023b".
19+
20+
21+
### Python
1722

1823
You will also need Python installed.
24+
If it is not already installed this can be downloaded and installed from the [Python website](https://www.python.org/).
1925

2026
| Platform | Supported Python Version |
2127
|----------|--------------------------|
2228
| Windows | 3.8-3.11 (64-bit) |
2329
| macOS | 3.8-3.11 |
2430
| Linux | 3.8-3.11 |
2531

26-
There are a small number of [external libraries]({{ site.baseurl }}/kit/brain_board/python_libraries) which will be available to your robot code during the competition.
27-
Note that for local development you will need to install these yourself.
2832

29-
Once you have downloaded the simulation, the libraries can be installed with `pip install -r competition-simulator.../libraries.txt`.
33+
### Python libraries
34+
35+
There are a small number of [external libraries]({{ site.baseurl }}/kit/brain_board/python_libraries) which are available on the physical kit that may be useful in the simulator.
36+
If you want to use these in your code you will need to install these yourself.
37+
38+
Once you have downloaded the simulation, the libraries can be installed with the following command in a terminal.
39+
40+
~~~~~bash
41+
pip install -r competition-simulator-<version>/libraries.txt
42+
~~~~~
43+
3044

3145
## Installing the simulation
3246

@@ -36,7 +50,7 @@ The simulation for the SR2024 competition will be released at Kickstart.
3650
3751
1. Create a directory, perhaps called `simulation` where you will store your robot code.
3852
2. [Download the simulation](https://github.com/srobo/competition-simulator/releases/download/TODO/competition-simulator-TODO.zip), the latest version is TODO, released on TODO.
39-
3. Unzip the simulation as a subdirectory of the directory you created in the first step:
53+
3. Unzip the simulation as a folder inside the folder you created in the first step:
4054
```
4155
simulation
4256
├── competition-simulator-<version>
@@ -48,50 +62,48 @@ The simulation for the SR2024 competition will be released at Kickstart.
4862
```
4963
If there is not an existing `robot.py` an example one will be created when the simulator first runs.
5064
51-
4. Using the Webots IDE, open the `worlds/Arena.wbt` file.
65+
4. Open the Webots IDE, then use that to open the `worlds/Arena.wbt` file.
5266
5367
You may receive a warning about your computer's GPU not being good enough, which can be ignored.
5468
5569
-->
5670

5771
<div class="info">
58-
On recent versions of macOS you may need to give Webots permission to access the directory where you have extracted the simulation files.
72+
On recent versions of macOS you may need to give Webots permission to access the directory where you have extracted the simulation files.
5973
</div>
6074

75+
6176
### Changing your version of Python
6277

63-
If webots is not picking any version of Python or is picking up the wrong one then you'll need to change it.
78+
Sometimes Webots will not automatically detect your installed Python so we need to change it.
6479
When this happens Webots will print errors to its console and your robot will not move.
6580

6681
You will need the full path to the version of Python that you want to use.
6782
This will vary based on the system you have.
68-
One way to find the path is by launching the version of Python that you want to
69-
use and running the following code:
83+
One way to find the path is by launching Python and running the following code:
7084

7185
~~~~~ python
7286
import sys
7387
print(sys.executable)
7488
~~~~~
7589

76-
On Windows you can set the path to the Python version to use in Webots UI via
77-
**Tools** &rarr; **Preferences** &rarr; **General** &rarr; **Python command**.
90+
Once you have the path you need to enter this into the Webots settings.
91+
92+
To do this on Windows, open webots and go to the menu **Tools** &rarr; **Preferences** &rarr; **General** &rarr; **Python command** and enter the path in that box.
7893
Your Python path is likely similar to `C:\Users\<USERNAME>\AppData\Local\Programs\Python\Python311\python.exe` when using Python 3.11, where `<USERNAME>` is your login.
7994

8095
On Mac you can set the path to the Python version to use via **Webots** &rarr; **Preferences** <kbd>⌘</kbd><kbd>,</kbd>.
8196
Your Python path is likely similar to `/Library/Frameworks/Python.framework/Versions/3.11/bin/python3` when using Python 3.11.
8297

83-
You'll need to ensure a matching version of Python is installed. If you're still
84-
having problems, ask for help in [`#simulator-help`][simulator-help] in
85-
[Discord][discord].
98+
If you're still having problems, ask for help in [Discord][discord].
99+
86100

87101
## Updates
88102

89-
Occasionally, we may release an update to the simulation. To update, you will need to delete the `competition-simulator-<version>` directory, and re-download it using the above link.
103+
Occasionally, we may release an update to the simulation.
104+
To update, you will need to delete the `competition-simulator-<version>` folder and replace it with the new version that can be downloaded using the above link.
90105

91-
If you need a specific version of the simulator, or want to see what changes
92-
have been made with each version, please see the
93-
[list of releases](https://github.com/srobo/competition-simulator/releases).
106+
If you need a specific version of the simulator, or want to see what changes have been made with each version, please see the [list of releases][release-list].
94107

95108
[discord]: {{ site.baseurl }}/tutorials/discord
96-
[programming-help]: https://discord.com/channels/900501415548579842/900501416269971457
97-
[simulator-help]: https://discord.com/channels/900501415548579842/900501416269971458
109+
[release-list]: https://github.com/srobo/competition-simulator/releases

0 commit comments

Comments
 (0)