Commit 24da514b authored by Florent Lamiraux's avatar Florent Lamiraux Committed by Florent Lamiraux florent@laas.fr
Browse files

In urdf parser, throw exception if file is not retrieved.

parent ad6a6791
......@@ -154,7 +154,10 @@ namespace hpp {
std::string urdfPath =
"package://" + package + "/urdf/" + urdfName + ".urdf";
std::string urdfFileName = se3::retrieveResourcePath(urdfPath, baseDirs);
if (urdfFileName == "") {
throw std::invalid_argument (std::string ("Unable to retrieve ") +
urdfPath);
}
Model& model = robot->model();
const JointIndex idFirstJoint = model.joints.size();
const FrameIndex idFirstFrame = model.frames.size();
......@@ -175,6 +178,10 @@ namespace hpp {
std::string srdfPath =
"package://" + package + "/srdf/" + srdfName + ".srdf";
std::string srdfFileName = se3::retrieveResourcePath(srdfPath, baseDirs);
if (srdfFileName == "") {
throw std::invalid_argument (std::string ("Unable to retrieve ") +
srdfPath);
}
se3::srdf::removeCollisionPairsFromSrdf
(model, geomModel, srdfFileName, verbose);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment