View Single Post
  #9   Spotlight this post!  
Unread 17-01-2013, 14:45
Arhowk's Avatar
Arhowk Arhowk is offline
FiM CSA
AKA: Jake Niman
FRC #1684 (The Chimeras) (5460 Mentor)
 
Join Date: Jan 2013
Rookie Year: 2013
Location: Lapeer
Posts: 543
Arhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to beholdArhowk is a splendid one to behold
Re: Utilizing the Smart Dashboard

Quote:
Originally Posted by Ginto8 View Post
Anything extending WPILib's Trigger class will show up on the dashboard as a button -- including all of WPILib's Button types.


SmartDashboard's "save" stores what widgets are loaded and their properties (size, color, etc.). SmartDashboard widgets aren't supposed to provide values to the robot; they're supposed to display them and allow them to be tweaked at runtime. If you want a value to stick around, change the value you give to put() on the robot or use Preferences.


The Robot Preferences widget puts a bunch of values into a network table so that the robot can read them. When you hit save, it sends another network table value telling the robot to save. The robot then saves the preference values (assuming you have a Preferences object on the robot) to the file wpilib-preferences.ini on the cRio, to be loaded again at a later time.


I don't even know if this is possible, but I know it would be a really bad idea. While binary images are much smaller than full-color ones, this will still result in a lot of network traffic. You'd have at least two video streams across the network -- one to the cRio from the camera, one to the laptop from the cRio. If you also have a feed to your dashboard, you now have three streams, two of which are full-color, and this becomes quite a load, possibly running over the network traffic limitations. If you want to be able to display different steps of the process live, I recommend doing your image processing on the laptop through a SmartDashboard widget -- for inspiration, you might want to look at Miss Daisy's vision system available here.


I believe you would have to make a custom widget using swing's NumberSlider object. That's what the LiveWindow speed controller widget does.
Quote:
Originally Posted by joelg236 View Post
You are probably saving the SmartDashboard preferences. Add the RobotPreferences widget to SmartDashboard (Edit>Add>RobotPreferences) and click the save button there.
1) extending Trigger? Seems legit... ill look into it

2) see 3

3) I actually found documentation for the Preferences widget in the cookbook and it tells me to use the object Preferences. I got it kinda working (except for some stuff i gotta flush out) except when i try to load all of my stored preferences on robotInit, it will load (kinda) than give me an Out of Memory error (Not exception) than the dashboard will tell me No Robot Code and i have to re-deploy and get the same error

4) True.. ill look into it

5) I dont really follow you on this one...

joelg) read #3 on the Preferences object
Reply With Quote