From 899fed2cde5474a873e2f526bad3875d9412bbe5 Mon Sep 17 00:00:00 2001 From: "mr.Shu" Date: Wed, 5 May 2021 19:30:30 +0200 Subject: [PATCH 1/2] add: `numpy` and `scipy` * Install `numpy` and `scipy` in `run-in-docker.sh` and by doing so, ensure that it can be used in robot's code. * Add a note on `numpy` and `scipy` to the docs. Signed-off-by: mr.Shu --- docs/docs/how_to_robot.md | 15 ++++++++++++++- run-in-docker.sh | 3 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/docs/how_to_robot.md b/docs/docs/how_to_robot.md index 286c32f..5970d26 100644 --- a/docs/docs/how_to_robot.md +++ b/docs/docs/how_to_robot.md @@ -213,7 +213,7 @@ We are not going to explain this deeply. This function is to parse the incoming data from supervisor. Feel free to copy and use it. The resulting dictionary contains positions of all of the robots as well as the position of the ball. Moreover, it contains information whether the goal gets scored and we are waiting for new kickoff. -In case the goal gets scored, the value is `True` and is reset to `False` when the +In case the goal gets scored, the value is `True` and is reset to `False` when the referee fires new kickoff. ```python @@ -280,3 +280,16 @@ import utils and use the shared code rather than copying it into each of the controllers. Do not import anything from `team_name.py` file, otherwise you might get cyclic import problem. + +## Supported external libraries + +In general, the whole Python's +[standard library](https://docs.python.org/3/library/index.html) can be used in the +robot's programs. + +Furthermore, to make the computations easier, the Soccer Sim environment +supports the following two Python libraries that are normally used for what's +called "scientific computing": + +- [`numpy`](https://numpy.org/doc/stable/) *(version 1.20.2)* +- [`scipy`](https://docs.scipy.org/doc/scipy/reference/) *(version 1.6.3)* diff --git a/run-in-docker.sh b/run-in-docker.sh index 377ab81..3080cda 100644 --- a/run-in-docker.sh +++ b/run-in-docker.sh @@ -1,2 +1,5 @@ #!/bin/bash +apt update +apt install -y python3-pip +pip3 install numpy==1.20.2 scipy==1.6.3 --user xvfb-run /usr/local/webots/webots --stdout --stderr --batch --mode=fast $1 From ffd560dddfb4bc5819aad35be9f58a30e9d55338 Mon Sep 17 00:00:00 2001 From: "mr.Shu" Date: Wed, 5 May 2021 19:32:48 +0200 Subject: [PATCH 2/2] fix: code_submission.md * Ditch the mention of three folders which is no longer relevant. Signed-off-by: mr.Shu --- docs/docs/code_submission.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/docs/code_submission.md b/docs/docs/code_submission.md index b95f5b7..4c3b4ac 100644 --- a/docs/docs/code_submission.md +++ b/docs/docs/code_submission.md @@ -97,8 +97,8 @@ as follows: ``` Note that there is no `controllers/` folder anymore -- the `.ZIP` file only -contains three folders and a single text file called `team_name.txt` (and -optionally `logo.png`). +contains a single `robot/` folder and a single text file called `team_name.txt` +(and optionally the `logo.png` image). ## Uploading your submission