1 #ifndef OCRA_UTIL_XML_UTILITIES 2 #define OCRA_UTIL_XML_UTILITIES 15 std::string dispString;
19 std::vector<std::string> dispAttributes;
21 dispAttributes.push_back(
"x");
22 dispAttributes.push_back(
"y");
23 dispAttributes.push_back(
"z");
24 dispAttributes.push_back(
"qw");
25 dispAttributes.push_back(
"qx");
26 dispAttributes.push_back(
"qy");
27 dispAttributes.push_back(
"qz");
29 for (
auto attribute : dispAttributes)
31 bool haveAlreadyFoundValue =
false;
32 for (TiXmlAttribute* xmlAttrib=xmlElem->FirstAttribute(); xmlAttrib != NULL; xmlAttrib = xmlAttrib->Next())
34 if ( (attribute == xmlAttrib->Name()) && (!haveAlreadyFoundValue) )
36 dispString += xmlAttrib->Value();
38 haveAlreadyFoundValue =
true;
41 if (!haveAlreadyFoundValue) {
42 std::string fallbackString =
"0.0 ";
43 if (attribute ==
"qw") {
44 fallbackString =
"1.0 ";
46 dispString += fallbackString;
58 #endif // OCRA_UTIL_XML_UTILITIES Optimization-based Robot Controller namespace. a library of classes to write and solve optimization p...
std::string getDisplacementArgs(TiXmlElement *xmlElem)