Go to the documentation of this file.
27 "gripper",
"gui",
"heightmap",
"image",
"mesh",
"plane",
"plugin",
28 "polyline",
"pose",
"sdf",
"sphere",
"texture",
"track_visual",
"wind",
32 "gravity",
"height",
"inherit_yaw",
"length",
"linear_velocity",
33 "magnetic_field",
"max_dist",
"min_dist",
"min_height",
"name",
34 "normal",
"pos",
"pose",
"pressure",
"projection_type",
"radius",
35 "sampling",
"size",
"static",
"temperature",
"temperature_gradient",
36 "type",
"uri",
"use_model_frame",
"view_controller",
"xyz" };
53 already_printed.
insert(element_name);
54 std::cout <<
"Element: '" << element_name <<
"' not in SDF ARRAY or MAP list. Will return MAP as Node type." <<
std::endl;
66 if (element.FirstChildElement() ==
nullptr)
82 if (node_type ==
ARRAY)
91 for (
const tinyxml2::XMLAttribute* attribute = element.FirstAttribute(); attribute !=
nullptr; attribute = attribute->Next())
97 for(
const tinyxml2::XMLElement* e = element.FirstChildElement(); e !=
nullptr; e = e->NextSiblingElement())
107 error <<
"Could not write or read array: " << candidate_name;
116 error <<
"Error parsing " << candidate_name;
122 if (candidate_node_type ==
ARRAY)
126 if (node_type ==
ARRAY)
140 const tinyxml2::XMLElement* root = doc.FirstChildElement();
142 if (root->NextSibling() !=
nullptr)
154 tinyxml2::XMLDocument doc;
156 stream >> stream_string;
157 doc.Parse(stream_string.c_str());
162 error << doc.ErrorStr() <<
" at line " << doc.ErrorLineNum();
173 tinyxml2::XMLDocument doc;
174 doc.Parse(
string.c_str());
179 error << doc.ErrorStr() <<
" at line" << doc.ErrorLineNum();
196 error <<
"[loadFromSDFFile] file '" << filename <<
"' doesn't exist." <<
std::endl;
202 tinyxml2::XMLDocument doc;
203 doc.LoadFile(filename.
c_str());
207 error <<
"Error loading " << filename <<
": ";
208 error << doc.ErrorStr() <<
" at line " << doc.ErrorLineNum();
bool loadFromSDFElement(const tinyxml2::XMLElement &element, ReaderWriter &config, const NodeType node_type)
bool loadFromSDFString(const std::string &string, ReaderWriter &config)
loadFromSDFString loads a sdf string into a ReaderWriter class
static const std::set< std::string > SDF_MAP_SET
bool loadFromXMLText(const tinyxml2::XMLElement &element, ReaderWriter &config)
loadFromXMLText writes a value from xml element into config object. Stored as double,...
void setSource(const std::string &source)
setSource set the source file of the data in this object
bool endArrayItem()
endArrayItem go back to the array level
bool writeArray(const std::string &name)
writeArray starts writing an array. Or start extending it, if it already exists.
bool loadFromSDFDocument(const tinyxml2::XMLDocument &doc, ReaderWriter &config)
bool writeGroup(const std::string &name)
writeGroup starts writing a group. Or start extending it, if it already exists.
bool addArrayItem()
addArrayItem create a new item in the array
static const std::set< std::string > SDF_VALUE_SET
bool endGroup()
endGroup go to the parrent of current group, wrapping end() for readbility
bool setValue(const std::string &key, const std::string &value, ReaderWriter &config)
setValue sets the value as a double, int or string
bool loadFromSDFFile(const std::string &filename, ReaderWriter &config)
loadFromSDFFile loads a sdf file into a ReaderWriter class
bool endArray()
endArray go to parrent of current array, wrapping end() for readibility
bool loadFromSDFStream(std::istream &stream, ReaderWriter &config)
loadFromSDFStream loads a sdf stream into a ReaderWriter class
void addError(const std::string &msg)
tue::config::NodeType getSDFNodeType(const std::string &element_name)
static const std::set< std::string > SDF_ARRAY_SET
tue::config::ReaderWriter config