View Single Post
  #8   Spotlight this post!  
Unread 20-03-2013, 16:50
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,562
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Crio C++ Preferences -> How to See/Edit these values in the Smart Dashboard

Quote:
Originally Posted by slibert View Post
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.
Reply With Quote