Skip to main content

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.6.1

Installation

Use the code below to install the package from PyPI:

pip install pyVSSSReferee

A Simple Example

  1. 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"
    }
}
  1. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyVSSSReferee-1.1.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyVSSSReferee-1.1.0-py3-none-any.whl (21.1 kB view details)

Uploaded Python 3

File details

Details for the file pyVSSSReferee-1.1.0.tar.gz.

File metadata

  • Download URL: pyVSSSReferee-1.1.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for pyVSSSReferee-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d58f527ce5133043e889db7292d0f3f839ff16a17a6cfce69361b3e720eb45a9
MD5 6b5f2fa080294960b05a1c611b2230a4
BLAKE2b-256 0057ea0dbad6b139324cbccccc9c3551828869a030726aa2c2a84451aa51efb4

See more details on using hashes here.

File details

Details for the file pyVSSSReferee-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyVSSSReferee-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for pyVSSSReferee-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f0cd6ed4bd41f935d8135fdace57b7f06966addffce339f9cee8903adb901fba
MD5 8b4ebf3be4d06db1471a5a1eb1031c08
BLAKE2b-256 db2742120a495433787481f0392258d20bc1c8e2ee98dbf86250b8bcb4dfa49f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page