Skip to content

Commit

Permalink
Merge pull request #207 from humanoid-path-planner/pre-commit-ci-upda…
Browse files Browse the repository at this point in the history
…te-config

[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
nim65s authored Oct 7, 2024
2 parents a8725a2 + 32c34d6 commit 7c54e99
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 33 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
52 changes: 26 additions & 26 deletions include/hpp/pinocchio/util.hh
Original file line number Diff line number Diff line change
Expand Up @@ -126,32 +126,32 @@ std::ostream& operator<<(std::ostream& os, const PrettyPrint<T, Option> pp) {

/// Generic implementation for Eigen objects
template <typename Derived, int Option>
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<Condensed, true, false>::run();
static const Eigen::IOFormat vfmt_py =
eigen_format<Condensed, true, true>::run();
static const Eigen::IOFormat mfmt_raw =
eigen_format<Condensed, false, false>::run();
static const Eigen::IOFormat vfmt_raw =
eigen_format<Condensed, false, true>::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<Condensed, true, false>::run();
static const Eigen::IOFormat vfmt_py =
eigen_format<Condensed, true, true>::run();
static const Eigen::IOFormat mfmt_raw =
eigen_format<Condensed, false, false>::run();
static const Eigen::IOFormat vfmt_raw =
eigen_format<Condensed, false, true>::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
Expand Down
9 changes: 5 additions & 4 deletions src/joint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,11 @@ value_type computeMaximalDistanceToParent(
const Model& model,
const ::pinocchio::JointModelPrismaticTpl<Scalar, Options, Axis>& 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 <typename Scalar, int Options>
Expand Down

0 comments on commit 7c54e99

Please sign in to comment.