29 #include <console_bridge/console.h>
41 const tinyxml2::XMLElement* srdf_xml,
42 const std::array<int, 3>& )
46 for (
const tinyxml2::XMLElement* xml_element = srdf_xml->FirstChildElement(
"disable_collisions");
47 xml_element !=
nullptr;
48 xml_element = xml_element->NextSiblingElement(
"disable_collisions"))
50 std::string link1_name, link2_name, reason;
52 if (status != tinyxml2::XML_SUCCESS)
53 std::throw_with_nested(std::runtime_error(
"DisabledCollisions: Missing or failed to parse attribute 'link1'!"));
56 if (status != tinyxml2::XML_SUCCESS)
57 std::throw_with_nested(std::runtime_error(
"DisabledCollisions: Missing or failed to parse attribute 'link2'!"));
59 if (!scene_graph.
getLink(link1_name))
61 CONSOLE_BRIDGE_logWarn(
"Link '%s' is not known to URDF. Cannot disable collisons.", link1_name.c_str());
64 if (!scene_graph.
getLink(link2_name))
66 CONSOLE_BRIDGE_logWarn(
"Link '%s' is not known to URDF. Cannot disable collisons.", link2_name.c_str());
72 if (status != tinyxml2::XML_NO_ATTRIBUTE && status != tinyxml2::XML_SUCCESS)
73 std::throw_with_nested(std::runtime_error(
"DisabledCollisions: Missing or failed to parse attribute 'reason'!"));