https://github.com/robocup-junior/rcj-soccersim
The RoboCupJunior Soccer Simulator, based on Webots
https://github.com/robocup-junior/rcj-soccersim
rcj-soccer-simulation robot robot-simulation robot-simulator simulator soccer soccer-sim soccer-simulation
Last synced: 16 days ago
JSON representation
The RoboCupJunior Soccer Simulator, based on Webots
- Host: GitHub
- URL: https://github.com/robocup-junior/rcj-soccersim
- Owner: robocup-junior
- License: apache-2.0
- Created: 2020-08-22T17:21:24.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-04T21:01:43.000Z (almost 2 years ago)
- Last Synced: 2024-09-06T05:56:22.387Z (almost 2 years ago)
- Topics: rcj-soccer-simulation, robot, robot-simulation, robot-simulator, simulator, soccer, soccer-sim, soccer-simulation
- Language: Python
- Homepage: https://robocup-junior.github.io/rcj-soccersim/
- Size: 1.95 MB
- Stars: 23
- Watchers: 11
- Forks: 21
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# RCJ Soccer Simulator
This is the official repository of the RoboCupJunior Soccer Simulator. The
simulator is based on [Webots](https://github.com/cyberbotics/webots) and this
repository provides both the "automatic referee" (which implements the [Soccer
Simulated Rules](https://github.com/robocup-junior/soccer-rules-simulation))
as well as a sample simulated team of robots with some basic strategy.

*Learn more in the [documentation](https://robocup-junior.github.io/rcj-soccersim/).*
# How do I try this out?
## Installation
1. Install Python 3.7 (or higher) 64 bit from the [official website](https://www.python.org/downloads/) (please make sure it is version 3.7 or higher for Windows, and 3.8 or higher if installing on MacOS or Linux). On Windows, please make sure your Python is referenced in Windows PATH by selecting the option "Add Python 3.x to PATH" during the installation. Check out this great [installation guide](https://realpython.com/installing-python/) if you need some help!
2. Download [Webots](https://www.cyberbotics.com/#download) from their official website. Currently, version R2025b is stable with the Soccer Simulator. You can find detailed installation procedure on the official [Webots Installation guide](https://cyberbotics.com/doc/guide/installation-procedure).
3. Clone the rcj-soccersim repository to your computer by downloading the ZIP file from [here](https://github.com/robocup-junior/rcj-soccersim/archive/master.zip) or running
git clone https://github.com/robocup-junior/rcj-soccersim.git
4. Finally, run Webots, go to `Tools > Preferences > Python command` and set it to `python` or `python3` to point Webots to Python 3. Depending on your system, the reference to Python 3 can be via the command `python` or `python3`. More information on how to configure Webots to work with Python can be found [here](https://cyberbotics.com/doc/guide/using-python).
## Running Soccer Sim
1. Use Webots to open the downloaded `soccer.wbt` world located in the `worlds`
directory (via `File > Open World`)
2. Run/pause the simulation by clicking the corresponding buttons on the top-part of Webots window. Note that the controllers that are responsible for the
various robots on the field can be found in the `controllers/` directory.
## Notes
A specific `webots` world can be executed directly from the command line as
follows:
webots --mode=run worlds/soccer.wbt
Which allows for at least some automation. Further info can be found in the
[docs](https://cyberbotics.com/doc/guide/starting-webots).
The sample players as well as the "automatic referee" are implemented in
Python, which should allow for easily updating the code to match the rules and
avoid any compilation issues.
## Development
We are open to contributions! Have a look at our [issues](https://github.com/robocup-junior/rcj-soccersim/issues).
Before you make a pull request, make sure the code is formatted
with `black` and `isort`, and `flake8` issues are fixed.
To do so, follow these steps:
1. Create virtualenv `python3 -m venv venv`
2. Install `pip-tools` by running `pip install pip-tools`
3. Install development modules `pip-sync requirements/development.txt`
4. Setup pre-commit hook `pre-commit install`. This hook will not allow you to
commit in case one of the checkers raises an error.
5. In order format the code, run the formatters in this order
* `isort .`
* `black .`
6. Manually fix error raised by `flake8 .`
### Updating dependencies
Dependencies for development are managed by pip-tools. To compile current
dependencies run
```bash
$ pip-compile -o requirements/development.txt requirements/development.in
```
In order to update dependencies, use `--upgrade` switch.