View Single Post
  #1   Spotlight this post!  
Unread 19-02-2013, 13:18
sparkytwd's Avatar
sparkytwd sparkytwd is offline
Registered User
FRC #3574
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Seattle
Posts: 96
sparkytwd will become famous soon enough
Pure Python NetworkTables 2 client

For this year, I've been working with Team 3574 on doing vision processing on an embedded ARM board (Odroid U2). As part of that work I implemented a NetworkTables client in Python.

There is some roughness to it, it's not pythonic, it has no support for array types (couldn't create those in either Python or Java), has some weirdness about reading your writes (sometimes you won't, sometimes you will, you could read invalid data), and makes liberal use of sleeps to make sure events happen in sequence rather than explicit checking.

If that hasn't scared you off, the nice things about it are; its dead simple with a single constructor that takes your team number, and just 2 methods, getValue, setValue. Types are enforced through exceptions (so be careful in non test code).

If you use this only to read values, or be the only client updating another value, it should work just fine.

https://github.com/Team3574/2013Visi...c/nt_client.py
Reply With Quote