View Single Post
  #2   Spotlight this post!  
Unread 21-08-2013, 22:26
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Java equivalent of NI demo vision project

It's quite doable using SmartDashboard Properties. My team's 2013 vision system used this, and it made calibrating thresholds wonderfully easy. I'll be playing with our usage of these properties during this preseason to see if I can make the system nicer and more flexible, but the current version shows the basic concepts of it.

One thing you might notice is the obnoxiously large propertyChanged() method, and all the variables storing the values from each of the properties. This was a hack I made to avoid using the Property.getValue() method, which I had blamed for some previous performance problems. This hack got a bit out of hand however, and I'm not totally sure whether it had any positive effects. A big part of making this "nicer" is figuring out how to eliminate that obnoxiousness without causing any performance problems, which may be as simple as using getValue().
__________________
I code stuff.
Reply With Quote