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

  1. Clone this repository

git clone https://github.com/project-neon/pyVSSSReferee

  1. Open directory

cd pyVSSSReferee

  1. Install dependencies

pip install -r requirements.txt

  1. Finally, install the package

python3 setup.py install

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

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.0.0.tar.gz (17.8 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.0.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyVSSSReferee-1.0.0.tar.gz
  • Upload date:
  • Size: 17.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for pyVSSSReferee-1.0.0.tar.gz
Algorithm Hash digest
SHA256 22d17eff74a901188e5d05679503adc524510705995e7ac2aea60784d9dfdd85
MD5 c6734587c423bb28735e821c30a62038
BLAKE2b-256 0315db5899f7bc89a9fd4c14ab1745807c3403a130fd06025733f24dff5d2e1b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyVSSSReferee-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for pyVSSSReferee-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f12dfa1784111886b12ffdb63e0e6350e7fc1b97bb31776bbfe1bd5e537c74c
MD5 c61d463c7fe9338bcf9479ab6852478d
BLAKE2b-256 cc0fb8bde693ffdff8d071a62efe37d4f8153be019d6836bd15d480d9eeffb4e

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