Skip to content

Commit dc8fd7d

Browse files
committed
update doc and add mermaid
1 parent 789ec5a commit dc8fd7d

File tree

7 files changed

+1860
-816
lines changed

7 files changed

+1860
-816
lines changed

docs/RcssMonitor/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# RCSSMonitor
2+
3+
TODO

docs/RcssServer/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# RCSSSERVER
2+
3+
TODO

docs/soccerproxy/index.md

Lines changed: 35 additions & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -4,190 +4,53 @@ sidebar_position: 4
44

55
# Soccer Simulation Proxy
66

7-
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](https://github.com/CLSFramework/cross-language-soccer-framework/wiki/Definitions)
7+
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.
88

9-
![image](https://github.com/Cross-Language-Soccer-Framework/cross-language-soccer-framework/assets/25696836/7b0b1d49-7001-479c-889f-46a96a8802c4)
9+
Soccer Simulation Proxy is a rpc client (gRPC or Thrift) that bridges the gap between the RoboCup Soccer Simulation 2D server and the PlayMaker Server. It receives information from the server, sends it to the PlayMaker Server, and sends the actions back to the server. This way, you can develop a team in any language supported by gRPC or Thrift, focusing on your team's strategy and AI algorithms without worrying about the server's complexity.
1010

11+
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 other languages development, leveraging the helios-base features. By using Soccer Simulation Proxy, you can develop a team in any language supported by `gRPC` or `Thrift`, such as C#, C++, Dart, Go, Java, Kotlin, Node, Objective-C, PHP, Python, and Ruby. You just need to develop a gRPC server based on proto messages or a thrift server based on the thrift file to receive data (state) from the Soccer Simulation Proxy and send actions back to it. This way, you can focus on developing your team's strategy and AI algorithms without worrying about the server's complexity.
1112

12-
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 other languages development, leveraging the helios-base features. By using SoccerSimulationProxy, you can develop a team in any language supported by gRPC, such as C#, C++, Dart, Go, Java, Kotlin, Node, Objective-C, PHP, Python, and Ruby. You just need to develop a gRPC server based on proto messages and gRPC services ([protofile](https://github.com/CLSFramework/soccer-simulation-proxy/blob/master/grpc/protos/service.proto), check [wiki](https://github.com/CLSFramework/cross-language-soccer-framework/wiki/Protobuf) to be more familier with messages and services) to receive data from the SoccerSimulationProxy and send actions back to it. This way, you can focus on developing your team's strategy and AI algorithms without worrying about the server's complexity. If you would like to develop a team or research in this area by using Python, C# or JavaScript you can check the following links:
13-
- [Playmaker-Server-Python](https://github.com/CLSFramework/playmaker-server-python)
14-
- [Playmaker-Server-CSharp](https://github.com/CLSFramework/playmaker-server-csharp)
15-
- [Playmaker-Server-NodeJs](https://github.com/CLSFramework/playmaker-server-nodejs)
13+
If you would like to develop a team or research in this area by using Python, C# or JavaScript you can check the following links:
1614

17-
![image](https://github.com/Cross-Language-Soccer-Framework/cross-language-soccer-framework/assets/25696836/d152797b-53f0-490f-a8dd-b8c0ef667317)
18-
19-
![Screenshot 2024-04-07 012226](https://github.com/Cyrus2D/SoccerSimulationProxy/assets/25696836/abb24e0c-61b9-497d-926f-941d1c90e2ee)
20-
21-
This new base code is powered by Helios-Base code and gRPC to help researcher developing a soccer simulation 2D team or researching in this area by using any languages supported by gRPC:
22-
- [C#](https://grpc.io/docs/languages/csharp/)
23-
- [Playmaker-Server-CSharp](https://github.com/CLSFramework/playmaker-server-csharp)
24-
- [C++](https://grpc.io/docs/languages/cpp/)
25-
- [Dart](https://grpc.io/docs/languages/dart/)
26-
- [Go](https://grpc.io/docs/languages/go/)
27-
- [Java](https://grpc.io/docs/languages/java/)
28-
- [Kotlin](https://grpc.io/docs/languages/kotlin/)
29-
- [Node](https://grpc.io/docs/languages/node/)
30-
- [Playmaker-Server-NodeJs](https://github.com/CLSFramework/playmaker-server-nodejs)
31-
- [Objective-C](https://grpc.io/docs/languages/objective-c/)
32-
- [PHP](https://grpc.io/docs/languages/php/)
33-
- [Python](https://grpc.io/docs/languages/python/)
34-
- [Playmaker-Server-Python](https://github.com/CLSFramework/playmaker-server-python)
35-
- [Ruby](https://grpc.io/docs/languages/ruby/)
36-
37-
## How To Use it?
38-
39-
To use this framework, you need to run rcssserver to host a game, run SoccerSimulationProxy (Agents) to connect to the rcssserver to receive information and send actions, and run Playmaker-Server (gRPC-Server) to receive information from agents and send appropriate actions back. To watch the game, you can run rcssmonitor or SoccerWindow2.
40-
41-
To run the rcssserver and rcssmonitor, you can follow the instructions in the [rcssserver](https://github.com/CLSFramework/cross-language-soccer-framework/wiki/RoboCup-Soccer-Simulation-Server) and [rcssmonitor](https://github.com/CLSFramework/cross-language-soccer-framework/wiki/Soccer-Simulation-Monitor).
42-
43-
To run the SoccerSimulationProxy, there are some different ways such as using Docker, building from source, or using AppImage.
44-
45-
## Use AppImage (Linux, WSL)
46-
47-
### Download
48-
You can download the AppImage of the Soccer Simulation Proxy from the [release page](https://github.com/CLSFramework/soccer-simulation-proxy/releases).
49-
50-
Or download the latest version by using the following command:
51-
```bash
52-
wget $(curl -s "https://api.github.com/repos/clsframework/soccer-simulation-proxy/releases/latest" | grep -oP '"browser_download_url": "\K[^"]*' | grep "soccer-simulation-proxy.tar.gz")
53-
```
54-
55-
### Extract
56-
```bash
57-
tar -xvf soccer-simulation-proxy.tar.gz
58-
```
59-
60-
### Run
61-
```bash
62-
cd SoccerSimulationProxy
63-
./start.sh
64-
```
65-
66-
You can download the AppImage of the Soccer Simulation Proxy from the #### and run it.
67-
68-
## Build from source, install, and run (Linux, WSL)
69-
70-
To build the soccer simulation proxy, you need to install the following dependencies:
71-
72-
#### LibRCSC
15+
- [Soccer Simulation Proxy](https://github.com/CLSFramework/soccer-simulation-proxy)
16+
- [PlaymakerServer-CSharp](https://github.com/CLSFramework/playmaker-server-csharp)
17+
- [PlaymakerServer-Python](https://github.com/CLSFramework/playmaker-server-python)
18+
- [Sample-PlaymakerServer-Python-GRPC](https://github.com/CLSFramework/sample-playmaker-server-python-grpc)
19+
- [Sample-PlaymakerServer-Python-THRIFT](https://github.com/CLSFramework/sample-playmaker-server-python-thrift)
20+
- [Starter-PlaymakerServer-Python-THRIFT](https://github.com/CLSFramework/starter-playmaker-server-python-thrift)
21+
- [PlaymakerServer-NodeJs](https://github.com/CLSFramework/playmaker-server-nodejs)
7322

74-
```bash
75-
git clone [email protected]:helios-base/librcsc.git
76-
cd librcsc
77-
git checkout 19175f339dcb5c3f61b56a8c1bff5345109f22ef
78-
mkdir build
79-
cd build
80-
cmake ..
81-
make
82-
make install
83-
```
84-
85-
#### gRPC - follow the instructions provided in the [repository](https://grpc.io/docs/languages/cpp/quickstart/)
86-
87-
```bash
88-
export MY_INSTALL_DIR=$HOME/.local
89-
mkdir -p $MY_INSTALL_DIR
90-
export PATH="$MY_INSTALL_DIR/bin:$PATH"
91-
sudo apt install -y build-essential autoconf libtool pkg-config
92-
git clone --recurse-submodules -b v1.62.0 --depth 1 --shallow-submodules https://github.com/grpc/grpc
93-
cd grpc/
94-
mkdir -p cmake/build
95-
pushd cmake/build
96-
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$MY_INSTALL_DIR ../..
97-
make -j 4
98-
make install
99-
```
100-
101-
then, add the following lines at the end of $HOME/.bashrc
102-
103-
```bash
104-
export MY_INSTALL_DIR=$HOME/.local
105-
export PATH="$MY_INSTALL_DIR/bin:$PATH"
106-
```
107-
108-
then, run the following command
109-
110-
```bash
111-
source $HOME/.bashrc
112-
```
113-
114-
To test grpc, go to grpc directory (in this example it is in $HOME/grpc) and run the following commands:
115-
116-
```bash
117-
cd examples/cpp/helloworld
118-
mkdir -p cmake/build
119-
cd cmake/build/
120-
cmake -DCMAKE_PREFIX_PATH=$MY_INSTALL_DIR ../..
121-
make
122-
run ./greeter_server in one tab
123-
run ./greeter_client in another tab
124-
```
125-
126-
#### SoccerSimulationProxy
23+
![image](https://github.com/Cross-Language-Soccer-Framework/cross-language-soccer-framework/assets/25696836/d152797b-53f0-490f-a8dd-b8c0ef667317)
12724

128-
```bash
129-
git clone [email protected]:CLSFramework/soccer-simulation-proxy.git
130-
cd soccer-simulation-proxy
131-
mkdir build
132-
cd build
133-
cmake ..
134-
make
135-
```
13625

137-
Troubleshooting
26+
This new base code is powered by Helios-Base code and gRPC to help researcher developing a soccer simulation 2D team or researching in this area by using any languages supported by gRPC and Thrift.
13827

139-
If you saw an error about the different version of GRpc
140-
You should delete src/grpc/service.pb.cc and src/grpc/service.pb.h
141-
Then, generate them again by going to the base root directory and
28+
## Work Flow
14229

143-
```bash
144-
cd grpc/proto
145-
protoc --proto_path=. --cpp_out=../../src/grpc/ --grpc_out=../../src/grpc/ --plugin=protoc-gen-grpc=$HOME/.local/bin/grpc_cpp_plugin service.proto
30+
```mermaid
31+
sequenceDiagram
32+
participant PM as PlayMakerServer
33+
participant SP as SoccerSimulationProxy
34+
participant SS as SoccerSimulationServer
35+
Note over SS,PM: Run
36+
SP->>SS: Connect
37+
SS->>SP: OK, Unum
38+
SP->>PM: Register
39+
PM->>SP: OK, ClientID
40+
SS->>SP: See
41+
Note over SP: Convert observation to State
42+
SP->>PM: State
43+
PM->>SP: Actions
44+
Note over SP: Convert Actions to Low-Level Commands
45+
SP->>SS: Commands
14646
```
14747

148-
To run the Soccer Simulation Proxy, you can use the following command: (You should run the Soccer Simulation Server and a PlayMaker Server before running the Soccer Simulation Proxy)
48+
## How To Use it?
14949

150-
```bash
151-
cd build/bin
152-
./start.sh
153-
```
50+
To use this framework, you need to run rcssserver to host a game, run SoccerSimulationProxy (Agents) to connect to the rcssserver to receive information and send actions, and run Playmaker-Server (gRPC or Thrift-Server) to receive information from agents and send appropriate actions back. To watch the game, you can run rcssmonitor or SoccerWindow2.
15451

155-
To run the Soccer Simulation Proxy in debug mode, you can use the following command:
52+
To run the rcssserver and rcssmonitor, you can follow the instructions in the RcssServer page and RcssMonitor page.
15653

157-
```bash
158-
cd build/bin
159-
./start-debug.sh
160-
```
54+
To run the SoccerSimulationProxy, there are some different ways such as using Docker, building from source, or using AppImage.
16155

162-
To run the Soccer Simulation Proxy with different configuration, you can pass the following parameters to start.sh or start-debug.sh:
163-
164-
| Option | Description | Default Value |
165-
|-----------------------------|---------------------------------------------------------------------------------------------------|----------------------|
166-
| `-h, --host HOST` | Specifies server host | `localhost` |
167-
| `-p, --port PORT` | Specifies server port | `6000` |
168-
| `-P, --coach-port PORT` | Specifies server port for online coach | `6002` |
169-
| `-t, --teamname TEAMNAME` | Specifies team name | - |
170-
| `-n, --number NUMBER` | Specifies the number of players | - |
171-
| `-u, --unum UNUM` | Specifies the uniform number of players | - |
172-
| `-C, --without-coach` | Specifies not to run the coach | - |
173-
| `-f, --formation DIR` | Specifies the formation directory | - |
174-
| `--team-graphic FILE` | Specifies the team graphic xpm file | - |
175-
| `--offline-logging` | Writes offline client log | `off` |
176-
| `--offline-client-mode` | Starts as an offline client | `off` |
177-
| `--debug` | Writes debug log | `off` |
178-
| `--debug_DEBUG_CATEGORY` | Writes `DEBUG_CATEGORY` to debug log | - |
179-
| `--debug-start-time TIME` | The start time for recording debug log | `-1` |
180-
| `--debug-end-time TIME` | The end time for recording debug log | `99999999` |
181-
| `--debug-server-connect` | Connects to the debug server | `off` |
182-
| `--debug-server-host HOST` | Specifies debug server host | `localhost` |
183-
| `--debug-server-port PORT` | Specifies debug server port | `6032` |
184-
| `--debug-server-logging` | Writes debug server log | `off` |
185-
| `--log-dir DIRECTORY` | Specifies debug log directory | `/tmp` |
186-
| `--debug-log-ext EXTENSION` | Specifies debug log file extension | `.log` |
187-
| `--fullstate FULLSTATE_TYPE`| Specifies fullstate model handling | - |
188-
| `--g-ip GRPC IP` | Specifies grpc IP | `localhost` |
189-
| `--g-port GRPC PORT` | Specifies grpc port | `50051` |
190-
| `--diff-g-port` | Specifies different grpc port for each player | `false` |
191-
| `--gp20` | Add 20 to GRPC Port if team run on right side | `false` |
192-
193-
## Use Docker (Linux, WSL, Windows)
56+
We suggest you to use the AppImage to run the SoccerSimulationProxy. Check Soccer Simulation Proxy - AppImage page to download and run the AppImage.

0 commit comments

Comments
 (0)