Our team is having trouble deciding the best way to average out the readings we get from NetworkTables and storing those as accurate variables to move our robot about in autonomous. Any teams have success with this yet?
Our team is also wondering the same!
For filtering, the typical go-to in control systems is a Kalman filter. That’s also almost certainly complete overkill for this - a simple low-pass filter is very likely good enough and quite easy to program : e.g. http://www.earlevel.com/main/2012/12/15/a-one-pole-filter/.
As has been mentioned in other threads, the feedback from networktables probably isn’t low-latency enough to do closed-loop control on. Instead, you’d grab a value from NT and use it as the set-point for another control system which has better feedback (e.g. encoders & PID or whatever). Once you arrive at the set-point, resample the NT value to see how far off you are. Again adjust this error using the feedback control system. Rinse and repeat. At some point your error will be close enough and you’re where you need to be based on the NT values.
I suppose you could also adjust on the fly - that is, update setpoints periodically from NT even while you’re still on the move, assuming the control system can handle this.