|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Value refreshing on SmartDashboard
Hi all,
I've recently been working on a custom widget for SmartDashboard that is a running line graph of the last 200 values sent (or 4 seconds at 50Hz). I'm planning to release it later after a bit more polish and customization goes into it. It works great, the only problem I'm having now is it doesn't update when the values coming in aren't changing. My best guess is one of these 2:
Does anyone have any tips on where this goes on, or how to make it take in every value? I'm not shy about editing the SmartDashboard source and recompiling, but I'm a little more hesistant to muck around in WPILib (using Java, by the way.) I poked around a bit in the SmartDashboard source but didn't find what I was looking for. One potential solution we came up with was to alternate adding or subtracting a miniscule amount (all values are Doubles) to trigger a send, which wouldn't be too bad as you don't see the numbers - it's just graphical. But if we can get it working without that it would be preferred. Thanks! Last edited by BigJ : 15-02-2012 at 16:36. |
|
#2
|
|||
|
|||
|
Re: Value refreshing on SmartDashboard
It happens on the robot side. The NetworkTable does nothing unless a value changes.
Changing the value of the double a little bit would do what you want. Also, although this is a mildly awful idea, you can have your widget change the value of the element in the field every time it reads in a value. That way, when the robot puts in a new value, it will be different. However, that will change the value in the table... |
|
#3
|
|||
|
|||
|
Re: Value refreshing on SmartDashboard
Thanks, I'll try changing the value on dashboard side, and if it doesn't work I'll do the fidgeting double thing.
I'm not terribly worried about performance -- this would be a tuning/testing tool and not something to use during a match (in my opinion). |
|
#4
|
||||
|
||||
|
Re: Value refreshing on SmartDashboard
If you want an indicator of when the NetworkTable is updated, you could have a boolean value that you invert every update, as a way of indicating the change. This would be a MUCH better idea than tweaking the double because it wouldn't actually skew your data at all. Floating point is a little weird because changes that you think are easily reversible may not be after all, which means that tweaking a double is just generally a very bad idea
![]() |
|
#5
|
|||
|
|||
|
Re: Value refreshing on SmartDashboard
Update -- changing the value that comes to the dashboard didn't seem to work.
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|