24 template <
template <
typename>
class Reader>
29 using ReaderType = Reader<Message::Encoder>;
39 int32_t offsetCount{};
47 : reader(
std::move(reader))
49 , direction(direction)
60 if (
const auto countOpt = reader.getMessage())
62 count = countOpt->count * (direction ? 1 : -1);
67 deltaCount = curr - prev;
76 offsetCount = count - value;
83 return count - offsetCount;
変化時間計測クラス
Definition DeltaTime.hpp:16
double getDeltaTimeS() const
経過時間を取得
Definition DeltaTime.hpp:48
DeltaTime & update()
更新
Definition DeltaTime.hpp:32
通信経由ロータリーエンコーダー
Definition Encoder.hpp:26
void update()
更新
Definition Encoder.hpp:54
EncoderBy(ReaderType &&reader, bool direction)
コンストラクタ
Definition Encoder.hpp:46
int32_t getCount() const
カウント値を取得
Definition Encoder.hpp:81
void setOffset(int32_t value=0)
カウント値オフセット
Definition Encoder.hpp:74
int32_t getDeltaCount() const
カウント値の差分を取得
Definition Encoder.hpp:88
double getSpeed() const
速度を取得
Definition Encoder.hpp:95
void MaybeInvokeUpdate(HasMemberFunctionUpdate &rhs)
T に T::update 関数が存在する場合呼び出す。それ以外の場合何もしない。
Definition HasMemberFunction.hpp:111
Definition Typedef.hpp:94
送信クラスであるか判定
Definition ReaderWriterTraits.hpp:42