11pynetworktables2js
22==================
33
4- A cross platform library that forwards NetworkTables key/values over a Websocket ,
4+ A cross platform library that forwards NetworkTables key/values over a WebSocket ,
55so that you can easily write a Driver Station Dashboard for your robot in HTML5 +
66JavaScript.
77
88This library does not provide a full dashboard solution, but is intended to
99provide the necessary plumbing for one to create one with only knowledge
10- of HTML/Javascript . Because the communications layer uses NetworkTables, you
10+ of HTML/JavaScript . Because the communications layer uses NetworkTables, you
1111can connect to all FRC languages (C++, Java, LabVIEW, Python).
1212
1313.. note :: NetworkTables is a protocol used for robot communication in the
@@ -23,6 +23,22 @@ Documentation can be found at http://pynetworktables2js.readthedocs.org/
2323Installation
2424============
2525
26+ Easy install (Windows only)
27+ ---------------------------
28+
29+ 1. Download the latest pynetworktables2js.exe from GitHub at
30+ https://github.com/robotpy/pynetworktables2js/releases .
31+ 2. Extract the exe from the zipfile, and copy it to your directory of HTML/JS
32+ files.
33+ 3. Double click the exe to run it!
34+
35+ .. note :: By default, it will connect to 127.0.0.1. To connect to a robot,
36+ you will need to pass the exe arguments to tell it where the robot is.
37+ Use ``--help `` to see the available options.
38+
39+ Manual install
40+ --------------
41+
2642Make sure to install python 2 or 3 on your computer, and on Windows you can
2743execute::
2844
@@ -56,13 +72,47 @@ those resources to make something cool to control your robot?
5672Usage
5773=====
5874
75+ You can just distribute your HTML files, and run a pynetworktables server
76+ using the following command from inside the directory::
77+
78+ python -m pynetworktables2js
79+
80+ Or on Windows::
81+
82+ py -m pynetworktables2js
83+
84+ This will start a pynetworktables2js server using Tornado (which is installed
85+ by default) and it will serve the current directory. You can navigate your
86+ browser (I recommend Chrome) to http://127.0.0.1:8888 and see your website.
87+
88+ You will want to also pass either the ``--robot `` or ``--team `` switch::
89+
90+ py -m pynetworktables2js --robot roborio-XXXX-frc.local
91+ py -m pynetworktables2js --team XXXX
92+
93+ Dashboard mode currently doesn't work, as the underlying support in
94+ pynetworktables hasn't been implemented yet for the newer FRC Driver Station.
95+
96+ Customized python server
97+ ------------------------
98+
99+ There are two example servers distributed with pynetworktables2js, one that
100+ uses `tornado <http://www.tornadoweb.org/en/stable/ >`_, and one that uses
101+ `aiohttp <https://github.com/KeepSafe/aiohttp >`_. Either one should work.
102+
59103Go to the 'example' directory distributed with pynetworktables2js, and run::
60104
61- python server .py --robot 127.0.0.1
105+ python tornado_server .py --robot 127.0.0.1
62106
63107If you want to try this out with your current robot, you can do::
64108
65- python server.py --robot roborio-XXX.local
109+ python tornado_server.py --robot roborio-XXX.local
110+
111+ If you are running pynetworktables2js on your driver station laptop, you can
112+ receive robot IP information directly from the Driver Station (handy during
113+ actual competitions)::
114+
115+ python tornado_server.py --dashboard
66116
67117If you navigate your browser (I recommend Chrome) to http://127.0.0.1:8888, all
68118of the current NetworkTables values will be shown as they change.
@@ -77,18 +127,19 @@ dashboard. Just add your custom files to the www directory.
77127Contributing new changes
78128========================
79129
80- pynetworktables2js is intended to be a project that all members of the FIRST
130+ pynetworktables2js is intended to be a project that all members of the ` FIRST `
81131community can quickly and easily contribute to. If you find a bug, or have an
82132idea that you think others can use:
83133
84- 1. `Fork this git repository <https://github.com/robotpy/pynetworktables2js/fork >`_ to your github account
134+ 1. `Fork this git repository <https://github.com/robotpy/pynetworktables2js/fork >`_
135+ to your GitHub account
851362. Create your feature branch (``git checkout -b my-new-feature ``)
861373. Commit your changes (``git commit -am 'Add some feature' ``)
871384. Push to the branch (``git push -u origin my-new-feature ``)
88- 5. Create new Pull Request on github
139+ 5. Create new Pull Request on GitHub
89140
90141One place in particular I would love to see contributions is in adding useful
91- javascript functions/objects that make creating dashboards even easier!
142+ JavaScript functions/objects that make creating dashboards even easier!
92143
93144Authors
94145=======
0 commit comments