Quote:
Originally Posted by slibert
Hmmm - no joy. Performed steps A-D, and the robot still uses the "default" preference values. After restarting the robot, the Robot Preferences widget shows no values, and they didn't appear in the NetworkTables viewer either.
|
Was there anything in the TableViewer before restarting? Is there anything in the wpilib-preferences.ini file on the robot (you can FTP to the robot to retrieve it).
Quote:
We noted that smart dashboard doesn't prompt for any data type when adding a preference. I assume the smart dashboard is adding a string. If so, is there a problem because the dashboard-added string is not the same datatype that the robot code is expecting?
Perhaps we have to modify the robot code to only use strings, converting them ourselves to doubles/ints/etc within the robot code?
|
I've only looked at the java implementation, but C++ should be similar. Internally, everything is transmitted and stored as strings, and then the string is parsed and converted to the right format based on the type you specify in the get (eg int, float, boolean, string, etc). You shouldn't need to do that in your own code.
Are you using the latest C++ update from March 4th? There have been at least two bugs in the preferences class that have been fixed this year.