Skip to content

Commit 29fbf6e

Browse files
Fix docstrings and data variable init
1 parent 47f1672 commit 29fbf6e

File tree

1 file changed

+21
-26
lines changed

1 file changed

+21
-26
lines changed

include/crocoddyl/multibody/contacts/contact-6d-loop.hpp

+21-26
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class ContactModel6DLoopTpl : public ContactModelAbstractTpl<_Scalar> {
4040
typedef typename MathBase::MatrixXs MatrixXs;
4141

4242
/**
43-
* @brief Initialize the 6d contact model from joint and placements
43+
* @brief Initialize the 6d loop-contact model from joint and placements
4444
*
4545
*
4646
* @param[in] state State of the multibody system
@@ -62,7 +62,7 @@ class ContactModel6DLoopTpl : public ContactModelAbstractTpl<_Scalar> {
6262
const Vector2s &gains = Vector2s::Zero());
6363

6464
/**
65-
* @brief Initialize the 6d contact model from joint and placements
65+
* @brief Initialize the 6d loop-contact model from joint and placements
6666
*
6767
*
6868
* @param[in] state State of the multibody system
@@ -84,19 +84,19 @@ class ContactModel6DLoopTpl : public ContactModelAbstractTpl<_Scalar> {
8484
virtual ~ContactModel6DLoopTpl();
8585

8686
/**
87-
* @brief Compute the 3d contact Jacobian and drift
87+
* @brief Compute the 6d loop-contact Jacobian and drift
8888
*
89-
* @param[in] data 3d contact data
89+
* @param[in] data 6d loop-contact data
9090
* @param[in] x State point \f$\mathbf{x}\in\mathbb{R}^{ndx}\f$
9191
* @param[in] u Control input \f$\mathbf{u}\in\mathbb{R}^{nu}\f$
9292
*/
9393
virtual void calc(const boost::shared_ptr<ContactDataAbstract> &data,
9494
const Eigen::Ref<const VectorXs> &x);
9595

9696
/**
97-
* @brief Compute the derivatives of the 6d contact holonomic constraint
97+
* @brief Compute the derivatives of the 6d loop-contact holonomic constraint
9898
*
99-
* @param[in] data 6d contact data
99+
* @param[in] data 6d loop-contact data
100100
* @param[in] x State point \f$\mathbf{x}\in\mathbb{R}^{ndx}\f$
101101
* @param[in] u Control input \f$\mathbf{u}\in\mathbb{R}^{nu}\f$
102102
*/
@@ -106,7 +106,7 @@ class ContactModel6DLoopTpl : public ContactModelAbstractTpl<_Scalar> {
106106
/**
107107
* @brief Convert the force into a stack of spatial forces
108108
*
109-
* @param[in] data 6d contact data
109+
* @param[in] data 6d loop-contact data
110110
* @param[in] force 6d force
111111
*/
112112
virtual void updateForce(const boost::shared_ptr<ContactDataAbstract> &data,
@@ -126,7 +126,7 @@ class ContactModel6DLoopTpl : public ContactModelAbstractTpl<_Scalar> {
126126
const MatrixXs& df_dx, const MatrixXs& df_du);
127127

128128
/**
129-
* @brief Create the 6d contact data
129+
* @brief Create the 6d loop-contact data
130130
*/
131131
virtual boost::shared_ptr<ContactDataAbstract> createData(
132132
pinocchio::DataTpl<Scalar> *const data);
@@ -250,7 +250,19 @@ struct ContactData6DLoopTpl : public ContactDataAbstractTpl<_Scalar> {
250250
f2Jf2(6, model->get_state()->get_nv()),
251251
f1Jf2(6, model->get_state()->get_nv()),
252252
j1Jj1(6, model->get_state()->get_nv()),
253-
j2Jj2(6, model->get_state()->get_nv()) {
253+
j2Jj2(6, model->get_state()->get_nv()),
254+
j1Xf1(SE3ActionMatrix::Identity()),
255+
j2Xf2(SE3ActionMatrix::Identity()),
256+
f1Mf2(SE3::Identity()),
257+
f1Xf2(SE3ActionMatrix::Identity()),
258+
f1vf1(Motion::Zero()),
259+
f2vf2(Motion::Zero()),
260+
f1vf2(Motion::Zero()),
261+
f1af1(Motion::Zero()),
262+
f2af2(Motion::Zero()),
263+
f1af2(Motion::Zero()),
264+
joint1_f(Force::Zero()),
265+
joint2_f(Force::Zero()) {
254266
v1_partial_dq.setZero();
255267
f1_v1_partial_dq.setZero();
256268
a1_partial_dq.setZero();
@@ -278,22 +290,6 @@ struct ContactData6DLoopTpl : public ContactDataAbstractTpl<_Scalar> {
278290
j1Jj1.setZero();
279291
j2Jj2.setZero();
280292
j2Jj1.setZero();
281-
//
282-
j1Xf1 = SE3ActionMatrix::Identity();
283-
j2Xf2 = SE3ActionMatrix::Identity();
284-
f1Mf2 = SE3::Identity();
285-
f1Xf2 = SE3ActionMatrix::Identity();
286-
//
287-
f1vf1 = Motion::Zero();
288-
f2vf2 = Motion::Zero();
289-
f1vf2 = Motion::Zero();
290-
//
291-
f1af1 = Motion::Zero();
292-
f2af2 = Motion::Zero();
293-
f1af2 = Motion::Zero();
294-
//
295-
joint1_f = Force::Zero();
296-
joint2_f = Force::Zero();
297293
}
298294

299295
using Base::a0;
@@ -353,7 +349,6 @@ struct ContactData6DLoopTpl : public ContactDataAbstractTpl<_Scalar> {
353349
// Force related data
354350
Force joint1_f;
355351
Force joint2_f;
356-
Force f_local;
357352
};
358353

359354
} // namespace crocoddyl

0 commit comments

Comments
 (0)