Over the past few years, team #69 HYPER has been collecting re-usable parts of our robot code into a library called HYPERLib. Today marks its 1.0 release. HYPERLib provides classes to help with many aspects of robot programming, ranging from minor organizational improvements to more complex features.
The biggest features are:
- Annotations to map the operator interface and robot ports declaratively, and a “robot inspector” that can check for simple errors and generate diagrams of each. OI example and ports example.
- Several methods to make simple commands using lambdas.
- A “preferences set” class which groups together related preferences, and runs a callback when one changes. A PID controller with built-in preferences for each parameter, as well as OpenCV Scalar preferences.
- An improved autonomous chooser together with a shuffleboard plugin that supports selection of an “autonomous strategy”. This defines a mapping of game specific data to routines. Each routine can use annotations to easily change hard-coded values to preferences, and these preferences show up in a shuffleboard plugin. HYPERLib supports commands which are “subroutines”, and the preferences for a subroutine show up whenever a command which uses it is selected. Autonomous example.
- A simple modular framework for vision processing, which supports multiple cameras and multiple pipelines on each camera, and which abstracts away threading issues. Each “pipeline” can also generate output to display on the dashboard.
The library and documentation are far from polished, and feedback is certainly welcome. The code is licensed under the GPL version 3.
We publish releases as maven artefacts, so setting the library up with the new build system is only a few lines. To get started, check out the wiki.