Log in

View Full Version : Need some help figuring out the SFX SmartDashboard


AtomicBrawlers
08-02-2016, 17:41
I've only been able to send values to the SFX window and make them appear. Getting values from the SmartDashboard and using them in the code is a problem however. For example:

double Throttle = SmartDashboard::GetNumber("Get Throttle", 0.0);

This doesn't give me a bug, but as far as I can tell, the variable is always zero. That is probably because I'm unable to change the default case. Nothing appears on the dashboard when I use that code.

Another issue I'm having is getting the camera feed to appear on the SmartDashboard. I'm 99% sure I have the right URL for it entered. The camera being used is the Microsoft Lifecam HD-3000. It appears on the default or C++ dashboard but not the SFX one.

kylelanman
09-02-2016, 00:02
I've only been able to send values to the SFX window and make them appear. Getting values from the SmartDashboard and using them in the code is a problem however. For example:

double Throttle = SmartDashboard::GetNumber("Get Throttle", 0.0);

This doesn't give me a bug, but as far as I can tell, the variable is always zero. That is probably because I'm unable to change the default case. Nothing appears on the dashboard when I use that code.

We have found that SmartDashboard::GetNumber only works if you have previously used SmartDashboard::PutNumber on the same key. So we just do a SmartDashboard::PutNumber in the ctor of all our subsystems for whatever parameters we will need. Then in the periodic methods we can call SmartDashboard::GetNumber and it will work.

AtomicBrawlers
10-02-2016, 19:16
Thanks a ton! It worked! However, would you happen to know how to get the camera to display on the SFX SmartDashboard? I've tried a bunch of different URLs for it and still no luck.