From a2a51f606d6a4ce66779e763690d40e4d5b1f736 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:45:40 +0000 Subject: [PATCH 1/3] [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.1 → v0.6.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.5.1...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 310e95e..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.1 + 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 7f02c64a78cc76f6ca144a3e27a29d4d32c3082c 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:01 +0000 Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- include/hpp/corbaserver/servant-base.hh | 21 ++++++------- src/problem.impl.cc | 39 ++++++++++++------------- tests/quat.py | 1 + 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/include/hpp/corbaserver/servant-base.hh b/include/hpp/corbaserver/servant-base.hh index 7457149..11fc3ed 100644 --- a/include/hpp/corbaserver/servant-base.hh +++ b/include/hpp/corbaserver/servant-base.hh @@ -484,16 +484,17 @@ struct vectorToSeqServant { /// // PathVector directly inherits from Path /// HPP_CORBASERVER_ADD_DOWNCAST_OBJECT(PathVector, Path, 1) /// \endcode -#define HPP_CORBASERVER_ADD_DOWNCAST_OBJECT(ServantType, BaseServantType, \ - depth) \ - struct HPP_CORE_DLLAPI __InitializerClass_##ServantType { \ - __InitializerClass_##ServantType() { \ - ::hpp::corbaServer::addDowncastObjects( \ - new ::hpp::corbaServer::ServantFactory(depth)); \ - } \ - }; \ - HPP_CORBASERVER_DLLLOCAL __InitializerClass_##ServantType \ +#define HPP_CORBASERVER_ADD_DOWNCAST_OBJECT(ServantType, BaseServantType, \ + depth) \ + struct HPP_CORE_DLLAPI __InitializerClass_##ServantType{ \ + __InitializerClass_##ServantType(){ \ + ::hpp::corbaServer::addDowncastObjects( \ + new ::hpp::corbaServer::ServantFactory(depth)); \ + } \ + } \ + ; \ + HPP_CORBASERVER_DLLLOCAL __InitializerClass_##ServantType \ __instance_##ServantType; #endif // HPP_CORBASERVER_SERVANT_BASE_HH diff --git a/src/problem.impl.cc b/src/problem.impl.cc index fa71871..5b7997f 100644 --- a/src/problem.impl.cc +++ b/src/problem.impl.cc @@ -163,12 +163,9 @@ DifferentiableFunctionPtr_t buildGenericFunc( if (relative) { // Both joints are provided - return constraints::GenericTransformation< - PositionOrientationFlag | constraints::RelativeBit>::create(name, robot, - joint1, - joint2, - ref1, ref2, - mask); + return constraints::GenericTransformation < PositionOrientationFlag | + constraints::RelativeBit > + ::create(name, robot, joint1, joint2, ref1, ref2, mask); } else { return constraints::GenericTransformation::create( name, robot, joint2, ref2, ref1, mask); @@ -581,10 +578,10 @@ void Problem::createTransformationConstraint(const char* constraintName, Transform3f ref(toTransform3f(p)); std::string name(constraintName); DifferentiableFunctionPtr_t func = - buildGenericFunc( - problemSolver()->robot(), name, joint1Name, joint2Name, ref, Id, - boolSeqToVector(mask, 6)); + buildGenericFunc < constraints::PositionBit | + constraints::OrientationBit > (problemSolver()->robot(), name, + joint1Name, joint2Name, ref, Id, + boolSeqToVector(mask, 6)); problemSolver()->addNumericalConstraint( name, @@ -606,11 +603,11 @@ void Problem::createTransformationConstraint2(const char* constraintName, if (!problemSolver()->robot()) throw hpp::Error("No robot loaded"); std::string name(constraintName); DifferentiableFunctionPtr_t func = - buildGenericFunc( - problemSolver()->robot(), name, joint1Name, joint2Name, - toTransform3f(frame1), toTransform3f(frame2), - boolSeqToVector(mask, 6)); + buildGenericFunc < constraints::PositionBit | + constraints::OrientationBit > + (problemSolver()->robot(), name, joint1Name, joint2Name, + toTransform3f(frame1), toTransform3f(frame2), + boolSeqToVector(mask, 6)); problemSolver()->addNumericalConstraint( name, @@ -632,12 +629,12 @@ void Problem::createTransformationR3xSO3Constraint(const char* constraintName, if (!problemSolver()->robot()) throw hpp::Error("No robot loaded"); std::string name(constraintName); DifferentiableFunctionPtr_t func = - buildGenericFunc( - problemSolver()->robot(), name, joint1Name, joint2Name, - toTransform3f(frame1), toTransform3f(frame2), - boolSeqToVector(mask, 6)); + buildGenericFunc < constraints::OutputR3xSO3Bit | + constraints::PositionBit | + constraints::OrientationBit > + (problemSolver()->robot(), name, joint1Name, joint2Name, + toTransform3f(frame1), toTransform3f(frame2), + boolSeqToVector(mask, 6)); problemSolver()->addNumericalConstraint( name, diff --git a/tests/quat.py b/tests/quat.py index c5913bf..93c7612 100644 --- a/tests/quat.py +++ b/tests/quat.py @@ -1,6 +1,7 @@ from math import cos, pi, sin, sqrt import numpy as np + from hpp import Quaternion ok = True From 7b16f77daea230e64edbdff30d02cc01dbfc0488 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 7 Oct 2024 20:43:34 +0200 Subject: [PATCH 3/3] fix E721 --- tests/problem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/problem.py b/tests/problem.py index 9341ae8..2d593d4 100644 --- a/tests/problem.py +++ b/tests/problem.py @@ -20,7 +20,7 @@ def test_tools(self): assert object_ids[0] == cl.orb.object_to_string(pb) pb2 = cl.orb.string_to_object(object_ids[0]) - assert type(pb) == type(pb2) + assert type(pb) is type(pb2) pb2.persistantStorage(False) def test_createConstraints(self):