I want to publish a value to NetworkTables that will be updating constantly, such as the current speed of a motor. My understanding is that the normal way to do this is to create a DoublePublisher and call dblPub.set(value)
whenever my value changes. However, since this value changes so rapidly, I was hoping there was a way to link a DoublePublisher with a DoubleSupplier in a way that updates the NetworkTable topic in the background instead of my code explicitly calling dblPub.set(dblSup.getAsDouble())
periodically.
Perhaps the simplest way to do this would be to use ShuffleboardContainer.addDouble(String title, DoubleSupplier valueSupplier)
. However, ideally I would like to interact with the NetworkTables API directly instead of relying on ShuffleBoard stuff.