Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 20, 2023
1 parent 1eef8b3 commit 4165ad0
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions bindings/python/crocoddyl/multibody/contacts/contact-1d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<boost::shared_ptr<StateMultibody>, pinocchio::FrameIndex,
Eigen::Vector3d, pinocchio::ReferenceFrame, std::size_t,
bp::init<boost::shared_ptr<StateMultibody>, pinocchio::FrameIndex,
Eigen::Vector3d, pinocchio::ReferenceFrame, std::size_t,
bp::optional<Eigen::Vector2d> >(
bp::args("self", "state", "id", "xref", "type", "nu", "gains"),
"Initialize the contact model.\n\n"
Expand All @@ -41,7 +41,7 @@ void exposeContact1D() {
":param gains: gains of the contact model (default "
"np.matrix([0.,0.]))"))
.def(bp::init<boost::shared_ptr<StateMultibody>, pinocchio::FrameIndex,
Eigen::Vector3d, pinocchio::ReferenceFrame,
Eigen::Vector3d, pinocchio::ReferenceFrame,
bp::optional<Eigen::Vector2d> >(
bp::args("self", "state", "id", "xref", "type", "gains"),
"Initialize the contact model.\n\n"
Expand Down
11 changes: 5 additions & 6 deletions include/crocoddyl/multibody/contacts/contact-1d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 <typename _Scalar>
Expand Down Expand Up @@ -250,7 +250,6 @@ struct ContactData1DTpl : public ContactDataAbstractTpl<_Scalar> {
Matrix6xs fXjda_dv;
Matrix2s oRf;
Matrix3xs fJf_df;

};

} // namespace crocoddyl
Expand Down
5 changes: 2 additions & 3 deletions include/crocoddyl/multibody/contacts/contact-1d.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ void ContactModel1DTpl<Scalar>::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;
}
Expand All @@ -186,7 +186,7 @@ void ContactModel1DTpl<Scalar>::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:
Expand All @@ -201,7 +201,6 @@ void ContactModel1DTpl<Scalar>::updateForce(
-d->fJf.template topRows<3>().transpose() * d->fJf_df;
break;
}

}

template <typename Scalar>
Expand Down
6 changes: 3 additions & 3 deletions include/crocoddyl/multibody/contacts/contact-3d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions include/crocoddyl/multibody/contacts/contact-6d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion unittest/bindings/test_copy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 4165ad0

Please sign in to comment.