1#ifndef BITSIM_SENSORS_BACKENDS_MQTT_IMU_BACKEND_H
2#define BITSIM_SENSORS_BACKENDS_MQTT_IMU_BACKEND_H
4#include "bitsim/bitsim_config.h"
58 void load(
const nlohmann::json &j)
override;
62 channel_.set_config(config);
82 bool receive(
const std::string &text);
84 bool is_alive()
const {
return channel_.is_alive(); }
91 bool accept_(
const std::string &text);
Definition mqtt_subscriber.h:24
IMUBackendBase(const std::string &backend_type)
Definition imu_backend_base.h:92
void connect()
Connect to the broker, unless the subscriber already is.
Definition mqtt_imu_backend.h:68
static const std::string BACKEND_TYPE
Definition mqtt_imu_backend.h:38
bool receive(const std::string &text)
Take one message, as read_values() does for each message that arrives. Use it to feed the backend wit...
Definition mqtt_imu_backend.cpp:40
const MQTT_SensorChannel & channel() const noexcept
Definition mqtt_imu_backend.h:86
std::vector< real_t > read_values() override
Take the readings that have arrived.
Definition mqtt_imu_backend.cpp:64
MQTT_IMUBackend()
A backend that subscribes on its own, see connect(). Give it a topic with set_channel_config() or loa...
Definition mqtt_imu_backend.cpp:18
const IMUMessage & last_value_read() const noexcept
Definition mqtt_imu_backend.h:88
void set_channel_config(const MQTT_SensorChannel::Config &config)
Definition mqtt_imu_backend.h:60
void load(const nlohmann::json &j) override
Read the settings, see IMUBackendBase::load(). Also reads broker, topic and timeout [s],...
Definition mqtt_imu_backend.cpp:31
bool is_alive() const
Definition mqtt_imu_backend.h:84
The topic a sensor on a board publishes its readings to.
Definition mqtt_sensor_channel.h:34
Definition camera_backend_base.h:19
Definition dc_motor_backend_base.h:9
Models a message from an inertial measurement unit with a three axis accelerometer and a three axis g...
Definition imu.h:31
Definition mqtt_sensor_channel.h:39