15#ifndef ROS2_CONTROL_DEMO_EXAMPLE_7__R6BOT_HARDWARE_HPP_
16#define ROS2_CONTROL_DEMO_EXAMPLE_7__R6BOT_HARDWARE_HPP_
19#include "unordered_map"
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 "hardware_interface/types/hardware_interface_type_values.hpp"
28using hardware_interface::return_type;
30namespace ros2_control_demo_example_7
32using CallbackReturn = rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn;
43 return_type
read(
const rclcpp::Time & time,
const rclcpp::Duration & period)
override;
45 return_type
write(
const rclcpp::Time & ,
const rclcpp::Duration & )
override;
50 std::vector<double> joint_velocities_command_;
51 std::vector<double> joint_position_;
52 std::vector<double> joint_velocities_;
53 std::vector<double> ft_states_;
54 std::vector<double> ft_command_;
56 std::unordered_map<std::string, std::vector<std::string>> joint_interfaces = {
57 {
"position", {}}, {
"velocity", {}}};
Definition system_interface.hpp:73
Definition r6bot_hardware.hpp:35
return_type read(const rclcpp::Time &time, const rclcpp::Duration &period) override
Read the current state values from the actuator.
Definition r6bot_hardware.cpp:101
std::vector< hardware_interface::CommandInterface > export_command_interfaces() override
Exports all command interfaces for this hardware interface.
Definition r6bot_hardware.cpp:75
return_type write(const rclcpp::Time &, const rclcpp::Duration &) override
Write the current command values to the actuator.
Definition r6bot_hardware.cpp:119
std::vector< hardware_interface::StateInterface > export_state_interfaces() override
Exports all state interfaces for this hardware interface.
Definition r6bot_hardware.cpp:49
std::vector< double > joint_position_command_
The size of this vector is (standard_interfaces_.size() x nr_joints).
Definition r6bot_hardware.hpp:49
CallbackReturn on_init(const hardware_interface::HardwareInfo &info) override
Initialization of the hardware interface from data parsed from the robot's URDF.
Definition r6bot_hardware.cpp:21
This structure stores information about hardware defined in a robot's URDF.
Definition hardware_info.hpp:107