54 ADMITTANCE_CONTROLLER_PUBLIC
55 controller_interface::CallbackReturn
on_init()
override;
62 ADMITTANCE_CONTROLLER_PUBLIC
70 ADMITTANCE_CONTROLLER_PUBLIC
73 ADMITTANCE_CONTROLLER_PUBLIC
74 controller_interface::CallbackReturn on_configure(
75 const rclcpp_lifecycle::State & previous_state)
override;
77 ADMITTANCE_CONTROLLER_PUBLIC
78 controller_interface::CallbackReturn on_activate(
79 const rclcpp_lifecycle::State & previous_state)
override;
81 ADMITTANCE_CONTROLLER_PUBLIC
82 controller_interface::CallbackReturn on_deactivate(
83 const rclcpp_lifecycle::State & previous_state)
override;
85 ADMITTANCE_CONTROLLER_PUBLIC
86 controller_interface::CallbackReturn on_cleanup(
87 const rclcpp_lifecycle::State & previous_state)
override;
89 ADMITTANCE_CONTROLLER_PUBLIC
90 controller_interface::CallbackReturn on_error(
91 const rclcpp_lifecycle::State & previous_state)
override;
93 ADMITTANCE_CONTROLLER_PUBLIC
95 const rclcpp::Time & time,
const rclcpp::Duration & period)
override;
102 size_t num_joints_ = 0;
103 std::vector<std::string> command_joint_names_;
108 template <
typename T>
109 using InterfaceReferences = std::vector<std::vector<std::reference_wrapper<T>>>;
111 InterfaceReferences<hardware_interface::LoanedCommandInterface> joint_command_interface_;
112 InterfaceReferences<hardware_interface::LoanedStateInterface> joint_state_interface_;
114 bool has_position_state_interface_ =
false;
115 bool has_velocity_state_interface_ =
false;
116 bool has_acceleration_state_interface_ =
false;
117 bool has_position_command_interface_ =
false;
118 bool has_velocity_command_interface_ =
false;
119 bool has_acceleration_command_interface_ =
false;
120 bool has_effort_command_interface_ =
false;
124 const std::vector<std::string> allowed_interface_types_ = {
129 const std::vector<std::string> allowed_reference_interfaces_types_ = {
131 std::vector<std::reference_wrapper<double>> position_reference_;
132 std::vector<std::reference_wrapper<double>> velocity_reference_;
135 std::unique_ptr<admittance_controller::AdmittanceRule> admittance_;
138 std::unique_ptr<semantic_components::ForceTorqueSensor> force_torque_sensor_;
141 rclcpp::Subscription<trajectory_msgs::msg::JointTrajectoryPoint>::SharedPtr
142 input_joint_command_subscriber_;
143 rclcpp::Publisher<control_msgs::msg::AdmittanceControllerState>::SharedPtr s_publisher_;
146 std::shared_ptr<admittance_controller::ParamListener> parameter_handler_;
149 std::shared_ptr<trajectory_msgs::msg::JointTrajectoryPoint> joint_command_msg_;
153 input_joint_command_;
154 std::unique_ptr<realtime_tools::RealtimePublisher<ControllerStateMsg>> state_publisher_;
156 trajectory_msgs::msg::JointTrajectoryPoint last_commanded_;
157 trajectory_msgs::msg::JointTrajectoryPoint last_reference_;
164 trajectory_msgs::msg::JointTrajectoryPoint reference_, joint_state_, reference_admittance_;
165 geometry_msgs::msg::Wrench ft_values_;
172 trajectory_msgs::msg::JointTrajectoryPoint & state_current,
173 geometry_msgs::msg::Wrench & ft_values);