A simulator to be used for the Student Robotics Virtual Competition 2020
Take a look at the docs.
Within the IDE, there are a few different panels:
- In the centre of your screen is the 3D simulated view of the arena
- On the left is a tree hierarchy of all elements in this "world"
- At the bottom is your console
- At the top are your general controls which include the time controls. Press the centre play button to run the simulation at normal speed.
Important: Changes to the world must happen with the simulation paused at 0:00. If e.g. you move an object at a different time, rewinding back to the start will delete your changes.
On first run, the robot will execute an example program. On first run, this will be copied to the directory competition-simulator
is stored in to make updating easier:
.
├── competition-simulator
│ ├── controllers
│ │ ├── example_controller
│ │ └── sr_controller
│ ├── ...
│ └── worlds
└── robot.py
In addition to the basic setup for running the simulator, if you are intending to work on our wrapper API, our controllers or other helper scripts then you should also install the linting requirements:
pip install -r script/linting/requirements.txt
pip install -r script/typing/requirements.txt
You can then run all linting/type checking/tests in one go using script/check
.
- Create a new tag & push
- Wait for CI to build a zip archive
- Upload the archive to the GitHub release for the tag
- Update the docs to point to the new archive
- Announce the update to teams via the forums and email
In order to run competition matches you'll need to:
-
Install the third party libraries the teams are depending on, into the same Python environment as will be running their code:
pip install -r libraries.txt
Note: you can change the version of Python which Webots uses from the UI -- go to "Tools" > "Preferences" > "General" > "Python command".
We are using Python 3.7, though it shouldn't matter whether it's a system install or a virtual environment.
-
Create a file
robot_mode.txt
in the parent directory of the git repo, which contains just the textcomp
:echo comp > robot_mode.txt
-
Launch webots go to "Tools" > "Preferences" > "OpenGL" and set Ambient Occlusion to Disabled, Texture Quality to High, Disable shadows to false and Disable anti-aliasing to false
-
To put the competitors' code into the right places for each of the corner zones, run
competition-simulator/script/prepare-comp-match <directory containing team code> <match number> <Zone 0 TLA> <Zone 1 TLA> <Zone 2 TLA> <Zone 3 TLA>
Using a dash instead of a TLA if a robot is not present. This provides filenames and sets up the directory structure:
. ├── competition-simulator │ ├── controllers │ ├── ... │ └── worlds ├── robot_mode.txt ├── zone-0 | ├── log-zone-0-match-<match number>.txt │ └── robot.py └── zone-2 ├── log-zone-2-match-<match number>.txt └── robot.py
-
Run webots from the command line using:
webots --batch worlds/Arena.wbt
This runs a single match, including capturing the video and animation, and then pauses the simulation at the end.
-
After the match completes the robots will stop moving. Wait for the video to complete its rendering (check in the output console) and then quit Webots.
-
Copy logs into
competition-simulator/recordings/yyy-mm-dd/match-<match number>/logs