25 #include "urdf_parser/urdf_parser.h" 26 #include "urdf_model/model.h" 27 #include "urdf_model/joint.h" 28 #include <boost/foreach.hpp> 29 #include <boost/algorithm/string/predicate.hpp> 48 const std::set<std::string> hand_default_joints(default_hand_joints_vector.begin(),
49 default_hand_joints_vector.end());
50 std::string robot_description;
52 const urdf::ModelInterfaceSharedPtr hand_urdf = urdf::parseURDF(robot_description);
54 std::pair<std::string, urdf::JointSharedPtr> joint;
55 BOOST_FOREACH(joint, hand_urdf->joints_)
57 const std::string joint_name = joint.first;
58 if ((urdf::Joint::FIXED != joint.second->type) &&
59 (hand_default_joints.end() == hand_default_joints.find(joint_name)))
61 bool found_suffix =
false;
62 BOOST_FOREACH(std::string default_joint_name, hand_default_joints)
64 if (boost::ends_with(joint_name, default_joint_name))
73 std::pair<std::string, std::string> hand;
76 const std::string hand_serial = hand.first;
77 const std::string hand_id = hand.second;
82 joints_[hand_id].push_back(joint_name);
91 ROS_WARN_STREAM(
"No robot_description found on parameter server. Assuming that there is no arm.");
std::map< std::string, std::string > joint_prefix_
ArmConfig get_arm_parameters()
static const std::vector< std::string > get_default_joints()
ROSCPP_DECL bool get(const std::string &key, std::string &s)
ROSCPP_DECL bool has(const std::string &key)
#define ROS_WARN_STREAM(args)
std::map< std::string, std::string > mapping_
std::map< std::string, std::vector< std::string > > joints_
#define ROS_ERROR_STREAM(args)
std::map< std::string, std::vector< std::string > > get_joints()