57 #include <kdl_parser/model.h> 58 #include <urdf_parser/urdf_parser.h> 64 #include <core/exceptions/system.h> 65 #include <kdl_parser/exceptions.h> 71 static bool IsColladaData(
const std::string& data)
73 return data.find(
"<COLLADA") != std::string::npos;
89 bool Model::initFile(
const std::string& filename)
93 std::string xml_string;
94 std::fstream xml_file(filename.c_str(), std::fstream::in);
95 if (xml_file.is_open())
97 while ( xml_file.good() )
100 std::getline( xml_file, line);
101 xml_string += (line +
"\n");
104 return Model::initString(xml_string);
117 bool Model::initXml(TiXmlDocument *xml_doc)
124 std::stringstream ss;
127 return Model::initString(ss.str());
134 bool Model::initXml(TiXmlElement *robot_xml)
141 std::stringstream ss;
144 return Model::initString(ss.str());
152 bool Model::initString(
const std::string& xml_string)
154 boost::shared_ptr<ModelInterface> model;
156 if( IsColladaData(xml_string) ) {
161 model = parseURDF(xml_string);
166 this->links_ = model->links_;
167 this->joints_ = model->joints_;
168 this->materials_ = model->materials_;
169 this->name_ = model->name_;
170 this->root_link_ = model->root_link_;
File could not be opened.
Fawkes library namespace.
Tried to to parse Collada data which is not supported.
Failed to parse XML Element.
Failed to parse XML Document.