#pragma once #include "fgc/MtiProtocol.h" // ImuSample #include namespace fgc { // Abstraction over the orientation/inertial sensor (Xsens MTi). Implemented by // MtiImuSource (RS-232/UART binary stream) and MockImuSource (synthetic). Runs // on its own thread; start() must not block the control loop. class IImuSource { public: virtual ~IImuSource() = default; virtual void start() = 0; virtual void stop() = 0; // Whether a valid, recent reading is available. virtual bool connected() const = 0; // Latest reading, or nullopt if none/stale. virtual std::optional sample() = 0; // Device configuration read back during start-up (output mode/settings, // sample rate, identity, XKF scenario). nullopt if not yet known or the // backend cannot report it. virtual std::optional config() const { return std::nullopt; } }; } // namespace fgc