Giter Site home page Giter Site logo

paradox2102 / anthill-anarchy-match-runner Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 224 KB

Software to display overlays on video feed for competition

Dockerfile 1.57% Python 61.81% Shell 0.39% HTML 19.89% CSS 5.08% JavaScript 11.27%
anthill-anarchy non-robot

anthill-anarchy-match-runner's Introduction

Anthill Anarchy Match Runner

This software was written to assist Team Paradox (2102) with the administration of an off-season competition run along FRC-like lines. It provides a simple text display that can be shown to competitors and also overlaid on a video feed. It also provides a simple control interface that allows officials to start matches and display scores.

Team lists, match lists, and match scores are maintained in a Google spreadsheet, which this service accesses read-only. (This is a deliberate design choice not to implement a user interface for entering data in a table and storing them persistently.)

Note: There is no attempt to interact with driver station software, so teams are responsible for complying with start/stop.

Two interfaces are provided:

โš ๏ธ ๐Ÿ”‰ ๐Ÿ“ฃ ๐Ÿ’ฅ ๐ŸŽง ๐Ÿ™‰ Warning: The overlay interface (and, via its preview iframe, the control interface) plays loud noises during the match, intended to be heard over speakers in a noisy competition environment. You may not enjoy the unadjusted headphone experience.

Note: To use this yourself, you will minimally need to:

  • Create a Google service user account (see Creating and managing service accounts)
  • Save the credentials in service-credentials.json (see Creating and managing service account keys). For security reasons, this file should not be saved in GitHub.
  • Create a Google spreadsheet with the appropriate tables. See sheet.py to find or change the table names, and the HTML files in template for the column names. Or copy this example
  • Share the spreadsheet with the service user (read-only)
  • Change the spreadsheet id in sheet.py

To run, invoke ./run.sh. The only pre-requisite is Docker.

Implementation notes

The microservice implementation is divided between several Python modules:

  • app: Top level microservice application
  • control: Handles messages to and from control interface
  • overlay: Handles messages to and from overlay interface
  • table: Instantiating complex tables
  • thread: Performs long-running tasks like the match runner
  • sheet: Fetches the matches and teams from the Google spreadsheet
  • config: Useful globals and central configuration

The static HTML files static/control.html and static/overlay.html handle the client side of the two interfaces. Each has an associated JavaScript file and CSS file.

The various HTML tables are configured in the Jinja2 template HTML fragment files in template.

Future work

I really want to make the text and tables auto-scale their font size. It turns out to be hard to predict/control what "screen size" OBS will use for a browser overlay. There are parameters to tweak, but auto-scaling would be more convenient.

There is great scope to style buttons by function using colour, icons, order and dividing into sections. In particular, "Start Match" buttons ought to indicate either whether the match has been run already or whether it has been scored already.

Although it is easy to adjust the overlay's volume in OBS, I should provide volume control with, perhaps, a default that is not so obnoxiously loud. Also want to disable audio for the overlay preview within the control interface. (For some reason, I have been unable to get AUDIO elements to honour a volume setting.)

anthill-anarchy-match-runner's People

Contributors

bovlb avatar

Watchers

ohmeow avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.