15 #ifndef ROS2_CONTROL_DEMO_EXAMPLE_10__GPIO_CONTROLLER_HPP_
16 #define ROS2_CONTROL_DEMO_EXAMPLE_10__GPIO_CONTROLLER_HPP_
22 #include "control_msgs/msg/interface_value.hpp"
23 #include "std_msgs/msg/float64_multi_array.hpp"
25 #include "controller_interface/controller_interface.hpp"
27 namespace ros2_control_demo_example_10
29 using CmdType = std_msgs::msg::Float64MultiArray;
40 controller_interface::return_type
update(
41 const rclcpp::Time & time,
const rclcpp::Duration & period)
override;
43 CallbackReturn on_configure(
const rclcpp_lifecycle::State & previous_state)
override;
45 CallbackReturn on_activate(
const rclcpp_lifecycle::State & previous_state)
override;
47 CallbackReturn on_deactivate(
const rclcpp_lifecycle::State & previous_state)
override;
49 CallbackReturn
on_init()
override;
52 std::vector<std::string> inputs_;
53 std::vector<std::string> outputs_;
59 std::shared_ptr<CmdType> output_cmd_ptr_;
62 std::shared_ptr<rclcpp::Publisher<control_msgs::msg::InterfaceValue>> gpio_publisher_;
63 control_msgs::msg::InterfaceValue gpio_msg_;
66 rclcpp::Subscription<CmdType>::SharedPtr subscription_command_;
Definition: controller_interface.hpp:28
Definition: gpio_controller.hpp:32
controller_interface::return_type update(const rclcpp::Time &time, const rclcpp::Duration &period) override
Definition: gpio_controller.cpp:54
controller_interface::InterfaceConfiguration state_interface_configuration() const override
Get configuration for controller's required state interfaces.
Definition: gpio_controller.cpp:45
CallbackReturn on_init() override
Extending interface with initialization method which is individual for each controller.
Definition: gpio_controller.cpp:21
controller_interface::InterfaceConfiguration command_interface_configuration() const override
Get configuration for controller's required command interfaces.
Definition: gpio_controller.cpp:36
Configuring what command/state interfaces to claim.
Definition: controller_interface_base.hpp:58