15 #ifndef HARDWARE_INTERFACE__SYSTEM_HPP_
16 #define HARDWARE_INTERFACE__SYSTEM_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 "hardware_interface/visibility_control.h"
27 #include "rclcpp/duration.hpp"
28 #include "rclcpp/logger.hpp"
29 #include "rclcpp/node_interfaces/node_clock_interface.hpp"
30 #include "rclcpp/time.hpp"
31 #include "rclcpp_lifecycle/state.hpp"
35 class SystemInterface;
42 HARDWARE_INTERFACE_PUBLIC
43 explicit System(std::unique_ptr<SystemInterface> impl);
45 HARDWARE_INTERFACE_PUBLIC
50 HARDWARE_INTERFACE_PUBLIC
51 const rclcpp_lifecycle::State & initialize(
53 rclcpp::node_interfaces::NodeClockInterface::SharedPtr clock_interface);
55 HARDWARE_INTERFACE_PUBLIC
56 const rclcpp_lifecycle::State & configure();
58 HARDWARE_INTERFACE_PUBLIC
59 const rclcpp_lifecycle::State & cleanup();
61 HARDWARE_INTERFACE_PUBLIC
62 const rclcpp_lifecycle::State & shutdown();
64 HARDWARE_INTERFACE_PUBLIC
65 const rclcpp_lifecycle::State & activate();
67 HARDWARE_INTERFACE_PUBLIC
68 const rclcpp_lifecycle::State & deactivate();
70 HARDWARE_INTERFACE_PUBLIC
71 const rclcpp_lifecycle::State & error();
73 HARDWARE_INTERFACE_PUBLIC
74 std::vector<StateInterface::ConstSharedPtr> export_state_interfaces();
76 HARDWARE_INTERFACE_PUBLIC
77 std::vector<CommandInterface::SharedPtr> export_command_interfaces();
79 HARDWARE_INTERFACE_PUBLIC
80 return_type prepare_command_mode_switch(
81 const std::vector<std::string> & start_interfaces,
82 const std::vector<std::string> & stop_interfaces);
84 HARDWARE_INTERFACE_PUBLIC
85 return_type perform_command_mode_switch(
86 const std::vector<std::string> & start_interfaces,
87 const std::vector<std::string> & stop_interfaces);
89 HARDWARE_INTERFACE_PUBLIC
90 std::string get_name()
const;
92 HARDWARE_INTERFACE_PUBLIC
93 std::string get_group_name()
const;
95 HARDWARE_INTERFACE_PUBLIC
96 const rclcpp_lifecycle::State & get_lifecycle_state()
const;
98 HARDWARE_INTERFACE_PUBLIC
99 const rclcpp::Time & get_last_read_time()
const;
101 HARDWARE_INTERFACE_PUBLIC
102 const rclcpp::Time & get_last_write_time()
const;
104 HARDWARE_INTERFACE_PUBLIC
105 return_type read(
const rclcpp::Time & time,
const rclcpp::Duration & period);
107 HARDWARE_INTERFACE_PUBLIC
108 return_type write(
const rclcpp::Time & time,
const rclcpp::Duration & period);
110 HARDWARE_INTERFACE_PUBLIC
111 std::recursive_mutex & get_mutex();
114 std::unique_ptr<SystemInterface> impl_;
115 mutable std::recursive_mutex system_mutex_;
117 rclcpp::Time last_read_cycle_time_;
119 rclcpp::Time last_write_cycle_time_;
Definition: system.hpp:38
Definition: actuator.hpp:34
This structure stores information about hardware defined in a robot's URDF.
Definition: hardware_info.hpp:170