71 CONTROLLER_INTERFACE_PUBLIC
74 CONTROLLER_INTERFACE_PUBLIC
77 CONTROLLER_INTERFACE_PUBLIC
80 CONTROLLER_INTERFACE_PUBLIC
83 CONTROLLER_INTERFACE_PUBLIC
84 void assign_interfaces(
85 std::vector<hardware_interface::LoanedCommandInterface> && command_interfaces,
86 std::vector<hardware_interface::LoanedStateInterface> && state_interfaces);
88 CONTROLLER_INTERFACE_PUBLIC
89 void release_interfaces();
91 CONTROLLER_INTERFACE_PUBLIC
92 virtual LifecycleNodeInterface::CallbackReturn on_init() = 0;
94 CONTROLLER_INTERFACE_PUBLIC
95 virtual return_type init(
const std::string & controller_name);
97 CONTROLLER_INTERFACE_PUBLIC
98 virtual return_type update(
const rclcpp::Time & time,
const rclcpp::Duration & period) = 0;
100 CONTROLLER_INTERFACE_PUBLIC
101 std::shared_ptr<rclcpp::Node> get_node();
110 template <
typename ParameterT>
111 auto auto_declare(
const std::string & name,
const ParameterT & default_value)
113 if (!node_->has_parameter(name))
115 return node_->declare_parameter<ParameterT>(name, default_value);
119 return node_->get_parameter(name).get_value<ParameterT>();
133 CONTROLLER_INTERFACE_PUBLIC
134 const rclcpp_lifecycle::State &
configure();
136 CONTROLLER_INTERFACE_PUBLIC
137 const rclcpp_lifecycle::State & cleanup();
139 CONTROLLER_INTERFACE_PUBLIC
140 const rclcpp_lifecycle::State & deactivate();
142 CONTROLLER_INTERFACE_PUBLIC
143 const rclcpp_lifecycle::State & activate();
145 CONTROLLER_INTERFACE_PUBLIC
146 const rclcpp_lifecycle::State & shutdown();
148 CONTROLLER_INTERFACE_PUBLIC
149 const rclcpp_lifecycle::State & get_state()
const;
151 CONTROLLER_INTERFACE_PUBLIC
152 unsigned int get_update_rate()
const;
155 std::vector<hardware_interface::LoanedCommandInterface> command_interfaces_;
156 std::vector<hardware_interface::LoanedStateInterface> state_interfaces_;
157 std::shared_ptr<rclcpp::Node> node_;
158 rclcpp_lifecycle::State lifecycle_state_;
159 unsigned int update_rate_ = 0;
auto auto_declare(const std::string &name, const ParameterT &default_value)
Declare and initialize a parameter with a type.
Definition controller_interface.hpp:111