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.

WOW … I hope this works. I am using the ODRIOD-U2 as well. Need it for vision. I tried to SIP the c++ network tables per instruction I could not get it to work. I posted in that thread as to why. Thanks for this. Though I do want to get SIP working. If you find any bugs please update! I will let you know if I make any improvements or fix any problems.

Will do. Kids were able to test updating the network tables from their vision processing script running on a laptop.

I’ve got a kernel compiled for the Odroid U2 with PS3 Eye drivers, if you need that.

No thanks I have logitech270 cam running on /dev/04 just fine.

Awesome. The shipped kernel was missing the ov534 drivers, but I was able to compile a new version on the board.

We like the Eye camera as it has custom lens assemblies available, and after an event last year where they had stadium lighting directly behind the vision targets we decided to switch over to infrared.

That is very cool idea!

Awesome! I like. I had to do some modifying to the code to get it to work on the receiving end though… (Not 100% following some of your code.)
I replaced the getValue with:


    def getValue(self, name):
        for i in self.tableValues:
            if self.tableValues*.name == "/SmartDashboard/"+name:
                return self.tableValues*.value
        return None

Which works for floats and strings, at least. setValue doesn’t work, and I can’t quite figure out how or why…
Definitely gonna use this in my Tk dashboard, though.**