From 0d3e7055de9f39fb81343610d833ecf95e8a1193 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:46:07 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.5 → v0.6.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.5...v0.6.9) - [github.com/pre-commit/mirrors-clang-format: v18.1.8 → v19.1.1](https://github.com/pre-commit/mirrors-clang-format/compare/v18.1.8...v19.1.1) - [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) --- .pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 263f1be..ae52b97 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autoupdate_branch: devel repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.5 + rev: v0.6.9 hooks: - id: ruff args: @@ -19,13 +19,13 @@ repos: - id: toml-sort-fix exclude: poetry.lock - repo: https://github.com/pre-commit/mirrors-clang-format - rev: v18.1.8 + rev: v19.1.1 hooks: - id: clang-format args: - --style=Google - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-added-large-files - id: check-ast From 32c34d63777f3663cf13182b9007b62c58b23725 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 17:46:47 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- include/hpp/pinocchio/util.hh | 52 +++++++++++++++++------------------ src/joint.cc | 9 +++--- 2 files changed, 31 insertions(+), 30 deletions(-) diff --git a/include/hpp/pinocchio/util.hh b/include/hpp/pinocchio/util.hh index 57904d8..24976f2 100644 --- a/include/hpp/pinocchio/util.hh +++ b/include/hpp/pinocchio/util.hh @@ -126,32 +126,32 @@ std::ostream& operator<<(std::ostream& os, const PrettyPrint pp) { /// Generic implementation for Eigen objects template -struct HPP_PINOCCHIO_DLLAPI prettyPrintEigen { - static inline std::ostream& run(std::ostream& os, const Derived& M) { - enum { - Condensed = ((Option & OutputFormatBits) == OneLineOutput) || - ((Option & OutputFormatBits) == CondensedOutput) - }; - static const Eigen::IOFormat mfmt_py = - eigen_format::run(); - static const Eigen::IOFormat vfmt_py = - eigen_format::run(); - static const Eigen::IOFormat mfmt_raw = - eigen_format::run(); - static const Eigen::IOFormat vfmt_raw = - eigen_format::run(); - bool use_py_fmt = (getpythonformat(os) != 0); - const Eigen::IOFormat& fmt = - (Derived::IsVectorAtCompileTime ? (use_py_fmt ? vfmt_py : vfmt_raw) - : (use_py_fmt ? mfmt_py : mfmt_raw)); - bool transpose = (Derived::ColsAtCompileTime == 1); - - if (transpose) - return os << M.transpose().format(fmt); - else - return os << M.format(fmt); - } -}; +struct HPP_PINOCCHIO_DLLAPI prettyPrintEigen{ + static inline std::ostream & + run(std::ostream & os, const Derived& M){ + enum {Condensed = ((Option & OutputFormatBits) == OneLineOutput) || + ((Option & OutputFormatBits) == CondensedOutput)}; +static const Eigen::IOFormat mfmt_py = + eigen_format::run(); +static const Eigen::IOFormat vfmt_py = + eigen_format::run(); +static const Eigen::IOFormat mfmt_raw = + eigen_format::run(); +static const Eigen::IOFormat vfmt_raw = + eigen_format::run(); +bool use_py_fmt = (getpythonformat(os) != 0); +const Eigen::IOFormat& fmt = + (Derived::IsVectorAtCompileTime ? (use_py_fmt ? vfmt_py : vfmt_raw) + : (use_py_fmt ? mfmt_py : mfmt_raw)); +bool transpose = (Derived::ColsAtCompileTime == 1); + +if (transpose) + return os << M.transpose().format(fmt); +else + return os << M.format(fmt); +} // namespace hpp +} +; /// FIXME All eigen object must be manually specialized as follow... /// Pretty printer for Eigen::Matrix diff --git a/src/joint.cc b/src/joint.cc index 13fed5e..1ef5712 100644 --- a/src/joint.cc +++ b/src/joint.cc @@ -277,10 +277,11 @@ value_type computeMaximalDistanceToParent( const Model& model, const ::pinocchio::JointModelPrismaticTpl& jmodel, const SE3& jointPlacement) { - return computeMaximalDistanceToParentForAlignedTranslation< - Axis == 0, Axis == 1, Axis == 2>( - model.lowerPositionLimit.segment<1>(jmodel.idx_q()), - model.upperPositionLimit.segment<1>(jmodel.idx_q()), jointPlacement); + return computeMaximalDistanceToParentForAlignedTranslation < Axis == 0, + Axis == 1, + Axis == 2 > (model.lowerPositionLimit.segment<1>(jmodel.idx_q()), + model.upperPositionLimit.segment<1>(jmodel.idx_q()), + jointPlacement); } template