move collada check into urdf model

This commit is contained in:
Wim Meeussen 2011-06-21 16:32:36 -07:00
parent 8a357ce772
commit 9ca784cf95
2 changed files with 4 additions and 26 deletions

View File

@ -2518,31 +2518,6 @@ namespace urdf{
}; };
bool urdfFromColladaFile(std::string const& daefilename, boost::shared_ptr<ModelInterface> model)
{
ColladaModelReader reader(model);
return reader.InitFromFile(daefilename);
}
bool urdfFromColladaData(std::string const& data, boost::shared_ptr<ModelInterface> model)
{
ColladaModelReader reader(model);
return reader.InitFromData(data);
}
bool IsColladaFile(const std::string& filename)
{
size_t len = filename.size();
if( len < 4 )
return false;
return filename[len-4] == '.' && ::tolower(filename[len-3]) == 'd' && ::tolower(filename[len-2]) == 'a' && ::tolower(filename[len-1]) == 'e';
}
bool IsColladaData(const std::string& data)
{
return data.find("<COLLADA") != std::string::npos;
}

View File

@ -43,7 +43,10 @@
namespace urdf{ namespace urdf{
bool IsColladaData(const std::string& data); bool IsColladaData(const std::string& data)
{
return data.find("<COLLADA") != std::string::npos;
}
bool Model::initFile(const std::string& filename) bool Model::initFile(const std::string& filename)