![]() |
network tables and the raspberry pi
well, the title is self explanatory, anyone know how to include the network tables, and more importantly, get them to work "properly"
|
Re: network tables and the raspberry pi
I am not sure if you have seen this yet: https://github.com/robotpy/pynetwork...master/samples.
It pretty much has everything you need to know to use the network tables on the raspberry pi, from installation to sample code. |
Re: network tables and the raspberry pi
There are a few threads on the subject here, but if you just want code, please feel free to look at our 2016 pi-tracker in github: https://github.com/frc5687/pi-tracker.
Also included is the networktables jar file. There's not much documentation on github, but the code itself should be fairly clear. You're also welcome to PM me with questions. |
Re: network tables and the raspberry pi
I assumed java...but of course if you were looking for python, go with jchau's reply above!
|
Re: network tables and the raspberry pi
If you do choose to go with python, you can get more information about installation as well as the API reference here: http://pynetworktables.readthedocs.io/en/latest/.
|
Re: network tables and the raspberry pi
alright, thanks for the quick info, ill give this a shot!
|
Re: network tables and the raspberry pi
Python example: https://github.com/GarnetSquardon490...or_shutdown.py
|
Re: network tables and the raspberry pi
Here's 832's brand new OpenCV code using python and pynetworktables:
https://github.com/oscarrobotics/VisionOnPi2016 If you're using the Pi for Vision Processing, you can also just copy the whole thing, as long as you follow the instructions in the README |
Re: network tables and the raspberry pi
Quote:
|
Re: network tables and the raspberry pi
We encountered substantially more lag with NetworkTables than with straight UDP. Plus, we would occasionally see odd behavior in the NT version that may or may not have been caused by NT bugs. Values would change at unexpected times, etc. I think we were just pushing more data through NT than it was designed for, so rather than debug we switched to UDP and the problems went away.
|
Re: network tables and the raspberry pi
Quote:
|
Re: network tables and the raspberry pi
Quote:
|
Re: network tables and the raspberry pi
Quote:
On the pi, we run pi-tracker and communicaton with the rio is through RobotProxy. RobotProxy starts a thread to listen for incoming UDP packets from the rio, and expose the incoming values. It also provides the Send method to send updates to the rio. On the rio, the robot code uses the PiTrackerProxy exactly the same way: it starts a thread to listen for incoming packets from the pi while providing the collect method to send packets to the pi. Note that the reason for this complicated mechanism was to more precisely correlate the timing of images to the position the robot was in when the picture was taken. For more on this, see Team 254's video and presentation. We then compute a new "target" pose based on the image and pose when the image was taken, and use PID to get us there. |
Re: network tables and the raspberry pi
The biggest drawback to NT, is the update frequency, the fastest you can configure them to update is 100ms. Does that hurt, depends on how you use it. Faster doesn't always mean better. But when you add in the delay of the co-processor to process the image, and include in the NT delay, it can quickly become a problem.
In our code, NT was fine, but UDP would have been better and reduced oscillation during targeting. But with NT we could fire in about 3s (turn and elevate), and hit 80-90%. We will look at UDP in the future, but NT are a good V1.0 option, just understand the limitations. |
Re: network tables and the raspberry pi
Quote:
|
Re: network tables and the raspberry pi
I seen a lot of post about raspberry pi and its usage in FRC... Most posts are over my head as they are reffering to some support or coding example request.
Is there an actual post, white papers or other resources that "dummie" it down so I could understand what and how they are use? Trying to learn, but yet to find a good resources showing what we could do with them. Thanks a bunch! |
Re: network tables and the raspberry pi
Quote:
|
Re: network tables and the raspberry pi
Quote:
One is controlling an FRC robot off a pi. This is in less than an infancy stage and there is no progress to report. This wouldn't be used for competition, but would let us keep last year's robot in service for demos without buying more RoboRio's. And its also a potential teaching tool for rookies. The second, and the one I'm working on and asking about here is using it as a vision coprocessor. This is for doing things like recognizing the retroflective tape around the goals in the Stronghold game. To accomplish the recognition, a camera has to take in the image, and the processor has to perform a number of filtering operations on it. This is a very computing intensive exercise, so doing it on board the RoboRio can slow down the whole Robot. By putting a Pi on as a coprocessor, the RoboRio can keep doing its robot thing, while the Pi does nothing but chew on image data. Here in this thread, I am looking for help with getting the processed data from the Pi to the RoboRio and useful in robot code. FRC pushes this method called Network Tables. It seems fairly straightforward but I'm still learning it myself. You basically call a function that says put this data into a network table with this name. Then in your robot code you call a function that says look for a network table with this name, and assign it to some variable. If I'm still over your head, feel free to shoot me a private message and I would be happy to help further. Or visit team5401.org and email the team and ask for Kevin and I'll get it. |
Re: network tables and the raspberry pi
Love the explanation ! thank you very much!
So I am assuming that the NT just like a small database available on the RIO? Any tutorial on using them? |
Re: network tables and the raspberry pi
Quote:
My understanding of a Network Table is that its an array variable out on the network. Depending on your code, you can create one or read one. |
Re: network tables and the raspberry pi
Quote:
|
Re: network tables and the raspberry pi
Cool, glad to see the option for less than 100ms. We'll have to test it out.
|
Re: network tables and the raspberry pi
Quote:
There's one server (typically the robot program running on the roboRio) and all others are clients. Each program has a local copy of the entire data store and updates are periodically synchronized across the network. Note that Client-Client updates require two synchronization steps (Client to Server and Server to Client, as there's no direct Client-Client connections), and thus are slightly higher latency. |
Re: network tables and the raspberry pi
FWIW, the Ga Tech Univ Robojackets, in an effort to help build GA FRC, had several FRC teams give presentations on different topics. With the hope that spreading the knowledge will benefit all teams in GA. Here's their youtube channel
https://www.youtube.com/user/RoboJackets The programmers of 1261 did a presentation on vision processing, what we learned and why they made the choices they made. They defined the terms they used, so beginners could pick it up too. https://www.youtube.com/watch?v=ZNIlhVzC-4g I believe that Cheezy Poofs have vision processing presentations in the past, and are a GREAT source. With the development of GRIP last year, getting in to vision processing is a lot easier, so give it a try. Brian PS: I don't know what the sound problem is with the YouTube channel, it's has a bit of an echo for me. But that wasn't there before, I'll bring it to the Robojackets attention. |
Re: network tables and the raspberry pi
I've added a page on NetworkTables operation to the RobotPy documentation site -- much of the information is already in this thread, though if you have more information please feel free to contribute!
http://robotpy.readthedocs.io/en/latest/guide/nt.html |
| All times are GMT -5. The time now is 11:28. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi