GithubHelp home page GithubHelp logo

josephcarpenter / 2018-dashboard Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 15.31 MB

:video_game: Code for our 2018 driving dashboard

License: MIT License

CSS 25.07% HTML 23.98% Shell 0.04% JavaScript 50.91%

2018-dashboard's Introduction

2018 Dashboard

Robot Code | Dashboard | Vision

1418's 2018 driving dashboard, built off of the FRC Dashboard web driving dashboard framework.

NOTE: This repository was originally cloned from 1418's 2017 dashboard. As such, it continues to use pynetworktables2js rather than FRCDashboard's new Node-based server.

Screenshot

Setup

Dependencies

  • Python 3

  • 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 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 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-streamer 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.

If you need to interact through the robotpy simulator or similar, run the following command. If not, skip on.

python3 -m pynetworktables2js --robot 127.0.0.1

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 a bit less fluid, but it will work.

  1. Start the Python server independently:

    Windows:

     py -3 -m pynetworktables2js
    

    Mac/Linux (using bash):

     python3 -m pynetworktables2js
    
  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, developer of FRC Dashboard and 1418 Programming Captain

Modifying

In-season, use of this software is restricted by the FRC rules. After the season ends, the MIT License applies instead.

2018-dashboard's People

Contributors

erikboesen avatar josephcarpenter avatar aderhall avatar ianzullo avatar andrewlester avatar calebeby avatar 17mahera avatar carterfendley avatar stonemoney avatar

Watchers

James Cloos 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.