From 4165ad0ac9c521894ecb22ddd37e4868b8d3857e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:17:28 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../crocoddyl/multibody/contacts/contact-1d.cpp | 6 +++--- include/crocoddyl/multibody/contacts/contact-1d.hpp | 11 +++++------ include/crocoddyl/multibody/contacts/contact-1d.hxx | 5 ++--- include/crocoddyl/multibody/contacts/contact-3d.hpp | 6 +++--- include/crocoddyl/multibody/contacts/contact-6d.hpp | 6 +++--- unittest/bindings/test_copy.py | 4 +++- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/bindings/python/crocoddyl/multibody/contacts/contact-1d.cpp b/bindings/python/crocoddyl/multibody/contacts/contact-1d.cpp index d12a725cd9..a350004c86 100644 --- a/bindings/python/crocoddyl/multibody/contacts/contact-1d.cpp +++ b/bindings/python/crocoddyl/multibody/contacts/contact-1d.cpp @@ -28,8 +28,8 @@ void exposeContact1D() { "The calc and calcDiff functions compute the contact Jacobian and drift " "(holonomic constraint) or\n" "the derivatives of the holonomic constraint, respectively.", - bp::init, pinocchio::FrameIndex, - Eigen::Vector3d, pinocchio::ReferenceFrame, std::size_t, + bp::init, pinocchio::FrameIndex, + Eigen::Vector3d, pinocchio::ReferenceFrame, std::size_t, bp::optional >( bp::args("self", "state", "id", "xref", "type", "nu", "gains"), "Initialize the contact model.\n\n" @@ -41,7 +41,7 @@ void exposeContact1D() { ":param gains: gains of the contact model (default " "np.matrix([0.,0.]))")) .def(bp::init, pinocchio::FrameIndex, - Eigen::Vector3d, pinocchio::ReferenceFrame, + Eigen::Vector3d, pinocchio::ReferenceFrame, bp::optional >( bp::args("self", "state", "id", "xref", "type", "gains"), "Initialize the contact model.\n\n" diff --git a/include/crocoddyl/multibody/contacts/contact-1d.hpp b/include/crocoddyl/multibody/contacts/contact-1d.hpp index a4f33a305b..fe11d1608e 100644 --- a/include/crocoddyl/multibody/contacts/contact-1d.hpp +++ b/include/crocoddyl/multibody/contacts/contact-1d.hpp @@ -42,9 +42,9 @@ class ContactModel1DTpl : public ContactModelAbstractTpl<_Scalar> { * * To learn more about the computation of the contact derivatives in different * frames see - * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary + * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary * Frames: Application to Polishing with Talos, ICHR 2022 - * + * * @param[in] state State of the multibody system * @param[in] id Reference frame id of the contact * @param[in] xref Contact position used for the Baumgarte stabilization @@ -63,7 +63,7 @@ class ContactModel1DTpl : public ContactModelAbstractTpl<_Scalar> { * The default `nu` is obtained from `StateAbstractTpl::get_nv()`. To learn * more about the computation of the contact derivatives in different frames * see - * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary + * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary * Frames: Application to Polishing with Talos, ICHR 2022 * * @param[in] state State of the multibody system @@ -157,8 +157,8 @@ class ContactModel1DTpl : public ContactModelAbstractTpl<_Scalar> { using Base::type_; private: - Vector3s xref_; //!< Contact position used for the Baumgarte stabilization - Vector2s gains_; //!< Baumgarte stabilization gains + Vector3s xref_; //!< Contact position used for the Baumgarte stabilization + Vector2s gains_; //!< Baumgarte stabilization gains }; template @@ -250,7 +250,6 @@ struct ContactData1DTpl : public ContactDataAbstractTpl<_Scalar> { Matrix6xs fXjda_dv; Matrix2s oRf; Matrix3xs fJf_df; - }; } // namespace crocoddyl diff --git a/include/crocoddyl/multibody/contacts/contact-1d.hxx b/include/crocoddyl/multibody/contacts/contact-1d.hxx index 9226a75459..fe0101b356 100644 --- a/include/crocoddyl/multibody/contacts/contact-1d.hxx +++ b/include/crocoddyl/multibody/contacts/contact-1d.hxx @@ -165,7 +165,7 @@ void ContactModel1DTpl::calcDiff( pinocchio::skew((oRf * d->a0_local).template head<3>(), d->a0_skew); d->a0_world_skew.noalias() = d->a0_skew * oRf; d->da0_dx.row(0) = (oRf * d->da0_local_dx).row(2); - d->da0_dx.leftCols(nv).row(0) -= + d->da0_dx.leftCols(nv).row(0) -= (d->a0_world_skew * d->fJf.template bottomRows<3>()).row(2); break; } @@ -186,7 +186,7 @@ void ContactModel1DTpl::updateForce( switch (type_) { case pinocchio::ReferenceFrame::LOCAL: data->fext.linear() = R.col(2) * force[0]; - data->fext.angular() = d->jMf.translation().cross(data->fext.linear()); + data->fext.angular() = d->jMf.translation().cross(data->fext.linear()); data->dtau_dq.setZero(); break; case pinocchio::ReferenceFrame::WORLD: @@ -201,7 +201,6 @@ void ContactModel1DTpl::updateForce( -d->fJf.template topRows<3>().transpose() * d->fJf_df; break; } - } template diff --git a/include/crocoddyl/multibody/contacts/contact-3d.hpp b/include/crocoddyl/multibody/contacts/contact-3d.hpp index 3360986a50..015a7d621f 100644 --- a/include/crocoddyl/multibody/contacts/contact-3d.hpp +++ b/include/crocoddyl/multibody/contacts/contact-3d.hpp @@ -42,8 +42,8 @@ class ContactModel3DTpl : public ContactModelAbstractTpl<_Scalar> { * @brief Initialize the 3d contact model * * To learn more about the computation of the contact derivatives in different - * frames see - * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary + * frames see + * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary * Frames: Application to Polishing with Talos, ICHR 2022 * * @param[in] state State of the multibody system @@ -64,7 +64,7 @@ class ContactModel3DTpl : public ContactModelAbstractTpl<_Scalar> { * The default `nu` is obtained from `StateAbstractTpl::get_nv()`. To learn * more about the computation of the contact derivatives in different frames * see - * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary + * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary * Frames: Application to Polishing with Talos, ICHR 2022 * * @param[in] state State of the multibody system diff --git a/include/crocoddyl/multibody/contacts/contact-6d.hpp b/include/crocoddyl/multibody/contacts/contact-6d.hpp index 780918753b..d481713378 100644 --- a/include/crocoddyl/multibody/contacts/contact-6d.hpp +++ b/include/crocoddyl/multibody/contacts/contact-6d.hpp @@ -41,7 +41,7 @@ class ContactModel6DTpl : public ContactModelAbstractTpl<_Scalar> { * * To learn more about the computation of the contact derivatives in different * frames see - * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary + * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary * Frames: Application to Polishing with Talos, ICHR 2022 * * @param[in] state State of the multibody system @@ -61,8 +61,8 @@ class ContactModel6DTpl : public ContactModelAbstractTpl<_Scalar> { * * The default `nu` is obtained from `StateAbstractTpl::get_nv()`. To learn * more about the computation of the contact derivatives in different frames - * see - * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary + * see + * S. Kleff et. al, On the Derivation of the Contact Dynamics in Arbitrary * Frames: Application to Polishing with Talos, ICHR 2022 * * @param[in] state State of the multibody system diff --git a/unittest/bindings/test_copy.py b/unittest/bindings/test_copy.py index 6f9dd2a8b5..bb2c83f828 100644 --- a/unittest/bindings/test_copy.py +++ b/unittest/bindings/test_copy.py @@ -317,7 +317,9 @@ class ContactsTest(CopyModelTestCase): MODEL.append(crocoddyl.ContactModelMultiple(state, actuation.nu)) COLLECTOR.append(pdata) MODEL.append( - crocoddyl.ContactModel1D(state, frame_id, np.ones(3), pinocchio.LOCAL, actuation.nu, np.zeros(2)) + crocoddyl.ContactModel1D( + state, frame_id, np.ones(3), pinocchio.LOCAL, actuation.nu, np.zeros(2) + ) ) COLLECTOR.append(pdata) MODEL.append(