12 #include <ignition/math.hh>
14 #include <boost/foreach.hpp>
27 std::string trial_link =
graph.mapOfLinks.begin()->first;
28 bool search_for_parent =
true;
29 while (search_for_parent)
31 const std::vector<std::string> & parents_of_links =
32 graph.parentOfLinks.find(trial_link)->second;
33 if (parents_of_links.size() == 0)
35 search_for_parent =
false;
40 ::sdf::ElementPtr joint_element =
graph.mapOfJoints.find(parents_of_links[0])->second;
41 trial_link = joint_element->GetElement(
"parent")->template Get<std::string>();
44 return std::string(
"");
48 const SdfGraph &
graph,
49 const urdf::details::UrdfVisitorBase & visitor,
54 SdfGraph::ContactDetails)::const_iterator
cm = std::cbegin(
graph.contact_details);
55 cm != std::cend(
graph.contact_details); ++
cm)
59 const SE3 & cMj =
graph.childPoseMap.find(
cm->name)->second;
72 const ::sdf::ElementPtr rootLinkElement =
graph.mapOfLinks.find(rootLinkName)->second;
73 const ::sdf::ElementPtr inertialElem = rootLinkElement->GetElement(
"inertial");
75 graph.urdfVisitor.addRootJoint(convertInertiaFromSdf(inertialElem), rootLinkName);
76 const std::vector<std::string> & childrenOfLink =
77 graph.childrenOfLinks.find(rootLinkName)->second;
78 for (std::vector<std::string>::const_iterator childOfChild = std::begin(childrenOfLink);
79 childOfChild != std::end(childrenOfLink); ++childOfChild)
81 graph.recursiveFillModel(
graph.mapOfJoints.find(*childOfChild)->second);