|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Timing of NetworkTables
Given the way it's implemented, that doesn't surprise me.
|
|
#2
|
||||
|
||||
|
Re: Timing of NetworkTables
So I got UDP working, and using the same algorithm, it was anywhere between 2-10 ms. I am surprised the difference is THAT large between raw UDP and NetworkTables. We were gonna use pynetworktables and OpenCV on a beaglebone black to try camera targeting, but we might have to replace networktables with udp if the difference is that big.
|
|
#3
|
|||
|
|||
|
Re: Timing of NetworkTables
The values written in SmartDashboard are marked as dirty. Dirty elements are sent to the other subscribers based on a clock. The default value for this clock is 100ms in LV. I'm not sure what it is on other implementations. The LV implementation lets you specify the update time value when the client or server are started.
Why is it done this way? Making every write send a message over the network wouldn't work very well if/when someone writes to a SD variable a million times per second. So this amortization of updates is a pretty common approach for how you make a super fast thing link to a relatively slow thing, the last value is the most important, and you want to keep up to date. The LV implementation also contains a VI called flush. This is there so that you can leave the update clock set to a relatively slow value, but when you have an image to process or something else that is timely, you can flush the update immediately after writing. Greg McKaskle |
|
#4
|
||||
|
||||
|
Re: Timing of NetworkTables
To tack onto what Greg said, chances are you aren't going to require response times much faster than 100ms anyways -- physical things can only move *so* fast. I don't recall if the C++ implementation (which is what pynetworktables wraps) has a flush function or not, I don't recall seeing it.
We used networktables to do automated targeting, and it worked out fine. |
|
#5
|
||||
|
||||
|
I never knew that the lag spikes could get that high!
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|