|
Fang-Robotics-MCB
Fang Robotics Team Codebase
|
#include <multi_encoder.hpp>


Public Member Functions | |
| MultiEncoder (std::array< EncoderInterface *, COUNT > encoders) | |
| void | initialize () override |
| bool | isOnline () const override |
| tap::algorithms::WrappedFloat | getPosition () const override |
| float | getVelocity () const override |
| void | resetEncoderValue () override |
| void | alignWith (EncoderInterface *other) override |
A way to combine multiple encoders into one functional unit. The first encoder in the array must not be null, as it is the primary encoder. All other values can be null. This encoder uses the primary encoder as an initial source of truth. This allows the other encoders to align themselves to it, and then have the primary encoder disconnect with the system still working. This encoder is not valid until the primary encoder comes online, and stays online until either all synced encoders disconnect, or the primary encoder is offline and no other encoders have been synced. The positions returned by this encoder are averaged between all synced and online encoders.
|
inline |
|
inlineoverridevirtual |
Aligns this encoder to another encoder so that their positions are equal. If the two encoders are mechanically linked, they would then continue to report the same position.
Implements tap::encoder::EncoderInterface.
|
inlineoverridevirtual |
Gets the current position of the encoder, in a wrapped float on the range [0, M_TWOPI)
Implements tap::encoder::EncoderInterface.
|
inlineoverridevirtual |
Gets the current velocity reported by the encoder. Returned in a value of radians / second
Implements tap::encoder::EncoderInterface.
|
inlineoverridevirtual |
Initialize the encoder. For instance: attaching a can receiver.
Implements tap::encoder::EncoderInterface.
|
inlineoverridevirtual |
Returns true when the encoder is online and reporting valid values.
Implements tap::encoder::EncoderInterface.
|
inlineoverridevirtual |
Zeros the encoder to its current position. All encoder positions will be based from this position.
Implements tap::encoder::EncoderInterface.