diff --git a/src/urdf-parser.cpp b/src/urdf-parser.cpp index 0336465..ccdffae 100644 --- a/src/urdf-parser.cpp +++ b/src/urdf-parser.cpp @@ -116,31 +116,30 @@ void setShowVisuals(GroupNode* gn, bool visual) { QStringList rosPackagePath() { const QString rosPathVar(qgetenv("ROS_PACKAGE_PATH")); - if (rosPathVar.toStdString() != "") - return rosPathVar.split(':'); + if (rosPathVar.toStdString() != "") return rosPathVar.split(':'); const QString amentPrefixPath(qgetenv("AMENT_PREFIX_PATH")); - if (amentPrefixPath.toStdString() != ""){ + if (amentPrefixPath.toStdString() != "") { QStringList paths(amentPrefixPath.split(':')); QStringList res; - for (const auto &path : paths) { + for (const auto& path : paths) { res.append(path + QString("/share")); } return res; } - throw std::invalid_argument( - "neither ROS_PACKAGE_PATH nor AMENT_PREFIX_PATH environment variables is " - "defined."); + throw std::invalid_argument( + "neither ROS_PACKAGE_PATH nor AMENT_PREFIX_PATH environment variables is " + "defined."); } std::string getFilename(const QString& input) { if (input.startsWith("package://")) { QStringList rosPaths; - try{ + try { rosPaths = rosPackagePath(); - } catch (const std::invalid_argument& exc){ - throw std::invalid_argument(std::string("Input path: \"") + - input.toStdString() + std::string("\" starts with \"package://\", but ") - + exc.what()); + } catch (const std::invalid_argument& exc) { + throw std::invalid_argument( + std::string("Input path: \"") + input.toStdString() + + std::string("\" starts with \"package://\", but ") + exc.what()); } for (int i = 0; i < rosPaths.size(); ++i) { QFileInfo fileInfo(rosPaths[i] + '/' + input.right(input.size() - 10));