View Single Post
  #1   Spotlight this post!  
Unread 18-03-2013, 14:19
slibert slibert is offline
Software Mentor
AKA: Scott Libert
FRC #2465 (Kauaibots)
Team Role: Mentor
 
Join Date: Oct 2011
Rookie Year: 2005
Location: Kauai, Hawaii
Posts: 343
slibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud ofslibert has much to be proud of
Crio C++ Preferences -> How to See/Edit these values in the Smart Dashboard

We are currently using a Preferences object in our code, to store/retrieve various tuning parameters like PID coefficients.

Here's the snippet of code that instantiates/uses the Preferences:

**********

<RobotMap.cpp, in the static init() method>

Preferences *prefs = Preferences::GetInstance();
double tilter_p = prefs->GetDouble("Tilt_P", 1.0);
double tilter_i = prefs->GetDouble("Tilt_I", 0.0);
double tilter_d = prefs->GetDouble("Tilt_D", 0.0);
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
LiveWindow* lw = LiveWindow::GetInstance();
....

***********

On the smart dashboard side, we transition to Teleop mode, enable it in the driver station, and then add the "RobotPreferences" widget, but the above preferences don't show up. (Actually, nothing shows up in the widget). Other controls are communicating Ok w/the robot code, just not the Preferences.

So we push the "Save" button on the smart dashboard side, reboot the robot, and still nothing shows up in the "RobotPreferences" widget.

We think our usage is correct (we've based it on the documentation in the 2013 screensteps live at http://wpilib.screenstepslive.com/s/...martdashboard).

Are we missing some sort of important initialization here in order to get this to work?
Reply With Quote