|
Re: RoboRio Losing WPILib Preferences
That sounds a bit strange. I'm sure it's frustrating! I wonder if the preferences mechanisms under the hood are not yet ready when you're trying to access them programatically. Maybe doing a few experiements...
- Assign a button on a joystick to load the values and print them out or display them. When you see they are not loaded, wait a minute and then use the joystick button to load them. If this works, then it's a bug in the preferences allowing the load to happen too soon. Just a hunch.
- Another thought - if you store a preference item ... call it MAGICCOOKIE and set it equal to something you know - like your team number - or a string like "FRC"... then when you load preferences, you could immediately check for your MAGICCOOKIE value being correct. If it's not correct, you could Wait() and try again - and again - for some period of time. If this solves/heals it in a few trys / seconds upon initialization, this could work for you.
My team did use preferences a few years back but found only strings to be functional and so we used strings and sscanf() to scan those formatted strings into variables. I doubt the same issue is here but thought I'd throw it out there just in case it rings a bell for you.
bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
|