Introduction
NextFTC has a few motor and servo wrappers to make your life easier. There are three interfaces:
Powerablehas a power that can be get and set.Positionablehas a position that can be get and set. The position in aPositionablecan be directly set (e.g., the target position), like in a servo.Controllable, which extendsPowerable, has a current position and velocity.
The interfaces, along with the commands, are in the hardware module. The implementations are in the ftc module, which has a compile-only dependency on the hardware module.
All implementations, such as MotorEx and ServoEx, take a supplier that is lazily evaluated instead of directly taking the hardware to wrap. This allows you to construct it on construction of your OpMode/subsystem instead of waiting until init.
Additionally, all implementations implement caching on all writes with a configurable cache tolerance that defaults to 0.01.