2222#include " hardware_interface/macros.hpp"
2323#include " hardware_interface/visibility_control.h"
2424
25+ #include " controller_manager_msgs/msg/interface_data.hpp"
2526#include " rclcpp/rclcpp.hpp"
2627#include " rclcpp_lifecycle/lifecycle_node.hpp"
2728#include " std_msgs/msg/float64.hpp"
@@ -207,7 +208,7 @@ class DistributedReadOnlyHandle : public ReadOnlyHandle
207208 false );
208209 }
209210 // subscribe to topic provided by StatePublisher
210- state_value_sub_ = node_->create_subscription <std_msgs ::msg::Float64 >(
211+ state_value_sub_ = node_->create_subscription <controller_manager_msgs ::msg::InterfaceData >(
211212 get_value_topic_name_, 10 ,
212213 std::bind (&DistributedReadOnlyHandle::get_value_cb, this , std::placeholders::_1));
213214 }
@@ -251,7 +252,7 @@ class DistributedReadOnlyHandle : public ReadOnlyHandle
251252 }
252253
253254protected:
254- void get_value_cb (const std_msgs ::msg::Float64 & msg)
255+ void get_value_cb (const controller_manager_msgs ::msg::InterfaceData & msg)
255256 {
256257 value_ = msg.data ;
257258 RCLCPP_DEBUG_STREAM (node_->get_logger (), " Receiving:[" << value_ << " ]." );
@@ -263,7 +264,7 @@ class DistributedReadOnlyHandle : public ReadOnlyHandle
263264 // the namespace the actual StateInterface we subscribe to is in.
264265 // We need this to create unique names for the StateInterface.
265266 std::string interface_namespace_;
266- rclcpp::Subscription<std_msgs ::msg::Float64 >::SharedPtr state_value_sub_;
267+ rclcpp::Subscription<controller_manager_msgs ::msg::InterfaceData >::SharedPtr state_value_sub_;
267268 double value_;
268269};
269270
0 commit comments