Core is a union of Dairy’s Core runtime extensions and a number of utilities
that depend upon it, or the android platform.
Once Core is installed, you must not use
sleep
or similar blocking code
(like while loops) to structure LinearOpMode
autonomous code. Instead, write
‘asynchronous polled’ friendly code. This style of code take the form of update
functions that get run (polled) every loop, and does not block the loop
(asynchronous). This must not be done in OpMode
either, but this is much
harder to do in OpMode
. Feature
s rely on the hooks running, and you lose
many of the benefits of Dairy, or may cause undefined / unexpected behaviourFeatures:
Feature
s are components that have hooks into the OpMode runtime.- The
Dependency
system allowsFeature
s to declare the conditions that need to be met for them to be attached to an OpMode, whether this is an annotation or anotherFeature
. Controller
s have support for systems like PID controllers, or MotionProfiles, that update in the background of your OpMode.OpModeLazyCell
allows you to separate out your hardware access into several functions.- OpMode templating via
OpModeLazyCell
and the enhanced Dairy runtime, an improved alternative to aRobotHardware
class. EnhancedDoubleSupplier
s andEnhancedBooleanSupplier
s that rely on the Dairy runtime to automatically provide additional utilities.- A unit test runtime currently suitable for testing libraries that use Dairy, hopefully later suitable for testing user code.
Installation:
Core bundles a copy of Util and Sinister along with itself, however, those
libraries may have newer updates than the current version of Core, so check if
you need to install them separately.
Currently Util is ahead of Core, you must install it separately.
- Repository
This only needs to be done once, if you already have this, no need to add it
again.
TeamCode
’s build.gradle
, above dependencies
.
- Implementation
dependencies
block:
- Sync