View Single Post
  #3   Spotlight this post!  
Unread 16-06-2013, 16:11
AllenGregoryIV's Avatar
AllenGregoryIV AllenGregoryIV is online now
Engineering Coach
AKA: Allen "JAG" Gregory
FRC #3847 (Spectrum)
Team Role: Coach
 
Join Date: Jul 2008
Rookie Year: 2003
Location: Texas
Posts: 2,561
AllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond repute
Send a message via AIM to AllenGregoryIV
Re: What is expected of the core libraries?

Quote:
Originally Posted by apples000 View Post
Another interesting issue is the number of really strange undocumented methods that show up whenever you write code. For instance, when you look at available methods on a digital input, you get really cryptic things such as
digitalInput.getAnalogTriggerForRouting. What is an analog trigger, and why do I need it for routing? This method returns whether or not this object that extends digital source is actually an analog input, acting like a digital input. It should be named isAnalogTrigger, or something that is understandable. Also, the CANJaguar has a neat undocumented method, canJaguar.getX. What is X, and why do I need to know what it is?
All of those can be explained by actually looking at the WPILIB source code. We program in Java and I always have my students keep open the WPILIBj project as well to our source to be able to see what the library source is actually doing. For example CANJaguar.getX returns the current Jaugar setpoint regardless of control mode, so potentially a current, voltage, rpm or normal -1 to 1 value.

I don't mind having a lot of the included functionality it's very helpful for most teams. I do see how having a stripped down version of the library could be useful for some of the advanced teams.

We also do modify the library but only when necessary. For the past few years it was to add a ToggleWhenPressed method to the Button class, but I think WPILIB is finally going to include it by default in the next release.
__________________

Team 647 | Cyber Wolf Corps | Alumni | 2003-2006 | Shoemaker HS
Team 2587 | DiscoBots | Mentor | 2008-2011 | Rice University / Houston Food Bank
Team 3847 | Spectrum | Coach | 2012-20... | St Agnes Academy
LRI | Alamo Regional | 2014-20...
"Competition has been shown to be useful up to a certain point and no further, but cooperation, which is the thing we must strive for today, begins where competition leaves off." - Franklin D. Roosevelt