From 3036a6d2bc3eb738f75c99227fdcdf4d3f1121de Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sun, 26 Aug 2018 09:33:51 -0700 Subject: [PATCH] also drop 'model://' from URDF file names (like we drop package://) --- .../Importers/ImportURDFDemo/BulletUrdfImporter.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp b/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp index 48c451bf3..07094414c 100644 --- a/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp +++ b/examples/Importers/ImportURDFDemo/BulletUrdfImporter.cpp @@ -564,9 +564,13 @@ bool findExistingMeshFile( return false; } - std::string drop_it = "package://"; - if (fn.substr(0, drop_it.length())==drop_it) - fn = fn.substr(drop_it.length()); + std::string drop_it_pack = "package://"; + std::string drop_it_model = "model://"; + if (fn.substr(0, drop_it_pack.length())==drop_it_pack) + fn = fn.substr(drop_it_pack.length()); + else if (fn.substr(0, drop_it_model.length())==drop_it_model) + fn = fn.substr(drop_it_model.length()); + std::list shorter; shorter.push_back("../..");