Creates a network socket to communicate with the VSSS League referee
Project description
pyVSSSReferee
Easily create a network socket between the VSSS League's referee and your VSSS software.
Requirements
- protobuf==3.20.3
Installation
Use the code below to install the package from PyPI:
pip install pyVSSSReferee
A Simple Example
- In a test folder, save the code below as config.json
{
"network" : {
"multicast_ip": "224.0.0.1",
"referee_ip": "224.5.23.2",
"host_ip": "localhost",
"blue_port": 30011,
"yellow_port": 30012,
"vision_port": 10002,
"command_port": 20011,
"referee_port": 10003,
"replacer_port": 10004
},
"match" : {
"num_robots": 3,
"team_color": "blue"
}
}
- In the same folder, save the code below as test.py and run it while the referee is running
import pyVSSSReferee
from pyVSSSReferee.RefereeComm import RefereeComm
r = RefereeComm(config_file = "config.json")
r.start()
while (True):
print(r.get_last_foul())
Important Methods
Some important methods are:
| Method | Description |
|---|---|
| get_last_foul | Returns last foul in the format: {'foul': 'Foul_name', 'quadrant': 'Quadrant_number', 'color': 'Team_color', 'can_play': 'boolean_value'} |
| can_play | Returns True if current game foul is GAME_ON, returns False otherwise |
| get_status | Returns game's current status message sent by the referee |
| get_color | Returns color of the team that will kick in the penalty or goal kick. BLUE is default. |
| get_quadrant | Returns the quandrant in which the free ball will occur. |
| get_foul | Returns current foul. |
| send_replacement | Receives team color and list of x and y coordinates, angle and ids of robots and sends to the Referee. Team color must be in uppercase, either 'BLUE' or 'YELLOW'. |
Colaboration Guide
In order to colaborate with this repository, clone this repository:
git clone https://github.com/project-neon/pyVSSSReferee
Open directory
cd pyVSSSReferee
Then install dependencies
pip install -r requirements.txt
Finally, install the package
python3 setup.py install
Remember to use the Project Neon guidelines to git: https://github.com/project-neon/codestyleguide/blob/master/git.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyVSSSReferee-2.0.0.tar.gz.
File metadata
- Download URL: pyVSSSReferee-2.0.0.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67cb41b2f6af3f69fea92f28cd286132da3f5df6c7bbbc1c1f557e414a993672
|
|
| MD5 |
6ae536f8223d37c5bae090f9140602bb
|
|
| BLAKE2b-256 |
07436bcf44289949edbf65b1b915f7a1b1bfc241608525cf62cf4195de6e8fd2
|
File details
Details for the file pyVSSSReferee-2.0.0-py3-none-any.whl.
File metadata
- Download URL: pyVSSSReferee-2.0.0-py3-none-any.whl
- Upload date:
- Size: 21.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02c6070a8e5209c613fc11a6460afb80e426cb7ccec54a00d2194ba72d3c3690
|
|
| MD5 |
9b6c71739885d63cf77abffe390c67f3
|
|
| BLAKE2b-256 |
b4f80f74050fd96168a8508bc0bec0e8582ee9e4908bfdb0e5707f7ffc86d911
|