15#ifndef ZENBEDDED_HARDWARE_INTERFACE__ZENBEDDED_HARDWARE_HPP_
16#define ZENBEDDED_HARDWARE_INTERFACE__ZENBEDDED_HARDWARE_HPP_
24#include <realtime_tools/realtime_buffer.hpp>
26#include "hardware_interface/handle.hpp"
27#include "hardware_interface/hardware_info.hpp"
28#include "hardware_interface/system_interface.hpp"
29#include "hardware_interface/types/hardware_interface_return_values.hpp"
30#include "rclcpp/macros.hpp"
31#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
32#include "rclcpp_lifecycle/state.hpp"
33#include "zenbedded_schema/interface_schema.hpp"
37using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn;
51 CallbackReturn on_activate(
const rclcpp_lifecycle::State & previous_state)
override;
53 CallbackReturn on_deactivate(
const rclcpp_lifecycle::State & previous_state)
override;
55 hardware_interface::return_type
read(
56 const rclcpp::Time & time,
const rclcpp::Duration & period)
override;
58 hardware_interface::return_type
write(
59 const rclcpp::Time & time,
const rclcpp::Duration & period)
override;
62 std::unique_ptr<zenoh::Session> session_;
68 std::vector<uint8_t> command_buffer_;
71 std::unique_ptr<zenoh::Subscriber<void>> state_sub_;
72 std::unique_ptr<zenoh::Publisher> command_pub_;
74 std::vector<double> hw_commands_;
75 std::vector<double> hw_states_;
76 std::string zenoh_endpoint_;
77 std::string zenoh_mode_;
78 std::string state_topic_;
79 std::string command_topic_;
Virtual Class to implement when integrating a complex system into ros2_control.
Definition system_interface.hpp:67
Definition interface_schema.hpp:60
Definition zenbedded_hardware.hpp:40
std::vector< hardware_interface::StateInterface > export_state_interfaces() override
Exports all state interfaces for this hardware interface.
Definition zenbedded_hardware.cpp:83
std::vector< hardware_interface::CommandInterface > export_command_interfaces() override
Exports all command interfaces for this hardware interface.
Definition zenbedded_hardware.cpp:94
hardware_interface::return_type read(const rclcpp::Time &time, const rclcpp::Duration &period) override
Read the current state values from the hardware.
Definition zenbedded_hardware.cpp:153
CallbackReturn on_init(const hardware_interface::HardwareComponentInterfaceParams ¶ms) override
Initialization of the hardware interface from data parsed from the robot's URDF.
Definition zenbedded_hardware.cpp:30
hardware_interface::return_type write(const rclcpp::Time &time, const rclcpp::Duration &period) override
Write the current command values to the hardware.
Definition zenbedded_hardware.cpp:167
Parameters required for the initialization of a specific hardware component plugin....
Definition hardware_component_interface_params.hpp:32