You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+39-15Lines changed: 39 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -106,28 +106,52 @@ Generate a new `server.crt` for the game-controller with [tools/newX509KeyPair.s
106
106
See instructions for the client part in the reference clients mentioned above.
107
107
108
108
## Integration into your own framework
109
-
The game-controller can easily be integrated into your own AI framework, if you do not want to implement your own controller for testing purposes.
109
+
The game-controller is designed to be integrated into your own AI framework, if you do not want to implement your own controller for testing purposes.
110
110
111
-
Download the release binary from the Github release and run it from inside your framework.
112
-
Then, attach to the WebSocket API that is used by the UI as well to control the game.
113
-
The API is defined in [proto/ssl_gc_api.proto](./proto/ssl_gc_api.proto) and available at the path `/api/control`.
111
+
Download the release binary from the Github release and run it from inside your framework.
112
+
You can adapt the `ssl-game-controller.yaml` config file that is generated on first startup,
113
+
like changing the default ports. Some parameters can also be passed via command line.
114
+
Find the available parameters with the `-h` option.
115
+
Make sure to use non-standard ports whenever possible to avoid any interference with a real field setup.
114
116
115
-
If you don't want to run the controller in real time, you can change the time acquisition mode in the `ssl-game-controller.yaml` file:
117
+
There are three modes that you can run the ssl-game-controller with:
116
118
117
119
1.`system` (default): Use system time
118
-
1.`vision`: Receive messages from ssl-vision and use the timestamps from these messages as the time source. This is mostly useful, when you produce your own ssl-vision frames from simulation.
119
-
1.`ci`: Connect your software directly to the GC via TCP. You can send the current timestamp and tracker packets and will receive the resulting referee message.
120
-
121
-
The `ci` mode also disables all multicast messages.
122
-
This is especially useful, if you run integration tests on your build server in parallel and/or in a container.
123
-
The GC does not receive vision or tracker packages and does not produce referee messages.
124
-
Instead, you should set the correct geometry in `ssl-game-controller.yaml` and send the tracker packages via the CI protocol along the timestamp.
125
-
The referee messages are send from the GC to you via the CI protocol as well.
126
-
For every `CiInput` there will be one or more `CiOutput` responses.
120
+
1.`vision`: Receive messages from ssl-vision and use the timestamps from these messages as the time source. This is mostly useful, when you produce your own ssl-vision frames from simulation.
121
+
1.`ci`: Connect your software directly to the GC via TCP. You send the current timestamp and tracker packets and will receive the resulting referee message.
122
+
123
+
It is highly recommended using the `ci` mode when you integrate the GC with your own simulator.
124
+
It has following advantages:
125
+
126
+
1. No multicast network traffic is required that might be published to your local network (make sure to unset `network.publish-address`)
127
+
1. You have full control of the data flow. The GC will not do anything asynchronously in the background
128
+
1. You define the time and thus the speed.
129
+
1. You provide the ssl-vision tracking data directly.
130
+
131
+
The `ci` mode does not work when you use external simulators like grSim.
132
+
Consider using the `vision` mode instead.
133
+
134
+
When you enable `ci` mode, referee messages will still be published via multicast,
135
+
unless the address unset (set to an empty string). That way, you can still integrate
136
+
an autoRef. It is not yet possible to use the autoRefs without multicast.
137
+
138
+
When the `ci` mode is enabled (via `ssl-game-controller.yaml` -> `time-acquisition-mode`),
139
+
a TCP port is opened (default: 10009). The protocol is defined in [proto/ssl_gc_ci.proto](./proto/ssl_gc_ci.proto).
140
+
You send `CiInput` messages and receive `CiOutput` messages.
141
+
Each input will produce one or more outputs.
127
142
This is, because some changes will generate multiple messages.
128
143
`CiOutput` messages will also be pushed to the CI client for manual changes from the UI or UI API.
129
144
130
-
For details, see: [ssl-ci-test-client](./cmd/ssl-ci-test-client/README.md)
145
+
The GC requires ssl-vision detection data to work correctly.
146
+
By default, it just receives ssl-vision messages.
147
+
In the `ci` mode, you have to provide the data via the ci protocol.
148
+
The message format is the same as for the recently introduced tracking protocol.
149
+
150
+
A small sample test client for the `ci` mode can be found here: [ssl-ci-test-client](./cmd/ssl-ci-test-client/README.md)
151
+
152
+
If you can not use the `ci` mode, you can alternatively connect to the GC using the UI WebSocket API.
153
+
The API is defined in [proto/ssl_gc_api.proto](./proto/ssl_gc_api.proto) and available at the path `/api/control`
154
+
under the same port as the UI.
131
155
132
156
### Examples
133
157
* Integration of the binary: https://github.com/TIGERs-Mannheim/AutoReferee/blob/master/modules/moduli-referee/src/main/java/edu/tigers/sumatra/referee/SslGameControllerProcess.java
0 commit comments