Common
common packages for kyubic
 
Loading...
Searching...
No Matches
environment.hpp
Go to the documentation of this file.
1
10#ifndef _ENVIRONMENT_HPP
11#define _ENVIRONMENT_HPP
12
13#include <cstdint>
14#include <driver_msgs/msg/environment.hpp>
15#include <mutex>
16#include <proto_files/conversion_driver_msgs__Environment.hpp>
17#include <protolink/client.hpp>
18#include <rclcpp/rclcpp.hpp>
19#include <timer/timeout.hpp>
20
26{
27
31class Environment : public rclcpp::Node
32{
33public:
34 explicit Environment(const rclcpp::NodeOptions & options);
35
36private:
37 uint16_t sub_port;
38 uint64_t timeout_ms;
39
40 protolink::IoContext io_context_;
41 std::shared_ptr<protolink::udp_protocol::soket> sock_;
42 std::shared_ptr<timer::Timeout> timeout_;
43 std::mutex mutex_;
44
45 using ProtoEnvironment = protolink__driver_msgs__Environment::driver_msgs__Environment;
46 std::shared_ptr<protolink::udp_protocol::Subscriber<ProtoEnvironment>> protolink_subscriber_;
47
48 rclcpp::Publisher<driver_msgs::msg::Environment>::SharedPtr pub_;
49 rclcpp::TimerBase::SharedPtr timer_;
50
51 void protolink_callback(const ProtoEnvironment & _msg);
52};
53
54} // namespace driver::sensors_esp32_driver
55
56#endif
Environment class.
Definition: environment.hpp:32
driver for sensors_esp32
timeout library