34 std::vector<std::string> pos_joints;
35 if (!n.
getParam(
"position_joints", pos_joints)) {
return false;}
37 std::vector<std::string> eff_joints;
38 if (!n.
getParam(
"effort_joints", eff_joints)) {
return false;}
46 PosIface* pos_iface = robot_hw->
get<PosIface>();
47 EffIface* eff_iface = robot_hw->
get<EffIface>();
52 for (
const auto& pos_joint : pos_joints)
54 pos_cmd_.push_back(pos_iface->getHandle(pos_joint));
59 ROS_WARN(
"Optional interface not found: 'hardware_interface::PositionJointInterface'");
64 for (
const auto& eff_joint : eff_joints)
66 eff_cmd_.push_back(eff_iface->getHandle(eff_joint));
71 ROS_ERROR(
"Required interface not found: 'hardware_interface::EffortJointInterface'");
80 ROS_INFO(
"Starting PosEffOptController");
88 ROS_INFO(
"Stopping PosEffOptController");