Shepherd is the team that is in charge of field control. Shepherd brings together all the data on the game field into one centralized location, where it keeps track of score, processes game-specific actions, keeps track of time, and informs the scoreboard.
Shepherd is essentially a Flask web app that communicates with:
- Arduino devices on the field over USB serial.
- Each robot's Runtime instance using MessagePack remote procedure calls over TCP.
- Each driver station's Dawn instance.
- Each scoreboard client, which is rendered with jQuery. Typically, there is a scoreboard on each side of the field, a projection for spectators, and a fourth for the field control staff.
- Each perk selection tablet (specific to Sugar Blast).
Run the following
pip install -r requirements.txt
Run the installlcm script
./installlcm
- Set the Java Version to 8
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
- Run the installlcm script
./installlcm
This year, we ran Shepherd on Ajax, one of the computers owned by PiE. In order to make it easier to run Shepherd on various machines, we added needed dependencies to a Pipfile. This allows you to work in a virtual environment with all necessary dependencies (except for LCM, which must be installed beforehand) by issuing the following commands in PieCentral/shepherd:
pipenv install
pipenv shell
Next, open a terminal pane for each of the below (using tmux) and run the following commands in PieCentral/shepherd directory.
1:
export FLASK_APP=server.py
flask run
2:
export FLASK_APP=scoreboard_server.py
flask run
3:
export FLASK_APP=dawn_server.py
flask run
4:
python3 Shepherd.py
5:
python3 Sensors.py
6:
export FLASK_APP=perks_server.py
flask run