Giter Site home page Giter Site logo

frc-2019-ds's Introduction

FRC Dashboard

FRC Dashboard is a fully customizable dashboard for FIRST Robotics Competition (FRC) which is based on web languages (JavaScript/CSS/HTML). It's completely legal for competition, and can be used to give your whole drive team significantly richer control of your robot.

The dashboard's code is designed to be 100% accessible, tweakable, and expandable. To help in this aim, the code is rigorously documented with thousands of inline comments and a set of training exercises. In addition, the base system comes with several functioning example widgets and features, and many addons have been created to speed up the development of your team's dashboard.

Contributions are VERY welcome! Please feel free to open a pull request or issue!

Screenshot slideshow

Setup

Dependencies

  • Python 3 (MUST be 3, not 2!)

  • pynetworktables2js

      pip3 install pynetworktables2js
    

    If you don't have administrator privileges, put --user at the end of that command.)

If you're going to be using the preferred method of using the dashboard (as an application), you'll also need:

  • nodejs & npm
    • If you don't have permission to install these, see this gist for a workaround.
  • Electron (to install, cd into dashboard directory and run npm install)

Configuration

  • In ui.js, there's a large switch statement in the onValueChanged() function which controls the updating of control elements in the dashboard. Example 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.

Configuring Camera feed

In order to run the camera, you must start an mjpg server on the RoboRIO. To install mjpg-streamer:

  1. Download this installer script from GitHub. This script is for downloading and installing packages to the RoboRIO.

  2. 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
    
  3. Update style.css to use the IP of your live camera feed. Usually this is something like roborio-XXXX-frc.local:5800/?action=stream, where XXXX is your team's number.

Running

  1. 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.)
  2. 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."

Using dashboard as Application

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

Using dashboard through web browser

The less desirable, but perfectly functional method of viewing your dashboard is to use it like a webpage. This method will work even if you don't have the privileges to install node.js and npm. The standard toolbars from your browser will still be shown and will take up space on the screen, and the experience will be less fluid, but it will work.

  1. Start the Python server independently:

    Windows:

     start py -3 server.py
    

    Mac/Linux (using bash):

     python3 server.py
    
  2. To view the dashboard, use your browser to navigate to http://localhost:8888.

It is recommended that while using the dashboard on your driver station, you close the top panel of the FRC DriverStation to make room for the dashboard.

Authors

  • Erik Boesen is the primary developer of FRC Dashboard.
  • Team 1418 used earlier versions of this code in 2015 and 2016.
  • Leon Tan led the original 1418 UI team, coded pynetworktables2js, and developed a browser-based UI which was years later reworked to create FRC Dashboard.
  • Dustin Spicuzza leads the RobotPy project mentored team 1418 through much of FRC Dashboard's genesis.

Modifying

FRC Dashboard is designed to be modified for your team's purposes, but we have some restrictions we'd like you to follow when using this software.

We'd like if you fork this repository to your team's organization (or wherever else you like) if you plan to use GitHub for development. This will allow us to be informed about who's using the software and will help you to easily apply updates should we issue them. You don't HAVE to do this, but we'd much prefer it to other methods, like copying the repository contents to your own.

This software is licensed under the MIT license. Basically, modify as much as you like, as long as you give credit to the original source and don't hold us accountable for anything. More information in LICENSE.

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.