10#ifndef _LOGIC_DISTRO_RP2040_DRIVER_HPP
11#define _LOGIC_DISTRO_RP2040_DRIVER_HPP
14#include <driver_msgs/msg/power_state.hpp>
15#include <driver_msgs/msg/system_switch.hpp>
17#include <proto_files/conversion_driver_msgs__PowerState.hpp>
18#include <proto_files/conversion_driver_msgs__SystemSwitch.hpp>
19#include <protolink/client.hpp>
20#include <rclcpp/rclcpp.hpp>
37 std::string mcu_ip_addr;
42 protolink::IoContext io_context_;
43 std::shared_ptr<protolink::serial_protocol::port> port_;
44 std::shared_ptr<protolink::udp_protocol::soket> sock_;
45 std::shared_ptr<timer::Timeout> timeout_;
48 using ProtoPowerState = protolink__driver_msgs__PowerState::driver_msgs__PowerState;
49 using ProtoSystemSwitch = protolink__driver_msgs__SystemSwitch::driver_msgs__SystemSwitch;
50 std::shared_ptr<protolink::udp_protocol::Publisher<ProtoPowerState>> protolink_publisher_udp_;
51 std::shared_ptr<protolink::serial_protocol::Publisher<ProtoSystemSwitch>> protolink_publisher_;
52 std::shared_ptr<protolink::serial_protocol::Subscriber<ProtoPowerState>> protolink_subscriber_;
54 rclcpp::Publisher<driver_msgs::msg::PowerState>::SharedPtr pub_;
55 rclcpp::Subscription<driver_msgs::msg::SystemSwitch>::SharedPtr sub_;
56 rclcpp::TimerBase::SharedPtr timer_;
58 void protolink_callback(
const ProtoPowerState & _msg);
59 void ros_callback(
const driver_msgs::msg::SystemSwitch & _msg);
61 void _check_timeout();
PowerState driver class.
Definition: logic_distro_rp2040_driver.hpp:30