fwt_software/include/fgc/MtiImuSource.h

31 lines
867 B
C++

#pragma once
#include "fgc/IImuSource.h"
#include <memory>
#include <string>
namespace fgc {
// Real IMU backend: reads the Xsens MTi binary MTData stream over a serial port
// (RS-232 via the LattePanda UART). Configures the device to the Euler +
// calibrated output at startup, then streams read-only. Boost.Asio detail is
// hidden behind a pImpl (mirrors SerialMotorController).
class MtiImuSource : public IImuSource {
public:
MtiImuSource(std::string device, unsigned int baud);
~MtiImuSource() override;
void start() override;
void stop() override;
bool connected() const override;
std::optional<ImuSample> sample() override;
std::optional<ImuDeviceConfig> config() const override;
private:
struct Impl;
std::unique_ptr<Impl> impl_;
};
} // namespace fgc