Ohm is a java library for FRC robots. It is intended to augment the features of WPILib with tools that we found useful in our programs.
Java
Permalink
Failed to load latest commit information.
Ohm revised josh's thing to use enums Jan 24, 2017
.gitignore added jars Jan 4, 2017
README.md Update README.md Jan 5, 2017

README.md

Ohm

Ohm is a java library for FRC robots. It is intended to augment the features of WPILib with tools that we found useful in our programs. Ohm offers frameworks for motion control, hardware management, debugging, data logging, driving, and sensor processing.

Ohm is built around functional interfaces specialized for robot input/output. This includes specialized suppliers/consumers of type double and boolean (referred to as Scalar and Binary.) For example, An Ohm BinaryInput is the equivalent of a java Supplier.

For more information, see the Ohm API and wiki
To install Ohm, go to releases, download the latest jar, and add it to your project build path. See this Screensteps page for more information on adding third party libraries to WPILib.

Features

  1. Streams - hardware package
    • Input/Output, Boolean/Double
    • Built in stream operations
    • Stream sources from WPI hardware
  2. PID controllers using streams - control package
    • PIDController vs SynchronousPIDController - either it updates on its own (can be finicky) or you have to update it yourself (reliable)
  3. Drive stream - combination of left and right stream
    • Useful drive algorithms
  4. Display any ohm object on the smartdashboard via the watchable package
    • All streams offer a getWatchable() method, which returns a watchable that will display the current value of the stream
    • Non-stream objects can become watchable by implementing CompositeWatchable, and providing a list of watchables to display.
    • Input watchables track a key on a network table and update a stream based on the value
    • Watchers collect a set of watchables under a unified display behavior, which can be publishing to a network table, logging to a file, or printing to the console
  5. Teleop systems that update periodically
  6. Synchronous commands - a reimplementation of WPILIB commands to be synchronous (they run in our thread)
  7. Hybrid Auton - uses a combination of commands and methods
  8. Registry - tracks used ports and prevents catastrophic error when hardware attempts to claim a used port
    • makes use of the java Optional class to create hardware objects that function when attached to a port, and have graceful default
  9. Robot state estimator - takes in gyro and encoder streams and offers Odometery
  10. Trajectory controller - for driving the robot in auton - uses the Adaptive Pure Pursuit Controller to follow a given set of waypoints
  11. Motion profiles
    • for single DOF (Degrees Of Freedom) controllers
    • intended for actuators
    • Trapezoidal motion profile calculation with initial velocity
    • SmoothSetController is a profiled PID controller with a max accel and max vel. It will always move to the given setpoint in the fastest way possible without breaking constraints
    • MotionProfileController is a simpler controller that will follow any given profile