15#ifndef MOCK_PENDULUM_HARDWARE__MOCK_PENDULUM_HARDWARE_HPP_
16#define MOCK_PENDULUM_HARDWARE__MOCK_PENDULUM_HARDWARE_HPP_
21#include "hardware_interface/handle.hpp"
22#include "hardware_interface/hardware_info.hpp"
23#include "hardware_interface/system_interface.hpp"
24#include "hardware_interface/types/hardware_interface_return_values.hpp"
25#include "rclcpp/macros.hpp"
26#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
27#include "rclcpp_lifecycle/state.hpp"
29namespace mock_pendulum_hardware
31using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn;
51 CallbackReturn on_init(
52 const hardware_interface::HardwareComponentInterfaceParams & params)
override;
58 CallbackReturn on_activate(
const rclcpp_lifecycle::State & previous_state)
override;
60 CallbackReturn on_deactivate(
const rclcpp_lifecycle::State & previous_state)
override;
62 hardware_interface::return_type
read(
63 const rclcpp::Time & time,
const rclcpp::Duration & period)
override;
65 hardware_interface::return_type
write(
66 const rclcpp::Time & time,
const rclcpp::Duration & period)
override;
70 std::vector<double> hw_states_;
72 std::vector<double> hw_commands_;
Virtual Class to implement when integrating a complex system into ros2_control.
Definition system_interface.hpp:68
virtual return_type read()=0
Read the current state values from the actuator.
virtual return_type write()=0
Write the current command values to the actuator.
Definition mock_pendulum_hardware.hpp:47
std::vector< hardware_interface::CommandInterface > export_command_interfaces() override
Exports all command interfaces for this hardware interface.
Definition mock_pendulum_hardware.cpp:70
std::vector< hardware_interface::StateInterface > export_state_interfaces() override
Exports all state interfaces for this hardware interface.
Definition mock_pendulum_hardware.cpp:60