Skip to content

Cyrus2D/playmaker-python-rl

 
 

Repository files navigation

About

RoboCup is an international competition aimed at advancing autonomous robotics and AI through tasks like soccer and rescue. The RoboCup Soccer Simulation 2D league focuses on developing intelligent agents that play soccer in a simulated 2D environment. This league is ideal for testing and developing AI and ML algorithms, including reinforcement learning and multi-agent systems. more details

image

image

To run a game in the RoboCup Soccer Simulation 2D, you need to operate the rcssserver for hosting games, rcssmonitor to display them, and engage 12 agents (11 players and a coach) per team. Each cycle, agents receive data from the server and must execute actions such as dash and kick. Developing a team can be complex due to the environment's intricacy, typically necessitating C++ programming. However, our framework allows for Python development, leveraging the helios-base features. It introduces the playmaker-server, a Python-implemented server that interacts with the rcssserver via a proxy, managing environment states and agent actions based on the WorldModel from helios-base. Our defined protobuf schema ensures all environmental data is comprehensively covered, facilitating smooth communication between the playmaker server and the rcssserver.

To find more information about the framework, you can visit the CLSFramework Wiki Pages

RUN

To run a game by using the playmaker-server, you need to run rcssserver, rcssmonitor, soccer-simulation-proxy team, and the playmaker-server. To run each of them there some different solutions, you can find more information about them in the following list:

In this page, we will show the simplest way to start a game.

Clone the repository

git clone [email protected]:CLSFramework/playmaker-server-python.git
cd playmaker-server-python

Install ubuntu and python dependencies

sudo apt-get install fuse
python3 -m pip install -r requirements.txt

Download rcssserver and soccer-simulation-proxy AppImages

chmod 777 download-server-proxy.sh
./download-server-proxy.sh

These commands will download the rcssserver and soccer-simulation-proxy AppImages. The rcssserver app-image is available in rcssserver directory and the soccer-simulation-proxy app-image is available in soccer-simulation-proxy directory. You can download the AppImages manually from the following links:

You can also build them from source code. You can find more information about building the rcssserver and the soccer-simulation-proxy in the following links:

Run the rcssserver

The server should be run before the soccer-simulation-proxy agents.

cd rcssserver
./rcssserver-x86_64.AppImage

Run Playmaker-Server (Python)

It would be better to run the Playmaker-Server in a separate terminal and before running the soccer-simulation-proxy agents.

python3 server.py

Run the soccer-simulation-proxy

cd soccer-simulation-proxy
./start.sh

Some Notes:

Note that if you want to use the debug tools of the soccerwindow2, you have to run the ./start-debug.sh instead of the ./start.sh.

Run all components in one command

./start-team.sh

Note: In the competition, the competition manager will use the start-team.sh to run the server and the agents. Also each player has to connecte to a different playermaker-server.

How It Works?

The soccer-simulation-proxy is a base that acts as an intermediate connection between the RCSSServer and the playmaker-server. The soccer-simulation-proxy receives the observation and the information of the field from the RCSSServer and send them to the playmaker-server. The playmaker-server receives the observation and the information of the field as a WorldModel class in the protobuf from the Proxy base and sends the action to the Proxy base. The Proxy base receives the action from the playmaker-server and sends it to the RCSSServer, and this happens in each cycle of the game.

Related Projects:

Also you can find some useful examples in the following repositories:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.3%
  • Other 0.7%