View Single Post
  #2   Spotlight this post!  
Unread 24-03-2013, 21:36
Bryce Paputa's Avatar
Bryce Paputa Bryce Paputa is offline
FF TSL: Frog Farce
FRC #0503 (Frog Force)
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2008
Location: Novi Michigan
Posts: 454
Bryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond reputeBryce Paputa has a reputation beyond repute
Re: Share your Java Utilities and Object Classes

Here is our current code, we have quite a few of these things,
  • util.CoupledTalons is a class we have to run two talons in sync with eachother, it also ramps the power on them.
  • calibrations.* are classes that let us calibrate sensors and get usable numbers from them, we have one for an encoder with a limit switch at one end of it's travel, and one for a pot with one on each end.
  • limitSwitches.* are classes that make using limit switches easier. There is NCLimitSwitch which is a wrapper for the normal digital input class that inverts the input so we can't forget to do it. LimitSwitchSystem is an interface for a class that helps with using limit switches as bounds, SingleLimitSwitchSystem is one that just has one limit switch, DualLimitSwitchSystem is for two. They both return values of the LimitSwitchState enumeration, which has values for when the switches are pressed and for when they aren't.
  • controllers.* are classes that generalize motor control using the calibrations and limit switch systems. There is SimpleController which works exactly like a normal motor controller, except for the fact that it uses the limit switch states to limit the motion. StringPotPidController and EncoderPIDController add PID on top of the simple controller.
The code isn't commented very thoroughly yet as the code is still changing and we haven't had a lot of time to comment it, so don't hesitate to PM me with questions.
Reply With Quote