From d0a8ac7ae9bd2e1c3da3f581016e079744bf0659 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 08:53:58 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/urdf-parser.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) 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));