15#ifndef ROS2_CONTROL_DEMO_EXAMPLE_9__RRBOT_HPP_
16#define ROS2_CONTROL_DEMO_EXAMPLE_9__RRBOT_HPP_
22#include "hardware_interface/handle.hpp"
23#include "hardware_interface/hardware_info.hpp"
24#include "hardware_interface/system_interface.hpp"
25#include "hardware_interface/types/hardware_interface_return_values.hpp"
26#include "rclcpp/clock.hpp"
27#include "rclcpp/logger.hpp"
28#include "rclcpp/macros.hpp"
29#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
30#include "rclcpp_lifecycle/state.hpp"
32namespace ros2_control_demo_example_9
39 hardware_interface::CallbackReturn
on_init(
42 hardware_interface::CallbackReturn on_configure(
43 const rclcpp_lifecycle::State & previous_state)
override;
49 hardware_interface::CallbackReturn on_activate(
50 const rclcpp_lifecycle::State & previous_state)
override;
52 hardware_interface::CallbackReturn on_deactivate(
53 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;
71 rclcpp::Clock::SharedPtr
get_clock()
const {
return clock_; }
80 std::shared_ptr<rclcpp::Logger> logger_;
81 rclcpp::Clock::SharedPtr clock_;
84 std::vector<double> hw_commands_;
85 std::vector<double> hw_states_;
Virtual Class to implement when integrating a complex system into ros2_control.
Definition system_interface.hpp:85
hardware_interface::return_type write(const rclcpp::Time &time, const rclcpp::Duration &period) override
Write the current command values to the actuator.
Definition rrbot.cpp:208
rclcpp::Clock::SharedPtr get_clock() const
Get the clock of the SystemInterface.
Definition rrbot.hpp:71
std::vector< hardware_interface::StateInterface > export_state_interfaces() override
Exports all state interfaces for this hardware interface.
Definition rrbot.cpp:118
std::vector< hardware_interface::CommandInterface > export_command_interfaces() override
Exports all command interfaces for this hardware interface.
Definition rrbot.cpp:132
rclcpp::Logger get_logger() const
Get the logger of the SystemInterface.
Definition rrbot.hpp:65
hardware_interface::CallbackReturn on_init(const hardware_interface::HardwareInfo &info) override
Initialization of the hardware interface from data parsed from the robot's URDF.
Definition rrbot.cpp:31
hardware_interface::return_type read(const rclcpp::Time &time, const rclcpp::Duration &period) override
Read the current state values from the actuator.
Definition rrbot.cpp:187
This structure stores information about hardware defined in a robot's URDF.
Definition hardware_info.hpp:106