bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
mqtt_ultrasound_backend.h
Go to the documentation of this file.
1#ifndef MQTT_ULTRASOUND_BACKEND_H
2#define MQTT_ULTRASOUND_BACKEND_H
3
4#include "bitrl/bitrl_config.h"
5
6#ifdef BITRL_MQTT
7
8#include "bitrl/bitrl_types.h"
12
13namespace bitrl{
14namespace sensors::backends
15{
16
24class MQTT_UltrasonicBackend: public RangeSensorBackendBase
25{
26public:
27
31 static const std::string BACKEND_TYPE;
32
36 explicit MQTT_UltrasonicBackend(network::MqttSubscriber& subscriber);
37
55 void load_from_json(const std::string& filename);
56
61 std::vector<real_t> read_values();
62
67 void set_position(const RealColVec3d& pos){position_ = pos;}
68
72 const RealColVec3d& position() const{return position_;}
73
77 const UltrasoundMessage& last_value_read()const{return last_message_;}
78
79private:
80
85 network::MqttSubscriber* subscriber_ptr_;
86
90 RealColVec3d position_;
91
95 UltrasoundMessage last_message_;
96
100 uint_t polling_time_milli{3000};
101
102};
103
104}
105}
106#endif
107#endif //MQTT_ULTRASOUND_BACKEND_H
Definition bitrl_consts.h:14
Eigen::Vector3d RealColVec3d
3D column vector
Definition bitrl_types.h:115
std::size_t uint_t
uint_t
Definition bitrl_types.h:43