Quote:
Originally Posted by apples000
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.