Robot Code | Dashboard
1418's 2021 driving dashboard, built off of the FRC Dashboard web driving dashboard framework.
If you're going to be using the preferred method of using the dashboard (as an application through Electron), you'll also need:
nodejs
&npm
- If you don't have permission to install these, see this gist for a workaround.
- Node dependencies (to install,
cd
into dashboard directory and runnpm install
)
- The code for updating the UI with networktables values is in
ui.js
. Our NetworkTables key names are used, but you'll need to change them to match those used in your team's robot code for them to affect anything on your robot.
In order to run the camera, you must start an mjpg-streamer
server on the RoboRIO. To install mjpg-streamer
:
-
Download this installer script from GitHub. This script is for downloading and installing packages to the RoboRIO.
-
While in the directory where you downloaded the installer script, run:
Windows:
py -3 installer.py download-opkg mjpg-streamer py -3 installer.py install-opkg mjpg-streamer
Mac/Linux (using bash):
python3 installer.py download-opkg mjpg-streamer python3 installer.py install-opkg mjpg-streamer
-
Update
style.css
to use the IP of your live camera feed. Usually this is something likeroborio-XXXX-frc.local:5800/?action=stream
, whereXXXX
is your team's number.
You can also use wpilib's cscore library to host a camera stream from the robot. The bindings that we use for python exist in robotpy-cscore.
- Connect to your robot's network if you haven't already. (If you're just testing the dashboard and don't currently need to use it with your robot, you can skip this step.)
- If you are able to use node/npm, use the section below labeled "Using dashboard as Application." If not, use the section titled "Using dashboard through web browser."
The preferred method of using the dashboard is to run it using the Electron framework. Your dashboard will be its own application, and will be easy to manipulate.
While in the dashboard directory, run:
npm start
This will start a NodeJS server and open the dashboard application. Note that you don't have to close and reopen the application every time you make a change, you can just press Ctrl+R
(Cmd+R
on Mac) to refresh the application.
- Team 1418
In-season, use of this software is restricted by the FRC rules. After the season ends, the MIT License applies instead.