48 inline std::string enumerateElements(
const T& val,
49 const std::string& delimiter,
50 const std::string& prefix,
51 const std::string& suffix)
54 if (val.empty()) {
return ret;}
56 const std::string sdp = suffix+delimiter+prefix;
59 std::copy(val.begin(), val.end(), std::ostream_iterator<typename T::value_type>(ss, sdp.c_str()));
61 if (!ret.empty()) {ret.erase(ret.size() - delimiter.size() - prefix.size());}
69 T* hw = robot_hw->
get<T>();
72 const std::string hw_name = hardware_interface::internal::demangledTypeName<T>();
73 ROS_ERROR_STREAM(
"This controller requires a hardware interface of type '" << hw_name <<
"', " <<
74 "but is not exposed by the robot. Available interfaces in robot:\n" <<
75 enumerateElements(robot_hw->
getNames(),
"\n",
"- '",
"'"));
81 template <
typename T1,
typename T2,
typename... More>
84 return hasInterfaces<T1>(robot_hw) && hasInterfaces<T2, More...>(robot_hw);
91 T* hw = robot_hw->
get<T>();
98 template <
typename T1,
typename T2,
typename... More>
101 clearClaims<T1>(robot_hw);
102 clearClaims<T2, More...>(robot_hw);
106 template <
typename T>
110 T* hw = robot_hw_in->
get<T>();
114 template <
typename T1,
typename T2,
typename... More>
118 extractInterfaceResources<T1>(robot_hw_in, robot_hw_out);
119 extractInterfaceResources<T2, More...>(robot_hw_in, robot_hw_out);
123 template <
typename T>
127 T* hw = robot_hw->
get<T>();
133 claimed_resources.push_back(iface_res);
137 template <
typename T1,
typename T2,
typename... More>
141 populateClaimedResources<T1>(robot_hw, claimed_resources);
142 populateClaimedResources<T2, More...>(robot_hw, claimed_resources);
void registerInterface(T *iface)
std::set< std::string > resources
std::vector< hardware_interface::InterfaceResources > ClaimedResources
std::vector< std::string > getNames() const
#define ROS_ERROR_STREAM(args)
std::string hardware_interface