|
| 1 | +# Quick start |
| 2 | +## Installation |
| 3 | +Install the pre-requisites and the RoboCup Soccer 2D Platform using the commands below: |
| 4 | +``` Bash |
| 5 | +sudo apt-get install fuse #Used to run AppImages |
| 6 | +pushd scripts |
| 7 | +sh download-rcssserver.sh #install RoboCup Server |
| 8 | +popd |
| 9 | +``` |
| 10 | +Next, install the soccer proxy, which uses C++ to read and pre-processes state data and passes them to the Python server (this project) for decision-making. |
| 11 | +``` Bash |
| 12 | +pushd scripts |
| 13 | +sh download-proxy.sh.sh #install C++ proxy |
| 14 | +popd |
| 15 | +``` |
| 16 | +Clone this repository & install the required python libraries (such as gRPC). Don't forget to activate your virtual environment! |
| 17 | +``` Bash |
| 18 | +git clone https://github.com/CLSFramework/sample-playmaker-server-python-grpc.git |
| 19 | +cd sample-playmaker-server-python-grpc |
| 20 | +# Activate venv/anaconda before this step! |
| 21 | +pip install -r requirements.txt |
| 22 | +``` |
| 23 | +Finally, download the monitor from [the original repository](https://github.com/rcsoccersim/rcssmonitor/releases) in order to view the games. |
| 24 | +## Running a game |
| 25 | +This section assumes you have installed the server & proxy using the scripts (as mentioned above) |
| 26 | +We must first run a RoboCup Server, in order to host the game: |
| 27 | +``` Bash |
| 28 | +cd scripts/rcssserver |
| 29 | +./rcssserver |
| 30 | +``` |
| 31 | +Then we must run the proxy & the decisionmaking server: |
| 32 | +``` Bash |
| 33 | +./start-team.sh |
| 34 | +``` |
| 35 | +Launch the opponent team, start the monitor app image. press <kbd>Ctrl</kbd> + <kbd>C</kbd> to connect to the server, and <kbd>Ctrl</kbd> + <kbd>K</kbd> for kick-off! |
| 36 | + |
| 37 | +# How to change the code |
| 38 | +The `server.py` file contains the logic in 3 main functions: |
| 39 | +`GetPlayerActions` receives a game state, and returns a list of actions for a player for for that cycle. |
| 40 | +The actions we can output are equivalent to the Helios Base, which are abstracted into multiple levels. |
| 41 | +You can use actions such as `DoDash`, `DoTurn`, `DoKick` which directly apply force, or use actions such as `GoToPoint`, `SmartKick`, `Shoot` or more. |
| 42 | + |
| 43 | +Similarly, you can change `GetCoachActions` which is responsible for coach communication & substitutions. |
| 44 | + |
| 45 | +You can also use `GetTrainerActions` to move the players & the ball to make repeatable scenarios (when the server is in trainer mode). |
| 46 | +# Why & How it works |
| 47 | +Originally the RoboCup 2D Soccer Simulation teams used C++, as the main code base (Agent2D aka Helios Base) was written in this language due to its performance. |
| 48 | +Due to the popularity of python in Machine Learning & AI spaces we decided to create a python platform which would be equivalent to Agent 2D. |
| 49 | +However, using python alone was too slow as preprocessing sensor information & tasks such as localization took too long. |
| 50 | + |
| 51 | +For this reason we have split up the code into two segments: |
| 52 | +The data processing section in proxy, which creates a World Model (state), and passes it to python for planning to occur. |
0 commit comments